Feilong is a open source z/VM cloud connector project under the Open Mainframe Project umbrella that will accelerate the z/VM adoption, extending its ecosystem and its user experience. It provides a set of APIs to operate z/VM including guest, image, network, volume etc.
This PR was tested to work, but I'd like expert advice before merging it.
My code might be very naive, or even incorrect.
With current code when you:
create a VM guest
attach a disk via AttachVolume() to that guest
forget to detach it via DetachVolume()
delete the instance
then the disk stays counted as attached to the deleted instance.
If you recreate the instance, then AttachVolume() will skip the dedication, because it considers that the disk is already dedicated to the instance, while it is not.
This PR resets the FCP records in database for the deleted instance at time of deletion.
PLEASE DO NOT MERGE IMMEDIATELY
This PR was tested to work, but I'd like expert advice before merging it. My code might be very naive, or even incorrect.
With current code when you:
AttachVolume()
to that guestDetachVolume()
then the disk stays counted as attached to the deleted instance.
If you recreate the instance, then
AttachVolume()
will skip the dedication, because it considers that the disk is already dedicated to the instance, while it is not.This PR resets the FCP records in database for the deleted instance at time of deletion.