Article ID: 118308, created on Oct 30, 2013, last review on May 10, 2014

  • Applies to:
  • Virtual Automation

Question

What is the difference between container templates stored in PVA MN Recourse Library and configuration samples located on a hardware node, from perspective of XML API usage? How should a XML request to PVA MN be composed to properly create a VE from templates in both cases?

Answer

The value of the key base_sample_id is passed by PVA MN to the appropriate hardware node and it is interpreted by the hardware node as the ID of the locally stored template.

The following packet examples explain the difference.

  1. Using the node's configuration sample.

    1. To get the list of ID values of container templates from the hardware node, you need to send such request to PVA MN or to PVA Agent on the node omitting <dst><host>...</host></dst> tag:

      <packet>
      <target>vzasample_manager</target>
      <dst>
      <host>EID_OF_HWNODE</host>
      </dst>
      <data>
      <vzasample_manager>
      <get/>
      </vzasample_manager>
      </data>
      </packet>
      
    2. To create a VE using a hardware node's container template via XML request to PVA MN, you need to send such request to the PVA MN:

      <packet>
      <target>vzaenvm</target>
      <dst>
          <host>EID_OF_HWNODE</host>
      </dst>
      <data>
      <vzaenvm>
      <create>
      <config>
      <type>virtuozzo</type>
      <name>VE_NAME</name>
      <net_device>
      <host_routed/>
      <ip_address>
      <ip>IP_ADDRESS</ip>
      </ip_address>
      <id>venet0</id>
      </net_device>
          <base_sample_id>TEMPLATE_ID_FROM_STEP_1</base_sample_id>
      <hostname>HOSTNAME</hostname>
      <os_template>
      <name>OS_TEMPLATE</name>
      </os_template>
      </config>
      </create>
      </vzaenvm>
      </data>
      </packet> 
      

    Note: When VE creation is done using a template stored on a hardware node, it is not needed to specify all additional VE parameters designated in the container template.

  2. Using a template from Resource Library of PVA MN.

    1. To get the list of containers templates ID from the PVA MN Recourse Library, you need to send such request to PVA MN:

      <packet>
      <target>sample_manager</target>
      <data>
      <sample_manager>
      <get/>
      </sample_manager>
      </data>
      </packet>
      
    2. PVA Agent operates only with locally stored templates and therefore a template ID from PVA MN Resource Library cannot be used for setting properties of a container. In this case it is required to manually designate all VE parameters using the values defined in the template:

      <packet>
      <target>vzaenvm</target>
      <dst>
          <host>EID_OF_HWNODE</host>
      </dst>
      <data>
      <vzaenvm>
      <create>
      <config>
      <type>virtuozzo</type>
      <name>CT_NAME</name>
      <net_device>
          <host_routed/>
          <ip_address>
          <ip>IP_ADDRESS</ip>
          </ip_address>
          <id>venet0</id>
      </net_device>
      <hostname>HOSTNAME</hostname>
      <os_template>
          <name>OS_TEMPLATE</name>
      </os_template>
      <qos>
          <id>cpuunits</id>
          <hard>1000</hard>
      </qos>
      <qos>
          <id>diskspace</id>
          <hard>1153434</hard>
          <soft>1048576</soft>
      </qos>
      <qos>
          <id>tcprcvbuf</id>
          <hard>524288</hard>
          <soft>319488</soft>
      </qos>
      </config>
      </create>
      </vzaenvm>
      </data>
      </packet>
      

    Note: The parameters cpuunits, diskspace, tcprcvbuf were manually specified.

    And even if you will send base_sample_id tag with template ID of container template from PVA MN, this parameter will be just passed through to the hardware node by PVA MN and the result is not well defined; the value is interpreted as a locally stored sample ID and such template is used if exists. Otherwise the value of base_sample_id is ignored: the base_sample_id tag is accepted by a hardware node's PVA Agent.

    The correct way to use XML API with PVA MN is to set all required parameters using the values from the appropriate container template stored in PVA MN Recourse Library.

Search Words

PVA

XML API PVA

XML API

Resource Library Templates

319940068c5fa20655215d590b7be29b 2897d76d56d2010f4e3a28f864d69223

Email subscription for changes to this article
Save as PDF