Clean up virtual SCSI disks without an outage
AnthonyEnglish 270000RKFN Comments (6) Visits (18231)
If you are using virtual SCSI (VSCSI) disks, you may occasionally find you need to reclaim them. (Shocking as it may seem, sometimes people actually do give back disk they have requested for some temporary project). Here's how to reclaim a VSCSI disk and its associated SAN LUN. Ordinarily, there should be no need for a reboot, either of the AIX logical partition or the Virtual I/O Server.
I'm giving a sort-of high level view, skipping the SAN allocation details.
Switching into reverse
Removing a VSCSI disk (and its LUN) is just the reverse of the steps you go through to assign a disk.
First, on the AIX LPAR, remove all partitions from the disk (reduce, move or remove file systems and logical volumes that are assigned to that disk). Then ensure there are no PPs (Physical Partitions) in use for that disk:
If the disk is not assigned to a volume group, then the lspv command will fail, but that's not a problem as the disk is already free.
Remove this disk from the volume group:
If the disk still has some partitions allocated to it, the reducevg command will fail. Gotta love the way, the AIX Logical Volume Manager protects me from my own stupidity.
Then remove the hdisk device from AIX:
Now on each VIO server, you can remove the Virtual Target Device (VTD). If it is called vtscsi4, you can remove it by logging in as padmin and running:
Note: if this disk hasn't been deallocated from the AIX LPAR, the path from this VIO server will report that it is down. If it were done on the second VIO server as well, the disk would be reported as missing on the AIX LPAR. This is why the AIX LPAR disk removal needs to be done first. Also note that this is the command rmvdev, not rmdev.
Now that the VIOS VTD has been removed, you should now see a LUN that is free on the VIOS:
At this stage, you can remove the hdisk which has been assigned to the VIOS. Let's assume it's called hdisk27:
You can then unmap that LUN from the SAN to the VIO server. You can then do the same procedure from the second VIOS and remove the LUN on the SAN or allocate it to something else.
You may also* like VSCSI disks on the loose: map 'em or scrap 'em.
* Assuming, of course, that you liked this blog post.