« Previous | Next » 

Revision 939d71dd


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.


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences