HMC

 View Only
  • 1.  How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Fri July 08, 2016 05:56 PM

    Originally posted by: RaviW



    I would like to know how to map VirtualDisk info from "/rest/api/uom/VirtualIOServer/{VirtualIOServer_uuid}/VolumeGroup" response to the response of


    "/rest/api/pcm/LogicalPartition/{uuid}/ProcessedMetrics" or "/rest/api/pcm/ManagedSystem/{uuid}/ProcessedMetrics"

    ----------------------

    <VirtualDisk schemaVersion="V1_2_0">
                <Metadata>
                    <Atom/>
                </Metadata>
                <DiskCapacity kb="CUR" kxe="false">100</DiskCapacity>
                <DiskLabel kb="CUR" kxe="false">None</DiskLabel>
                <DiskName kb="CUR" kxe="false">as400e_fs</DiskName>
                <VolumeGroup kb="ROR" kxe="false" href="https://hmc.example.com:12443/rest/api/uom/VirtualIOServer/78366786-F88E-4FFA-9FE0-58BBBCC6FC40/VolumeGroup/5e73de31-f318-3622-8337-df3f60626562" rel="related"/>
                <UniqueDeviceID kb="ROR" kxe="false">0300f9cf1d00004c000000014d11024524.2</UniqueDeviceID>
            </VirtualDisk>

    ---------------------------------------

    "storage": {
                        "genericVirtualAdapters": [{
                            "id": "vhost4",
                            "type": "virtual",
                            "viosId": 2,
                            "physicalLocation": "U8286.41A.21CF1DV-V7-C3",
                            "numOfReads": [0.933],
                            "numOfWrites": [0.933],
                            "readBytes": [477.867],
                            "writeBytes": [477.867]
                        }]
                    },

    ----------------------------------

    How can we figure out which virtual disk the processed metrics json data corresponds with in the Volume Group response?



  • 2.  Re: How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Thu July 14, 2016 06:21 AM

    Originally posted by: manjunathns


    Hi,

    Currently PCM does not give the storage mapping related information. It gives the information about the read/write at adapter (vhost) level. So it is possible that, there are multiple storages (Logical Volume, Physical Volume etc) are mapped to the same vhost adapter. In that case, PCM will give the aggregated information of read//write.

    To get the storage mapping information, you could use /rest/api/uom/VirtualIOServer/$UUID rest call. This will give the information about the VirtualIOServer which include the storage mapping information also. Please look into the VirtualSCSIMappings information. Thanks!

    -Manju



  • 3.  Re: How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Thu July 14, 2016 04:44 PM

    Originally posted by: RaviW


    Hi Manju,

    Thanks for the reply. 

    Is there way to find out which Logical Volumes and Physical Volumes are under vhosts and sissas ?

    Is there any other way to get the read/write info per Logical Volumes and Physical Volumes ?

     

    Thanks,

    Ravi



  • 4.  Re: How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Fri July 15, 2016 06:21 AM

    Originally posted by: manjunathns


    Hi Ravi,

     

    To know which LogicalVolume/PhysicalVolume mapped to which vHost, you could use the REST /rest/api/uom/VirtualIOServer call. The required information is in VirtualSCSIMappings. If you want to know this information in VIOS, you could use "lsmap -all" command(login to VIOS as a padmin user). REST response will also contain PhysicalVolume to physical adapter mapping. You can look into the PartitionIOConfiguration (applicable only for FC backed devices) in the VirtualIOServer REST response. The "lspath" VIOS command (login to VIOS as padmin) gives that response.

     

    You can use the "iostat -a" VIOS command to get the read/write for the Physical Volume (login to VIOS as root).  You can use "lvmstat" command to get the LogicalVolume read/write (login to VIOS as root). This information is not available in REST. The link has more information about lvmstat : https://www.ibm.com/support/knowledgecenter/ssw_aix_53/com.ibm.aix.cmds/doc/aixcmds3/lvmstat.htm

    -Manju



  • 5.  Re: How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Fri July 15, 2016 07:39 PM

    Originally posted by: RaviW


    Thanks again for the reply it is really helpful.

     

    in our /rest/api/uom/VirtualIOServer response VirtualSCSIMappings is empty.

        <VirtualSCSIMappings group="ViosSCSIMapping" kb="CUD" kxe="false" schemaVersion="V1_2_0">
            <Metadata>
                <Atom/>
            </Metadata>
        </VirtualSCSIMappings>

     

    What could be the reason ? the user account used for the rest call does not have enough permissions or need to enable this in VIO ?



  • 6.  Re: How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Fri July 15, 2016 10:18 PM

    Originally posted by: manjunathns


    There are two reasons why Mapping information is not available in the REST response.

    1. There is actually no mapping in VIOS. None of the storage is mapped to the vHost in VIOS. You could execute "lsmap -all" command in VIOS to verify that (login to VIOS as padmin)

    2. The RMC state of the VIOS is not active. You can check the attribute "ResourceMonitoringControlState" of the REST response to verify that. Thanks!

    -Manju



  • 7.  Re: How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Tue July 19, 2016 06:15 PM

    Originally posted by: redfive-jm


    Hi Manju,

    I'm another developer with the same team. If I understand you correctly, this means that there is (currently) no way to know which LPAR is using which Virtual Disk, only which Vhost?



  • 8.  Re: How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Fri July 22, 2016 08:04 AM

    Originally posted by: manjunathns


    Hi,

    No, that is not what i mean. Sorry if i am not clear on explaining it.
    Basically in the previous note, it was mentioned that "VirtualSCSIMappings" is empty. That could happen when there is no storage mapped to the vHosts or there is no vHosts available in the VIOS. Did you check if the "lamap -all"  gave any mapping information?
    If you have virtual disk mapped to the vHost in VIOS, then "lsmap -all" will return with the mapping information. Same is even reflected in the "VirtualSCSIMappings" in the REST VirtualIOServer response.
    -Manju



  • 9.  Re: How to map VirtualDisk disk info to a Lpar processed metrics?

    Posted Wed July 27, 2016 01:03 PM

    Originally posted by: manjunathns


    In response to the e-mail inquiry you sent, I thought it would be helpful to share with others, and hence documenting the reply in this link. Let me know if you have any comments.

    • How to map virtualDisks (from StoragePools rest response) to LPARs ?
    Mapping a virtual disk from the storage pool (or volume group) includes 1. create the client scsi adapter for the logical partition 2. create a server scsi adapter on a VIOS (where the Storage Pool is created) 3. Map the virtual disk to the server adapter.

    All these steps can be performed in a single POST operation on a VirtualIOServer REST object. You will need to add new entry to VirtualSCSIMappings of the VirtualIOServer REST response, and perform the POST operation. REST VirtualIOServer GET response has VirtualSCSIMappings, which is collection of "VirtualSCSIMapping" REST object.

    The entry which you need to add to the VirtualSCSIMappings, should be something like below. Where you need to specify the atom link of the LogicalPartition to which the virtual disk to be mapped in "AssociatedLogicalPartition" and specify the virtual disk to be mapped in "VirtualDisk" section. And perform the POST operation. 

                    <VirtualSCSIMapping schemaVersion="V1_4_0">
                        <Metadata>
                            <Atom/>
                        </Metadata>
                        <AssociatedLogicalPartition kxe="false" kb="CUR" href="https://<HMC IP>:12443/rest/api/uom/ManagedSystem/$ManagedSystemUUID/LogicalPartition/$LogicalPartitionUUID" rel="related"/>
                        <Storage kb="CUR" kxe="false">
                            <VirtualDisk schemaVersion="V1_4_0">
                                <Metadata>
                                    <Atom/>
                                </Metadata>
                                <DiskName kxe="false" kb="CUR">mydisk</DiskName>
                            </VirtualDisk>
                        </Storage>
                    </VirtualSCSIMapping>

    Please note : You should perform a GET of VirtualIOServer, and to the received response you need to add the new "VirtualSCSIMapping". Then modified feed can be POSTed to attach the VirtualDisk. Removal of the exiting mapping from the GET response and performing POST will unmap the storage and remove the client/server SCSI adapter.

    • How to map virtualDisks to vhost ?
    The steps is same as above. In HMC REST, you need to use the POST on VirtualIOServer mechanism to attach/detach the storage to the client partition. If you want to attach the storage to the specific vHost, then specify that in the "ServerAdapter" section in the VirtualSCSIMapping. In the below example, after POST operation a mapping will be created, where the virtual disk will be mapped to the server SCSI Adapter with the slot number 21. If before the POST, VIOS does not have the server SCSI adapter with this slot, then HMC REST will create the new server with the slot number specified and map the storage to it.

                    <VirtualSCSIMapping schemaVersion="V1_4_0">
                        <Metadata>
                            <Atom/>
                        </Metadata>
                        <AssociatedLogicalPartition kxe="false" kb="CUR" href="https://<HMC IP>:12443/rest/api/uom/ManagedSystem/$ManagedSystemUUID/LogicalPartition/$LogicalPartitionUUID" rel="related"/>

                        <ServerAdapter kb="CUR" kxe="false" schemaVersion="V1_4_0">
                            <Metadata>
                                <Atom/>
                            </Metadata>
                            <VirtualSlotNumber kb="COD" kxe="false">21</VirtualSlotNumber>
                        </ServerAdapter>
                        <Storage kb="CUR" kxe="false">
                            <VirtualDisk schemaVersion="V1_4_0">
                                <Metadata>
                                    <Atom/>
                                </Metadata>
                                <DiskName kxe="false" kb="CUR">mydisk</DiskName>
                            </VirtualDisk>
                        </Storage>
                    </VirtualSCSIMapping>

    Note : Similar to the server adapter, you could specify client slot number also. If you do not specify any client/server slot number then HMC REST will pick the next available slot number to create the mapping and then attach the storage to the newly created server SCSI adapter.
    You will be able to map multiple store to the same server adapter. To do this, you need to create the multiple VirtualSCSIMapping object with the same server adapter but with the different storage. And then perform the POST with the modified feed.

    •             Is there an rest response that would include hostname and IP address properties for a LPAR ?
    The REST GET response for LogicalPartition object will have an attribute ResourceMonitoringIPAddress. This indicates the IP Address of the logical partition. But we do not have have a way to report the hostname in the REST response. The format will be something like below.

    <ResourceMonitoringIPAddress kb="CUD" kxe="false">9.41.165.124</ResourceMonitoringIPAddress>