The new chkdev command for VIOS 2.1.
cggibbo 270000TMUJ Comment (1) Visits (9941)
Upon reading through the release notes for Fix Pack 22 for VIOS 2.1, I stumbled across a new command called chkdev. According to the notes, this command was “added to help you check devices for virtual provisioning capability”. This fired my curiosity and as soon as I had applied FP22 to one of my VIOS, I started using this command to see what it could do for me!
First, I checked the man page for chkdev. It stated that chkdev can determine whether or not a device can be used in physical to virtual (p2v) migration on a VIOS.
Checks devices for virtual device provisioning capability in the Virtual I/O Server.
chkdev [-dev Name] [-verbose] [-field FieldName ] [-fmt delimiter]
The chkdev command determines whether a device can be used in physical to virtual transitions in the Virtual I/O Server. Devices include all physical volumes and multipath representations of logical units. If the -dev option is used, information is shown for the device specified. If the -verbose option is used, detailed information is shown. With the -field option, the user can specify which fields to display. With the -fmt option, the user can format the output to be separated by a given delimiter.
Capability in a virtual environment refers to the capability for a device to move between a physical environment to a virtual environment. The command displays these fields: Phys2Virt_Capable, Virt2NPIV_Capable, and Virt2Phys_Capable.
For a device to be capable of moving from a physical to a virtual environment, it must pass the address compatibility check. If the physical volume can be moved from a physical to a virtual environment, the Phys2Virt_Capable field has a value of YES. If the device is not capable of this move, the field has a value of NO. If the device is already in use by Virtual Small Computer System Interface (VSCSI), the field has a value of NA.
If a device is capable of moving from a VSCSI LUN environment to an N_Port ID Virtualization (NPIV) environment, it must pass the addr
Determination of whether a device is capable of moving from a virtual environment to a physical environment is applicable for devices that are mapped as VTDs. For devices to be capable of moving from a virtual environment to a physical environment, it must pass the address capability test.
If the physical volume is capable of being transferred from a virtual environment to a physical environment, the Virt2Phys_Capable field has a value of YES. If the device is not capable of this move, the field has a value of NO. If the device is not in use by VTD, the field has a value of NA.
So, I ran this command on my VIOS and focused on the attributes of two different disk types. The first, hdisk1, was a (internal) SAS drive and the second was a FC attached SAN disk (IBM DS8100).
$ lsdev -type disk
name status description
hdisk0 Available SAS Disk Drive
hdisk1 Available IBM MPIO FC 2107
hdisk2 Available IBM MPIO FC 2107
hdisk3 Available IBM MPIO FC 2107
hdisk4 Available IBM MPIO FC 2107
hdisk5 Available IBM MPIO FC 2107
hdisk6 Available IBM MPIO FC 2107
name status description
vtscsi0 Available Virtual Target Device - Disk
vtscsi1 Available Virtual Target Device - Disk
vtscsi2 Available Virtual Target Device – Disk
$ lsmap -all
Backing device hdisk1
From the chkdev output, I could determine that hdisk0 could be virtualised and presented to an LPAR (PHY
The attributes for hdisk1 showed that this disk had already been successfully mapped to an LPAR from the VIOS i.e. PHYS
The -verbose flag provides additional attributes about a disk device. You can obtain the PVID, UDID, IEEE and VTD attributes, which may be useful in identifying and validating disks on a VIOS. For example looking at the output below, I can easily verify which VTD hdisk1 is currently mapped to on the VIOS. And I can quickly confirm that hdisk0 is not currently mapped to a VTD.
$ chkdev -dev hdisk0 -verbose
$ chkdev -dev hdisk1 -verbose
This command is also mentioned in a new Redbook called “PowerVM Migration from Physical to Virtual Storage”. I recommend you take a look at it and so does Rob McNelly!