« Previous | Next » 

Revision 2cec9236

ID2cec923610bfd1912976ad71dcbc553f6e824dd2

Added by Dimitris Aragiorgis about 10 years ago

ifdown: Introduce helper methods

Until now Ganeti upon TAP creation, a NIC file was created
under $RUNDIR/kvm-hypervisor/nic/<instance_name>/<nic_index>

Since NICs have obtained a UUID, we are going to create another
file named after its UUID. This will be needed during ifdown
script in order to retrieve the tap name related to the
corresponding NIC. Index of a NIC may change but UUID will not;
When a NIC is getting hot-plugged may be the third one from
the master perspective but after removing the second, its index
will change.

In the following patches we are going to refer to NIC files
named after NIC's uuid. Here we add helper methods that
add/remove those kind of files. For retrieving NIC's tap name
we search only for a NIC file named after its UUID. If not
found (e.g. in case of already existing instances) we fail
silently. External ifdown script must deal with this corner case.

To keep compatibility we still create NIC files based on their
current index.

Signed-off-by: Dimitris Aragiorgis <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences