(2.10) Hotplug: cmdlib support
authorDimitris Aragiorgis <dimara@grnet.gr>
Wed, 9 Oct 2013 14:45:35 +0000 (17:45 +0300)
committerDimitris Aragiorgis <dimara@grnet.gr>
Thu, 27 Mar 2014 07:56:53 +0000 (09:56 +0200)
commitd26af78e0697871d9b9bd478dea733e7843f83ba
tree14ad57e60e1fa7ec4aaaee8d70fa5e4d96c82722
parent3531ba0b4808bc778b7c7f752b49ea0ace5e8440
(2.10) Hotplug: cmdlib support

Hotplugging is done by functions invoked by ApplyContainerMods(). In
order hotplugging to take place the --hotplug option must be passed
otherwise the modifications will take place after reboot.

NIC hotplug supports add, remove and modify. The modify is done by removing
the existing NIC and adding a new one in the same pci slot.

Disk hotplug supports add and remove.  Before hotplugging a Disk it
must be assembled. Use blockdev_assemble RPC, get the device link_name
and then call hotplug RPC command.

In order to remove a disk (with blockdev_remove) it must be shutdown. So
after unplugging the disk ShutdownDiskInstanceDisks() must be invoked.

For both device types we use the generic RPC call_hotplug_device.

Also adapt unit tests to follow the change.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

cmdlib unittests do not exist in stable-2.8
The other were easy to resolve

Conflicts:
lib/cmdlib/instance.py
lib/cmdlib/instance_storage.py
test/py/cmdlib/backup_unittest.py

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
lib/cmdlib/instance.py
lib/cmdlib/instance_storage.py