After a VM has deployed or imported, an operator may find themselves needing to move it to a different storage provider. While it is straight forward to add a new volume to a VM within PowerVC and then migrate data within the VM to the newly add volume, telling PowerVC about the boot disk changing requires some additional steps.
PowerVC will prevent an operator from detaching the first boot volume from a VM. Therefore, to detach a boot volume that is no longer being used by an operating system instance, you need to make use of a UI feature introduced with PowerVC 1.2.3 that allows the operator to modify the volume that PowerVC knows as the first boot volume.
To replace your boot disk, you will need to create and attach a new volume, set it up within the operating system, make it the first boot volume within PowerVC, then remove the original volume.
1. Create and attach a new volume
The first step to replace the boot volume is to create a new volume, then access the PowerVC user interface and attach that volume to the VM. This new volume will become the VM's boot volume.
2. Set up the new volume so it works with the operating system
Discover the new volume inside the operating system instance. This must be done by logging in to the operating system of the VM where the boot volume is going to be replaced. The procedures are different depending on the OS the VM is running. The example that follows shows the commands to run on AIX.
For a VM running AIX log into the VM, and run cfgmgr to to discover the attached disk.
# cfgmgr
#
Then, using the AIX lspv command, find the newly discovered volume. In this example, the new volume is hdisk2 and the original rootvg disk is hdisk0:
# lspv
NAME PVID VG STATUS
hdisk0 0002a62afbc9b42e rootvg active
hdisk1 0002a62a2477522c None
hdisk2 none None
3. Replace the original boot volume with the new boot volume
The commands to replace the boot volume vary by OS. This example on AIX uses the replacepv command to move the OS to the new volume. The replacepv command will add the replacement volume to the rootvg of the AIX instance and migrate all of the data to the replacement volume then remove old volume from the rootvg.
For a VM running the AIX log into the VM and use the replacepv command to move the OS to the replacement volume.
# replacepv hdisk0 hdisk1
# lspv
NAME PVID VG
hdisk0 0002a62afbc9b42e None
hdisk1 0002a62a2477522c rootvg
hdisk2 0002a62bfad86331 None
Use the bosboot command to reset the AIX bootlv on the replacement volume, then use the bootlist command make the VM boot from the replacement volume.
# bosboot -ad hdisk1
bosboot: Boot image is 51228 512 byte blocks.
# bootlist -m normal -o hdisk1
hdisk0 blv=hd5 pathid=0
The last step on the operating system will be to remove the original hdisk from the AIX OS instance using the rmdev command:
# rmdev -dl hdisk0
4. Make the new volume the boot volume in PowerVC
From within the PowerVC Virtual Machines page, click on the virtual machine to enter the Virtual Machine details page. On the Virtual Machines details page click on the “Edit Details” button to bring up the Edit Details dialog. This dialog will allow the Order and Boot Set designation to be changed.
The boot volume is always at the top of the list and has a “Boot Set” value of Yes.
Move the new boot volume to the top of the list so that it is 1 in the Order column and change the “Boot Set” value to Yes.
On the original boot volume that you want to detach from the virtual machine, change the “Boot Set” value to No.
After saving your changes, the original boot volume can be detached from the virtual machine by clicking on the the “Attached Volumes” tab, select the original boot volume and click the “Detach” button.
A sample Virtual Machine's Edit Details page before modification.

A sample Virtual Machine's Edit Details page after modification.
In this screen capture, the new boot volume has been moved to the top of the list to replace the original boot volume in the Order 1 position and has a “Boot Set” property of Yes. The original boot volume is now in position 2 in the Order and has a “Boot Set” property of No.

With PowerVC 1.2.3, you can change which volume is the boot volume; allowing you to remove boot volumes that are no longer in use. If you have any questions about these steps, respond below. We'd love to hear from you! And don't forget to follow us on LinkedIn, Facebook, and Twitter!