Red Hat Bugzilla – Bug 760795
support renaming a volume -- virStorageVolumeRename
Last modified: 2016-03-23 10:40:48 EDT
Description of problem:
i want to rename volume using libvirt api, but i am unable to do so -- I have to use all kinds of other tools to achieve the needed result.
what should be done: implement virStorageVolumeRename which will rename the volume (using the same pool)...
see also https://bugzilla.redhat.com/show_bug.cgi?id=760796 -- moving volume to another pool would be very nice to have supported in api.
I don't think you are unable to rename a volume or any other object using libvirt. I know this bug went stale, but anyway. You can use combination of virStorageVolGetXMLDesc(), virStorageVolCreateXML() and virStorageVolDelete() you can rename any volume. Just change name and UUID between 1st and 2nd step.
In fact, this is an undocumented feature of virsh as well: if you virsh *edit $obj; change <name> and remove <uuid> (or change it to a non-existing one), you effectively create a clone of the object. Then use just virsh undefine $obj; to undefine original object.
Hence, I am suggesting to close this as NOTABUG. Any ideas?
Closing as NOTABUG per comment #2