« Previous | Next » 

Revision 939d71dd

ID939d71dd871b73f3272929facd2946be7ee3d438

Added by Christos Stavrakakis over 11 years ago

Create public NIC when creating VM

Until now, a server's public NetworkInterface was not created in the DB
until the arrival of the message from Ganeti hooks. However, the IPv4
address of the NIC is reserved before sending the OP_INSTANCE_CREATE
job to Ganeti.

This drawback of this approach is that if the Ganeti hooks never run
(building ERROR), Cyclades will never associate the IPv4 address with
a machine and therefore this address will never be released.

This commit fixes this issue by creating the VM's public NIC in DB when
creating the server. Also the NetworkInterface model is extended with
a 'state' field to indicate if the NIC is active or still building.
Finally, the corresponding API calls are modified in order to return
only 'ACTIVE' NICs.

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences