14.8. Actions
14.8.1. Install VDSM Action
Install VDSM and related software on the host. The host type defines additional parameters for the 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>
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>
14.8.2. Activate Host Action
Activate the host for use, such as running virtual machines.
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/>
14.8.3. Host Network Setup Action
Configure multiple network settings on a host. The
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>
This action updates all specified host network resources with standard NIC elements. The request includes additional elements specified in the following table.
Table 14.14. Elements for multiple host network interface setup
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
An API user controls a host's power management device with the
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>
14.8.5. Deactivate Host Action
Deactivate the host to perform maintenance tasks.
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/>
14.8.6. Approve Host Action
Approve a pre-installed Red Hat Enterprise Virtualization Hypervisor host for usage in the virtualization environment. This action also accepts an optional
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>
14.8.7. Host iSCSI Login Action
The
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>
14.8.8. Host iSCSI Discover Action
The
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>
14.8.9. Commit Host Network Configuration Action
An API user commits the network configuration to persist a host network interface attachment or detachment, or persist the creation and deletion of a bonded interface.
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/>
Important
Networking configuration is only committed after the Manager has established that host connectivity is not lost as a result of the configuration changes. If host connectivity is lost, the host requires a reboot and automatically reverts to the previous networking configuration.
14.8.10. Setting SPM
Manually set a host as the Storage Pool Manager (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/>