HMC

 View Only
Expand all | Collapse all

Looking for help getting the "LogicalPartition PowerOn" REST API call working for netbooting an LPAR.

  • 1.  Looking for help getting the "LogicalPartition PowerOn" REST API call working for netbooting an LPAR.

    Posted Mon August 26, 2024 08:00 AM

    Hi Group,

    I am trying to activate & netboot an LPAR through the HMC REST API.

    I am able to login and retrieve the authentication token and am using it for subsequent calls.

    I am using the XML parameters for the "LogicalPartition PowerOn" call as seen here:

    https://www.ibm.com/docs/en/power10?topic=jobs-poweron-logicalpartition-job

    I can activate an LPAR when "OperationType" is "activate" or absent from the submitted XML.

    Now, I would like to netboot the LPAR, but when I submit the PowerOn job with "OperationType"  "netboot",  the following error is returned:

    Parameter 'OperationType' is not allowed for this Job. 

    Looking for some help :)



    ------------------------------
    Best regards,
    Mark Nellemann
    Advisory Power Technical Specialist
    IBM
    ------------------------------


  • 2.  RE: Looking for help getting the "LogicalPartition PowerOn" REST API call working for netbooting an LPAR.

    Posted Wed September 04, 2024 06:07 AM

    Hi 

       To netboot the LPAR need to invoke PowerOn job with "OperationType"  "netboot" and pass X-HMC-Schema-Version : V1_2_0 in the header.

    Below is sample input payload and header for PowerOn Job 

    Headers 

    X-HMC-Schema-Version : V1_2_0

    Content-Type : application/vnd.ibm.powervm.web+xml; type=JobRequest

    XML Payload 

    <JobRequest:JobRequest

     xmlns:JobRequest="http://www.ibm.com/xmlns/systems/power/firmware/web/mc/2012_10/"

     xmlns="http://www.ibm.com/xmlns/systems/power/firmware/web/mc/2012_10/"

     xmlns:ns2="http://www.w3.org/XML/1998/namespace/k2" schemaVersion="V1_2_0">

        <Metadata>

            <Atom/>

        </Metadata>

        <RequestedOperation kb="CUR" kxe="false" schemaVersion="V1_0">

            <Metadata>

                <Atom/>

            </Metadata>

            <OperationName kb="ROR" kxe="false">PowerOn</OperationName>

            <GroupName kb="ROR" kxe="false">LogicalPartition</GroupName>

        </RequestedOperation>

       <JobParameters kxe="false" kb="CUR" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <JobParameter ns2:id="LogicalPartitionProfileUUID" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">LogicalPartitionProfileUUID</ParameterName>

    <ParameterValue kxe="false" kb="CUR">1d32e7df-ec53-38a6-828e-e656d811543a</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="IPAddress" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">IPAddress</ParameterName>

    <ParameterValue kxe="false" kb="CUR">10.32.64.249</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="ServerIPAddress" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">ServerIPAddress</ParameterName>

    <ParameterValue kxe="false" kb="CUR">10.32.64.3</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="Gateway" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">Gateway</ParameterName>

    <ParameterValue kxe="false" kb="CUR">10.32.64.1</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="SubnetMask" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">SubnetMask</ParameterName>

    <ParameterValue kxe="false" kb="CUR">255.255.255.0</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="ConnectionSpeed" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">ConnectionSpeed</ParameterName>

    <ParameterValue kxe="false" kb="CUR">auto</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="DuplexMode" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">DuplexMode</ParameterName>

    <ParameterValue kxe="false" kb="CUR">auto</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="OperationType" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">OperationType</ParameterName>

    <ParameterValue kxe="false" kb="CUR">netboot</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="timeout" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">timeout</ParameterName>

    <ParameterValue kxe="false" kb="CUR">3600000</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="SlotPhysicalLocationCode" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">SlotPhysicalLocationCode</ParameterName>

    <ParameterValue kxe="false" kb="CUR">U9040.MR9.132974X-V5-C32-T1</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="VLANPriority" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">VLANPriority</ParameterName>

    <ParameterValue kxe="false" kb="CUR">0</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="BOOTPRetries" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">BOOTPRetries</ParameterName>

    <ParameterValue kxe="false" kb="CUR">5</ParameterValue>

    </JobParameter>

    <JobParameter ns2:id="TFTPRetries" schemaVersion="V1_0">

    <Metadata>

    <Atom/>

    </Metadata>

    <ParameterName kb="ROR" kxe="false">TFTPRetries</ParameterName>

    <ParameterValue kxe="false" kb="CUR">5</ParameterValue>

    </JobParameter>

    </JobParameters>

    </JobRequest:JobRequest>

    Thank You 

    Rekha Bomkanti



    ------------------------------
    REKHA BOMKANTI
    ------------------------------



  • 3.  RE: Looking for help getting the "LogicalPartition PowerOn" REST API call working for netbooting an LPAR.

    Posted Tue September 10, 2024 07:01 AM

    Your reply was very helpful, thanks!

    I was not able to find the information about the X-HMC-Schema-Version header anywhere.

    I am able to submit the job, but I receive this error (correctly as i did not provide the LogicalPartitionProfileUUID job parameter).

    Can you help me understand what information I should provide here and how I find it?  I was assuming a default profile, but this is something else right?

    <Results kxe="false" kb="ROR" schemaVersion="V1_0">
            <Metadata>
                <Atom/>
            </Metadata>
            <JobParameter schemaVersion="V1_0">
                <Metadata>
                    <Atom/>
                </Metadata>
                <ParameterName kxe="false" kb="ROR">result</ParameterName>
                <ParameterValue kb="CUR" kxe="false">REST0197 The job parameter(s) [LogicalPartitionProfileUUID] are missing for 'OperationType' 'netboot' for partition type 'AIX/Linux'</ParameterValue>
            </JobParameter>
        </Results>

    Best regards,

    Mark



    ------------------------------
    Best regards,
    Mark Nellemann
    Advisory Power Technical Specialist
    IBM
    ------------------------------



  • 4.  RE: Looking for help getting the "LogicalPartition PowerOn" REST API call working for netbooting an LPAR.

    Posted Wed September 11, 2024 10:51 AM

    Hi Mark 

      Yes you have to pass the UUID of LogicalPartitionProfile in the JOB request payload 

    Sample ====

    <ParameterName kb="ROR" kxe="false">LogicalPartitionProfileUUID</ParameterName>

    <ParameterValue kxe="false" kb="CUR">1d32e7df-ec53-38a6-828e-e656d811543a</ParameterValue>

    And you will get the detail of profile (including LogicalPartitionProfileUUID ) of corresponding Logical Partition with below GET method API call 

         https://<hmc_ip>:443/rest/api/uom/LogicalPartition/<LogicalPartitionUUID>/LogicalPartitionProfile

    Sample output ==========

    <LogicalPartitionProfile:LogicalPartitionProfile
    xmlns:LogicalPartitionProfile="http://www.ibm.com/xmlns/systems/power/firmware/uom/mc/2012_10/"
    xmlns="http://www.ibm.com/xmlns/systems/power/firmware/uom/mc/2012_10/"
    xmlns:ns2="http://www.w3.org/XML/1998/namespace/k2" schemaVersion="V1_0">
    <Metadata>
    <Atom>
    <AtomID>8c82b486-ac27-3453-b27b-aa601c51e74a</AtomID> <============ LogicalPartitionProfileUUID
    <AtomCreated>1726065798142</AtomCreated>
    </Atom>
    </Metadata>
    <AffinityGroupID kb="CUD" kxe="false">0</AffinityGroupID>
    <AssignAllResources kb="COD" kxe="false">false</AssignAllResources>
    <AssociatedPartition kb="ROR" kxe="false" href="https://10.48.20.231:443/rest/api/uom/ManagedSystem/8d49aa5b-26da-3766-8f9e-fd56ba6f2c28/LogicalPartition/71E06D2F-7F1D-4ED4-889C-3CDA8080C691" rel="related"/>
    <AutoStart kxe="false" kb="CUD">false</AutoStart>
    <BootMode kxe="false" kb="CUD">Normal</BootMode>
    <ConnectionMonitoringEnabled kb="CUD" kxe="false">true</ConnectionMonitoringEnabled>
    <DesiredProcessorCompatibilityMode kb="CUD" kxe="false">default</DesiredProcessorCompatibilityMode>
    </LogicalPartitionProfile:LogicalPartitionProfile>

    Thanks

    REKHA BOMKANTI



    ------------------------------
    REKHA BOMKANTI
    ------------------------------



  • 5.  RE: Looking for help getting the "LogicalPartition PowerOn" REST API call working for netbooting an LPAR.

    Posted Thu September 12, 2024 03:31 AM

    Hi Rekha,

    Thank you.

    Is the AtomID  something I always need to retrieve/refresh or is it safe to persist/cache and reuse for future calls (for this specific LPAR) ?



    ------------------------------
    Best regards,
    Mark Nellemann
    Advisory Power Technical Specialist
    IBM
    ------------------------------



  • 6.  RE: Looking for help getting the "LogicalPartition PowerOn" REST API call working for netbooting an LPAR.

    Posted Thu September 19, 2024 03:02 AM

    Hi Mark

               You can persist/cache the UUID of the partition for future calls as this will be unique (for this specific LPAR).

    Thanks

    Rekha



    ------------------------------
    REKHA BOMKANTI
    ------------------------------