Libvirt Storage Volume Renaming: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
1. Shutdown all the virtual machines that use the volume:
1. Shutdown all the virtual machines that use the volume:


[[virsh vol-clone|virsh vol-clone --pool main-storage-pool test-volume.raw test-volume-2.raw]]
2. Clone the volume, under a different name.


2. Clone the volume, under a different name.
virsh vol-clone --pool main-storage-pool test-volume.raw test-volume-2.raw
 
For more details, see [[virsh vol-clone]].


3. Delete the original storage volume from the pool with [[virsh vol-delete]]. Note that [[virsh vol-delete]] will also delete the ''content'' of the underlying storage, not just removes the storage volume definition from the pool. <font color=red>TODO: verify this one more time and Wan in virsh vol-delete</font>.
3. Delete the original storage volume from the pool with [[virsh vol-delete]]. Note that [[virsh vol-delete]] will also delete the ''content'' of the underlying storage, not just removes the storage volume definition from the pool. <font color=red>TODO: verify this one more time and Wan in virsh vol-delete</font>.


  virsh vol-delete test-volume.img main-storage-pool
  virsh vol-delete test-volume.img main-storage-pool

Revision as of 15:24, 30 June 2017

Internal

Overview

There is no virsh command to rename a volume, but it can be achieved via the following sequence of steps:

1. Shutdown all the virtual machines that use the volume:

2. Clone the volume, under a different name.

virsh vol-clone --pool main-storage-pool test-volume.raw test-volume-2.raw

For more details, see virsh vol-clone.

3. Delete the original storage volume from the pool with virsh vol-delete. Note that virsh vol-delete will also delete the content of the underlying storage, not just removes the storage volume definition from the pool. TODO: verify this one more time and Wan in virsh vol-delete.

virsh vol-delete test-volume.img main-storage-pool