We're really spoiled with virtualisation. It's so easy for us to map a LUN or a logical volume and build an LPAR, then load an operating system onto it. This makes it easy for temporary, test systems to be built and never get cleaned up.
Why is that? Simple. It's because
There's nothing so permanent as a temporary solution.
Removing an LPAR that you no longer want to use is easy enough, but somehow those LUNs or logical volumes on the VIO server just never seem to get cleaned up. Which disks are they again?
Or maybe you need to identify new LUNs which you have masked to the VIO server so you can map them to make them available on the VIO client. Time to
Round 'em up, cowboy!
Here, at the usual price to AIX Down Under readers, are three commands which will help you to FIND THAT DISK TO NOWHERE as well as give you an idea of just what size disks (physical or virtual) you're using.
There are three commands:
- lspv -free lets you see which disks are not mapped to a vscsi device
- lslv -free shows the logical volumes which aren't mapped
- lspv -size shows all disk with their sizes in megabytes
List DISKS which are not mapped:
You can list LUNs mapped to a VIO server but not associated with a vscsi device. This also will show you any internal disks which haven't been mapped through to a VIO client. Use the VIO server lspv command with the -free flag:
NAME PVID SIZE(megabytes)
hdisk3 00cb07a479f59553 51200
hdisk4 00cb07a479f5bcb3 51200
hdisk5 00cb07a479f53a29 51200
hdisk6 00cb07a479f569f7 51200
As the command documentation explains, the -free flag
Notice that it shows the size of the disk in meg? Pretty nice.
List LOGICAL VOLUMES which are not mapped:
In the same way, you can list logical volumes which are not mapped through to a vsci adapter for allocating to a VIO client. Can you guess what that command will be?
lslv -freeThat was just a test lv I created. Shouldn't really clutter the VIOS rootvg, should I?
# lslv -free
LV NAME SIZE(megabytes) VOLUME GROUP
client1_hd0 2048 rootvg
List SIZES of physical volumes
You can see the sizes of your disks on the VIO server using the lspv -size command. I really like this one. In AIX it's not so easy to work out the size of a disk (either physical or a LUN) unless it belongs to a volume group. This command on the VIO server lets you see the sizes of them all,
- whether they are in a VG or not
- whether they have been mapped as backing devices or not.
The sizes of these LUNs are all over the shop. Who woulda known?
NAME PVID SIZE(megabytes)
hdisk0 00c5a47ed8b627a6 70006
hdisk1 00c5a47ed9e58b2b 70006
hdisk51 none 25600
hdisk52 none 512000
hdisk5 none 25600
hdisk6 00c5a47eed76a134 40960
hdisk7 none 51200
Deploy or destroy
Those three little commands can save you a lot of time and help you to trace naughty little (or big) disks which someone has let loose on the system. They're just slacking off, pretending to be working but actually just leaning on their shovel. Once you know they exist, you're half way there to fixing them. You could map them to a vscsi adapter using the mkvdev command, or you could get rid of them, first on the VIO server and then - for LUNs - on the SAN.
In other words,
Map 'em or scrap 'em!