Revision 21e77d7f
ID | 21e77d7fede60e3d7f3f30940b16f603c15785d5 |
Hotplug: cmdlib support
Hotpluging is done by functions invoked by ApplyContainerMods(). In
order hotpluging to take place a --hotplug option must be passed.
Devices get assigned unique indexes derived from the ``dev_idxs``
instance slot.
In order initial devices of a VM to be hotplugable ``dev_idxs`` must be
early available. So _GetDeviceUniqueIdx() gets either lu.dev_idxs in case of
LUInstanceCreate() or invokes lu.cfg.UpdataDeviceUniqueIdx() in case of
LUInstanceSetParams().
If no --hotplug is passed during gnt-instance modify the modifycations
will take place after reboot.
If a device is hotplug-able it gets an index after which it gets named from
the hypervisor perspective.
Before hotpluging a Disk it must be assembled. During
LuInstanceSetParams() newly created disks are not added to the instance
so _ExpandCheckDisks() in _AssembleInstanceDisks() will fail. So we make
this check optional only for this case.
In order to remove a disk (with blockdev_remove) it must be shutdown. So
after unpluging the disk _ShutdownDiskInstanceDisks() must be invoked.
Everything else is just like NIC hotplugging.
Add logging in case of hotplug.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Files
- added
- modified
- copied
- renamed
- deleted