ServerMania logo

Assign Recipe to Compute Zone

To assign a recipe to a compute zone, use the following request:

POST /settings/hypervisor_zones/:hypervisor_zone_id/recipe_joins.xml
POST /settings/hypervisor_zones/:hypervisor_zone_id/recipe_joins.json

XML Request Example

curl -i -X POST -H "Accept: application/xml" -H "Content-type:application/xml" -d '<recipe_join><recipe_id>6</recipe_id><event_type>vm_provisioning</event_type><template_id>h76rawyvwphxk6</template_id></recipe_join>' -u user:userpass http://test/settings/hypervisor_zones/9/recipe_joins.xml

JSON Request Example

curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6", "event_type":"vm_provisioning"}, "template_id":"h76rawyvwphxk6"}' -u user:userpass http://test//settings/hypervisor_zones/9/recipe_joins.json

Where:

recipe_id - ID of a recipe you want to assign

event_type - type of the event you want to assign the recipe to:

  • hv_goes_online - run the recipe when the compute resource comes online

  • hv_goes_offline - run the recipe when the compute resource goes offline

    NOTE: The recipe will be triggered when the statistics is not received from a compute resource for a certain period of time for some reason. If the compute resource is offline, the recipe will not run.

  • vm_provisioning - run the recipe during VS provisioning

  • vm_network_rebuild - run the recipe when rebuilding a network
  • vm_disk_add - run the recipe when adding a disk
  • (lightbulb)ip_allocated_to_vm_nic - run the recipe when adding an IP address to the VS network interface
  • (lightbulb)ip_revoked_from_vm_nic - run the recipe when removing an IP address from the VS network interface

  • vm_nic_add - run the recipe when adding a network interface
  • (lightbulb) vm_nic_remove - run the recipe while deleting a network interface 
  • vm_disk_resize - run the recipe when resizing a VSs disk
  • vm_resize - run the recipe when resizing a VS
  • (lightbulb) vm_ip_address_add - run the recipe when adding an IP address to a VS
  • (lightbulb) vm_ip_address_remove - run the recipe when removing an IP address from a VS
  • (lightbulb) vm_start - run the recipe while starting the virtual server
  • (lightbulb) vm_reboot - run the recipe while rebooting the virtual server
  • (lightbulb) vm_hot_migrate - run the recipe during the hot migration of the virtual server
  • (lightbulb) vm_hot_full_migrate - run the recipe during the hot migration of the virtual server with disk
  • (lightbulb) vm_failover - run the recipe during the failover process

hypervisor_zone_id - ID of a compute zone you want to assign the recipe to


Page History 

v. 6.1 

  • added the following parameters: 
    • ip_allocated_to_vm_nic
    • ip_revoked_from_vm_nic
    • vm_nic_remove
    • vm_ip_address_add
    • vm_ip_address_remove
    • vm_start 
    • vm_reboot 
    • vm_hot_migrate
    • vm_hot_full_migrate 
    • vm_failover