Start/Stop vApp VSs

To schedule actions for starting/stopping virtual servers when the vApp is being started/stopped, use the following request:

1
2
PUT /vapps/:vapp_id/startup_items.xml
PUT /vapps/:vapp_id/startup_items.json

XML Request Example

1
curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' http://onapp.test/vapps/12/startup_items.xml -d '<vapp><startup_items_attributes><item_1><vm_name>virtual_server_name1</vm_name><order>1</order><start_action>powerOn</start_action><start_delay>5</start_delay><stop_action>powerOff</stop_action><stop_delay>5</stop_delay><id>267</id></item_1><item_2><vm_name>virtual_server_name2</vm_name><order>2</order><start_action>powerOn</start_action><start_delay>5</start_delay><stop_action>powerOff</stop_action><stop_delay>5</stop_delay><id>266</id></item_2></startup_items_attributes></vapp>'

JSON Request Example

1
curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' http://onapp.test/vapps/12/startup_items.json -d '{"vapp": {"startup_items_attributes": {"item_1":{"vm_name": "virtual_server_name1", "order": "1", "start_action": "powerOn", "start_delay": "5", "stop_action": "powerOff", "stop_delay": "5", "id": "267", "item_2":{"vm_name": "virtual_server_name2", "order": "1", "start_action": "powerOn", "start_delay": "5", "stop_action": "powerOff", "stop_delay": "5", "id": "266"}}}}}'

Where:

  • startup_items_attributes - the array of items for starting/stopping a virtual server
  • item_x - the array of attributes for starting/stopping a virtual server where x should be a unique number for each item within the request
  • vm_name - the label of the virtual server that belongs to the vApp
  • order - the number that indicates the order in which to start and stop the virtual server
    Virtual servers with lower numbers are started first and stopped last. You cannot specify negative numbers. Virtual servers with the same numbers are started and stopped at the same time.
  • start_action - the powerOn action to apply to the virtual server when the vApp is started. To apply no start action, skip this parameter.
  • start_delay - the delay in seconds after starting one virtual server and before starting the next virtual server
  • stop_action - the action to apply to the virtual server when the vApp is stopped. The available actions include:
    • powerOff - to power off the VS forcefully
    • guestShutdown - to shut down the VS gracefully
  • stop_delay - the delay in seconds to wait after stopping one virtual server and before stopping the next virtual server
  • id - the ID of the startup item that is available via the Get List of vApp VSs Start/Stop Order request