Add Static Compute Resource

To create static compute resource, use the following request:

POST /settings/hypervisors.xml
POST /settings/hypervisors.json

XML Request Example

curl -X POST http://onapp.test/settings/hypervisors.xml -d '<hypervisor><label>static</label><hypervisor_type>kvm</hypervisor_type><segregation_os_type>any_os</segregation_os_type><ip_address>191.168.1.148</ip_address><backup_ip_address>192.168.123.1</backup_ip_address><cpu_units>1000</cpu_units><enabled>1</enabled><collect_stats>1</collect_stats><disable_failover>1</disable_failover><failover_recipe_id>get_if_config</failover_recipe_id><amqp_exchange_name></amqp_exchange_name><static_integrated_storage>1</static_integrated_storage><mtu>1500</mtu><storage_bonding_mode>802.3ad</storage_bonding_mode><storage_controller_memory_size>1024</storage_controller_memory_size><storage_controller_db_size>128</storage_controller_db_size> <disks_per_storage_controller>4</disks_per_storage_controller><storage_vlan>2</storage_vlan><power_cycle_command># 123</power_cycle_command></hypervisor>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example

curl -X POST http://onapp.cloud/settings/hypervisors.json -d'{"hypervisor":{"label":"static", "hypervisor_type":"kvm", "segregation_os_type":"any_os", "ip_address":"191.168.1.148", "backup_ip_address":"192.168.123.1", "cpu_units":"1000", "enabled":"1", "collect_stats":"1", "disable_failover":"1", "failover_recipe_id":"",  "amqp_exchange_name":"", "static_integrated_storage":"1", "mtu":"1500", "storage_bonding_mode":"802.3ad", "storage_controller_memory_size":"1024", "storage_controller_db_size":"128", "disks_per_storage_controller":"4", "storage_vlan":"2", "power_cycle_command":"# 123"}}' -u admin:'password' -H 'Accept: application/json' -H 'Content-type: application/json'

Where:

hypervisor - an array of compute resource details:

  • label * - the name of the compute resource
  • hypervisor_type - compute resource type. For static compute resources, only KVM type can be used.
  • segregation_os_type - an operating system type (can be Any OS, Windows only or Non-Windows)
  • ip_address - the compute resource IP address
  • backup_ip_address - provisioning network IP address
  • cpu_units - set the amount of CPU units for this compute resource
  • enabled - set 1 to enable this compute resource, otherwise set 0
  • collect_stats - set 1 to collect statistics for this compute resource, otherwise set 0
  • disable_failover - optional parameter. Set true to disable compute resource failover, otherwise false

  • failover_recipe_id - the ID of a recipe to run before the failover process

  • static_integrated_storage - set "1" to enable static integrated storage

  • mtu - maximum transferrable unit value. You can set the frame size from 1500 to 9000 bytes.

  • storage_bonding_mode - the type of bonding of the storage networks 

  • storage_controller_memory_size - specify the storage controller memory size (minimum 640 MB)
  • storage_controller_db_size - specify the storage controller database size

  • disks_per_storage_controller - specify the number of disks per controller virtual server. You can set form 1 to 4 disks. By default, the controller virtual server is created per 4 disk drives
  • storage_vlan - the number of a VLAN this storage network belongs to
  • power_cycle_command - arbitrary command string to be executed by IPMI from the CP server.