14.8. Actions
14.8.1. Install VDSM Action
- Red Hat Enterprise Linux host - This host type requires a
root_password
element that refers to the password for the host'sroot
user. - Red Hat Enterprise Virtualization Hypervisor host - This host type requires an
image
element that refers to an ISO file stored on the Red Hat Enterprise Virtualization Manager server.
Example 14.28. Action to install VDSM to a Red Hat Enterprise Linux host
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/install HTTP/1.1 Accept: application/xml Content-type: application/xml <action> <root_password>p@55w0Rd!</root_password> </action>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/install HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action>
<root_password>p@55w0Rd!</root_password>
</action>
Example 14.29. Action to install VDSM to a Red Hat Enterprise Virtualization Hypervisor host
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/install HTTP/1.1 Accept: application/xml Content-type: application/xml <action> <image>/usr/share/rhev-hypervisor/rhev-hypervisor.iso</image> </action>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/install HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action>
<image>/usr/share/rhev-hypervisor/rhev-hypervisor.iso</image>
</action>
14.8.2. Activate Host Action
Example 14.30. Action to activate a host
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/activate HTTP/1.1 Accept: application/xml Content-type: application/xml <action/>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/activate HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>
14.8.3. Host Network Setup Action
setupnetworks
action can be used for complex network configuration such as moving a network from one network interface to another.
Example 14.31. Action to edit host network configuration
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/setupnetworks HTTP/1.1 Accept: application/xml Content-type: application/xml <action> <modified_network_attachments> <network_attachment id="41561e1c-c653-4b45-b9c9-126630e8e3b9"> <host_nic id="857a46d3-5f64-68bd-f456-c70de5b2d569"/> </network_attachment< <network_attachment id="3c3f442f-948b-4cdc-9a48-89bb0593cfbd"> <network id="00000000-0000-0000-0000-000000000010"/> <ip address="10.35.1.247" netmask="255.255.254.0" gateway="10.35.1.254"/> <properties> <property> <name>bridge_opts</name> <value> forward_delay=1500 group_fwd_mask=0x0 multicast_snooping=1 </value> </property> </properties> </network_attachment> </modified_network_attachments> <synchronized_network_attachments> <network_attachment id="3c3f442f-948b-4cdc-9a48-89bb0593cfbd"> </synchronized_network_attachments> <removed_network_attachments> <network_attachment id="7f456dae-c57f-35d5-55a4-20b74dc53af9"> </removed_network_attachments> <modified_bonds> <host_nic id="a56b212d-2bc4-4120-9136-53be6cacb39a"> <bonding> <slaves> <host_nic id="75ac21f7-4aa3-405a-a022-341e5f525b85"> <host_nic id="f3dda04c-1233-41af-a111-74327b876487"> </slaves> </bonding> </host_nic> </modified_bonds> <removed_bonds> <host_nic id="36ab5c7f-647a-bc64-f5e7-ba5d74f8e4ba"> </removed_bonds> <modified_labels> <label id="Label002"> <host_nic id="857a46d3-5f64-68bd-f456-c70de5b2d569"/> </label> <label> <host_nic id="a56b212d-2bc4-4120-9136-53be6cacb39a"/> <label id="Label003/> </label> </modified_labels> <removed_labels> <label id="Label001"> </removed_labels> <checkConnectivity>true</checkConnectivity> <connectivityTimeout>60</connectivityTimeout> </action>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/setupnetworks HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action>
<modified_network_attachments>
<network_attachment id="41561e1c-c653-4b45-b9c9-126630e8e3b9">
<host_nic id="857a46d3-5f64-68bd-f456-c70de5b2d569"/>
</network_attachment<
<network_attachment id="3c3f442f-948b-4cdc-9a48-89bb0593cfbd">
<network id="00000000-0000-0000-0000-000000000010"/>
<ip address="10.35.1.247" netmask="255.255.254.0" gateway="10.35.1.254"/>
<properties>
<property>
<name>bridge_opts</name>
<value>
forward_delay=1500 group_fwd_mask=0x0 multicast_snooping=1
</value>
</property>
</properties>
</network_attachment>
</modified_network_attachments>
<synchronized_network_attachments>
<network_attachment id="3c3f442f-948b-4cdc-9a48-89bb0593cfbd">
</synchronized_network_attachments>
<removed_network_attachments>
<network_attachment id="7f456dae-c57f-35d5-55a4-20b74dc53af9">
</removed_network_attachments>
<modified_bonds>
<host_nic id="a56b212d-2bc4-4120-9136-53be6cacb39a">
<bonding>
<slaves>
<host_nic id="75ac21f7-4aa3-405a-a022-341e5f525b85">
<host_nic id="f3dda04c-1233-41af-a111-74327b876487">
</slaves>
</bonding>
</host_nic>
</modified_bonds>
<removed_bonds>
<host_nic id="36ab5c7f-647a-bc64-f5e7-ba5d74f8e4ba">
</removed_bonds>
<modified_labels>
<label id="Label002">
<host_nic id="857a46d3-5f64-68bd-f456-c70de5b2d569"/>
</label>
<label>
<host_nic id="a56b212d-2bc4-4120-9136-53be6cacb39a"/>
<label id="Label003/>
</label>
</modified_labels>
<removed_labels>
<label id="Label001">
</removed_labels>
<checkConnectivity>true</checkConnectivity>
<connectivityTimeout>60</connectivityTimeout>
</action>
Element | Type | Description |
---|---|---|
modified_bonds | complex | Creates or updates bonds. Each host_nic element contains standard bonding elements. See Section 14.7.2.2, “Bonded Interfaces”. |
removed_bonds | complex | An ID list of bonds to remove. |
modified_network_attachments | complex | Adds or updates network attachments on the host. Each network_attachment element contains standard host network_attachment elements. See Section 14.7.1, “Host Network Attachments Sub-Collection”. Changing the host_nic ID moves the network to a different network interface card. |
synchronized_network_attachments | complex | An ID list of out-of-sync network attachments to synchronize with the logical network definition of the data center. |
removed_network_attachments | complex | An ID list of network attachments to remove. |
modified_labels | complex | Creates or modifies labels. Each label element contains a label id (when creating a label) and a host_nic identified by a name or ID. Changing the host_nic ID moves the label to a different network interface card. |
removed_labels | complex | An ID list of labels to remove. |
checkConnectivity | Boolean | Set to true to verify connectivity between the host and the Red Hat Enterprise Virtualization Manager. If the connectivity is lost, Red Hat Enterprise Virtualization Manager reverts the settings. |
connectivityTimeout | integer | Defines the timeout for loss of connectivity. |
14.8.4. Fence Host Action
fence
action. The capabilities
lists available fence_type
options.
Example 14.32. Action to fence a host
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/fence Accept: application/xml Content-Type: application/xml <action> <fence_type>start</fence_type> </action>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/fence
Accept: application/xml
Content-Type: application/xml
<action>
<fence_type>start</fence_type>
</action>
14.8.5. Deactivate Host Action
Example 14.33. Action to deactivate a host
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/deactivate HTTP/1.1 Accept: application/xml Content-type: application/xml <action/>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/deactivate HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>
14.8.6. Approve Host Action
cluster
element to define the target cluster for this host.
Example 14.34. Action to approve a host
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/approve HTTP/1.1 Accept: application/xml Content-type: application/xml <action> <cluster id="99408929-82cf-4dc7-a532-9d998063fa95"/> </action>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/approve HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action>
<cluster id="99408929-82cf-4dc7-a532-9d998063fa95"/>
</action>
14.8.7. Host iSCSI Login Action
iscsilogin
action enables a host to login to an iSCSI target. Logging into a target makes the contained LUNs available in the host_storage
collection.
Example 14.35. Action to enable a host to login to iSCSI target
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/iscsilogin HTTP/1.1 Accept: application/xml Content-Type: application/xml <action> <iscsi> <address>mysan.example.com</address> <target>iqn.2009-08.com.example:mysan.foobar</target> <username>jimmy</username> <password>s3kr37</password> </iscsi> </action>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/iscsilogin HTTP/1.1
Accept: application/xml
Content-Type: application/xml
<action>
<iscsi>
<address>mysan.example.com</address>
<target>iqn.2009-08.com.example:mysan.foobar</target>
<username>jimmy</username>
<password>s3kr37</password>
</iscsi>
</action>
14.8.8. Host iSCSI Discover Action
iscsidiscover
action enables an iSCSI portal to be queried for its list of targets.
Example 14.36. Action to query a list of targets for iSCSI portal
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/iscsidiscover HTTP/1.1 Accept: application/xml Content-Type: application/xml <action> <iscsi> <address>mysan.example.com</address> <port>3260</port> </iscsi> </action>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/iscsidiscover HTTP/1.1
Accept: application/xml
Content-Type: application/xml
<action>
<iscsi>
<address>mysan.example.com</address>
<port>3260</port>
</iscsi>
</action>
14.8.9. Commit Host Network Configuration Action
Example 14.37. Action to commit network configuration
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/commitnetconfig HTTP/1.1 Accept: application/xml Content-type: application/xml <action/>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/commitnetconfig HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>
Important
14.8.10. Setting SPM
Example 14.38. Action to Set Host as SPM
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/forceselectspm HTTP/1.1 Accept: application/xml Content-type: application/xml <action/>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/forceselectspm HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>