Add VS

Da Wiki Neen.
(Differenze fra le revisioni)
Riga 85: Riga 85:
  
 
<source lang="xml">  
 
<source lang="xml">  
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<virtual_machine>
 +
<add_to_marketplace nil="true"/>
 +
<admin_note nil="true"/>
 +
<allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>
 +
<allowed_hot_migrate type="boolean">true</allowed_hot_migrate>
 +
<allowed_swap type="boolean">true</allowed_swap>
 +
<booted type="boolean">false</booted>
 +
<built type="boolean">false</built>
 +
<cpu_shares type="integer">1</cpu_shares>
 +
<cpus type="integer">1</cpus>
 +
<created_at type="datetime">2013-06-11T16:03:58+03:00</created_at>
 +
<customer_network_id nil="true"/>
 +
<deleted_at nil="true"/>
 +
<edge_server_type nil="true"/>
 +
<enable_autoscale type="boolean">false</enable_autoscale>
 +
<enable_monitis type="boolean">false</enable_monitis>
 +
<firewall_notrack type="boolean">false</firewall_notrack>
 +
<hostname>zaza</hostname>
 +
<hypervisor_id type="integer">1</hypervisor_id>
 +
<id type="integer">15</id>
 +
<identifier>l2lnf62bs44bjf</identifier>
 +
<initial_root_password>ehgebhewvtwh</initial_root_password>
 +
<initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted>
 +
<label>zaza</label>
 +
<local_remote_access_ip_address>109.123.91.35</local_remote_access_ip_address>
 +
<local_remote_access_port nil="true"/>
 +
<locked type="boolean">true</locked>
 +
<memory type="integer">128</memory>
 +
<min_disk_size type="integer">5</min_disk_size>
 +
<note nil="true"/>
 +
<operating_system>linux</operating_system>
 +
<operating_system_distro>ubuntu</operating_system_distro>
 +
<preferred_hvs type="array"/>
 +
<recovery_mode nil="true"/>
 +
<remote_access_password>x9yk3fIMXZBG</remote_access_password>
 +
<service_password nil="true"/>
 +
<state>new</state>
 +
<storage_server_type nil="true"/>
 +
<strict_virtual_machine_id nil="true"/>
 +
<suspended type="boolean">false</suspended>
 +
<template_id type="integer">8</template_id>
 +
<template_label>Ubuntu 13.04 x64</template_label>
 +
<updated_at type="datetime">2013-06-11T16:03:59+03:00</updated_at>
 +
<user_id type="integer">1</user_id>
 +
<vip nil="true"/>
 +
<xen_id nil="true"/>
 +
<ip_addresses type="array">
 +
<ip_address>
 +
<address>109.123.91.171</address>
 +
<broadcast>109.123.91.191</broadcast>
 +
<created_at type="datetime">2013-06-11T14:16:21+03:00</created_at>
 +
<customer_network_id nil="true"/>
 +
<disallowed_primary type="boolean">false</disallowed_primary>
 +
<gateway>109.123.91.129</gateway>
 +
<hypervisor_id nil="true"/>
 +
<id type="integer">386</id>
 +
<ip_address_pool_id nil="true"/>
 +
<network_address>109.123.91.128</network_address>
 +
<network_id type="integer">9</network_id>
 +
<pxe type="boolean">false</pxe>
 +
<updated_at type="datetime">2013-06-11T14:16:21+03:00</updated_at>
 +
<user_id nil="true"/>
 +
<free type="boolean">false</free>
 +
<netmask>255.255.255.192</netmask>
 +
</ip_address>
 +
</ip_addresses>
 +
<monthly_bandwidth_used>0</monthly_bandwidth_used>
 +
<total_disk_size type="integer">6</total_disk_size>
 +
</virtual_machine>
 +
</source>
 +
 
  &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;virtual_machine&gt;  
 
  &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;virtual_machine&gt;  
 
  &lt;add_to_marketplace nil="true"/&gt;
 
  &lt;add_to_marketplace nil="true"/&gt;
Riga 154: Riga 226:
 
  &lt;total_disk_size type="integer"&gt;6&lt;/total_disk_size&gt;
 
  &lt;total_disk_size type="integer"&gt;6&lt;/total_disk_size&gt;
 
  &lt;/virtual_machine&gt;  
 
  &lt;/virtual_machine&gt;  
</source>
+
 
  
 
Where:  
 
Where:  

Versione delle 16:52, 20 feb 2014


POST /virtual_machines.xml POST /virtual_machines.json

XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<virtual_machine><template_id>8</template_id><licensing_key></licensing_key><label>zaza</label><hostname>zaza</hostname><hypervisor_group_id>14</hypervisor_group_id><hypervisor_id>1</hypervisor_id><initial_root_password>ehgebhewvtwh</initial_root_password><memory>128</memory><cpus>1</cpus><cpu_shares>1</cpu_shares><data_store_group_primary_id>18</data_store_group_primary_id><primary_disk_size>5</primary_disk_size><primary_disk_min_iops>100</primary_disk_min_iops><data_store_group_swap_id>18</data_store_group_swap_id><swap_disk_size>1</swap_disk_size><swap_disk_min_iops>100</swap_disk_min_iops><primary_network_group_id>19</primary_network_group_id><selected_ip_address_id>386</selected_ip_address_id><rate_limit>1</rate_limit><required_ip_address_assignment>1</required_ip_address_assignment><required_automatic_backup>0</required_automatic_backup><required_virtual_machine_build>1</required_virtual_machine_build><required_virtual_machine_startup>1</required_virtual_machine_startup><type_of_format>ext4</type_of_format><enable_autoscale>0</enable_autoscale><custom_recipe_variables><custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled><recipe_ids type='array'><recipe_id>11</recipe_id></recipe_ids></custom_recipe_variable></custom_recipe_variables></virtual_machine>' --url http://<span style="background-color: navy; color: white;" /><span style="background-color: navy; color: white;" />cloud.neen.it/virtual_machines.xml



JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"template_id":"8", "licensing_key":"", "label":"zaza", "hostname":"zaza", "hypervisor_group_id":"14", "hypervisor_id":"1", "initial_root_password":"tyrhsghj657th", "memory":"128", "cpus":"1", "cpu_shares":"1", "data_store_group_primary_id":"18", "primary_disk_size":"5", "primary_disk_min_iops":"100", "data_store_group_swap_id":"18", "swap_disk_size":"1", "swap_disk_min_iops":"100", "primary_network_group_id":"19", "selected_ip_address_id":"386", "rate_limit":"1", "required_ip_address_assignment":"1", "required_automatic_backup":"0", "required_virtual_machine_build":"1", "required_virtual_machine_startup":"1", "type_of_format":"ext4", "enable_autoscale":"0","recipe_ids":["11"],"custom_recipe_variables":{"custom_recipe_variable":{"name":"varname","value":"var_value","enabled":"1"}}}}' --url http://<span style="background-color: navy; color: white;" /><span style="background-color: navy; color: white;" />cloud.neen.it/virtual_machines.json


The following parameters should be sent:

memory* - amount of RAM assigned to the VS

cpus* - number of CPUs assigned to the VS

cpu_shares* - required parameter. For KVM hypervisor the CPU priority value is always 100. For XEN, set a custom value. The default value for XEN is 1

hostname* - set the host name for this VS

label* - user-friendly VS description

primary_disk_size* - set the disk space for this VS

swap_disk_size* - set swap space. There is no swap disk for Windows-based VSs

primary_disk_min_iops - minimum number of IO operations per second for primary disk (this is a SolidFire related parameter)

swap_disk_min_iops - minimum number of IO operations per second for swap disk (this is a SolidFire related parameter)

type_of_format - type of filesystem - ext4. For Linux templates, you can choose ext4 file system instead of the ext3 default one

data_store_group_primary_id - set the ID of the data store zone to which this primary disk is allocated

data_store_group_swap_id - set the ID of the data store zone to which this swap disk is allocated

primary_network_id - the ID of the primary network. Optional parameter that can be used only if it is assigned to the network zone

primary_network_group_id - the ID of the primary network group. Optional parameter

required_automatic_backup - set 1 if you need automatic backups

rate_limit - set max port speed. Optional parameter: if none set, the system sets port speed to unlimited

required_virtual_machine_build * - set 1 to build VS automatically

required_virtual_machine_startup - set 1 to start up the VS automatically, otherwise set 0 (default state is "1")

required_ip_address_assignment* - set "1" if you want IP address to be assigned automatically after creation, otherwise set "0"

selected_ip_address_id - specify ID of an IP address to assign to this VS

admin_note - enter a brief comment for the VS. Optional parameter

note - a brief comment a user can add to a VS

template_id * - the ID of a template from which a VS should be built

licensing_server_id - the ID of a licensing server/template group – this parameter is for Windows XP/7 virtual machines only

licensing_type - the type of a license: MAK, KMS or user own license. This parameter is for Windows XP/7 virtual machines only

licensing_key - the key of a license. This parameter is for Windows XP/7 virtual machines only

hypervisor_group_id - the ID of the hypervisor zone in which the VS will be created. Optional: if no hypervisor zone is set, the VS will be built in any available hypervisor zone

hypervisor_id - the ID of a hypervisor where the VS will be built. Optional: if no hypervisor ID is specified, the VS will be built on the hypervisor with the least available RAM (but sufficient RAM for the VS)

initial_root_password - the root password for a VS. Optional, if none specified, the system will provide a random password. It can consist of 6-32 characters, letters [A-Za-z], digits [0-9], dash [ - ] and lower dash [ _ ]. You can use both lowercase and uppercase letters

initial_root_password_encryption_key - specify the password encryption passphrase

(lightbulb)recipe_ids - an array of recipe ID you want to run on the virtual server provisioning

(lightbulb) custom_variables - an array of custom variables with the following details:

   enabled - true, if the variable is enabled, otherwise false
id - variable ID
name - variable name
value - variable value script

XML Output example

 
 <?xml version="1.0" encoding="UTF-8"?> 
 <virtual_machine> 
 <add_to_marketplace nil="true"/>
 <admin_note nil="true"/>
 <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>
 <allowed_hot_migrate type="boolean">true</allowed_hot_migrate>
 <allowed_swap type="boolean">true</allowed_swap>
 <booted type="boolean">false</booted>
 <built type="boolean">false</built>
 <cpu_shares type="integer">1</cpu_shares>
 <cpus type="integer">1</cpus>
 <created_at type="datetime">2013-06-11T16:03:58+03:00</created_at>
 <customer_network_id nil="true"/>
 <deleted_at nil="true"/>
 <edge_server_type nil="true"/>
 <enable_autoscale type="boolean">false</enable_autoscale>
 <enable_monitis type="boolean">false</enable_monitis>
 <firewall_notrack type="boolean">false</firewall_notrack>
 <hostname>zaza</hostname>
 <hypervisor_id type="integer">1</hypervisor_id>
 <id type="integer">15</id>
 <identifier>l2lnf62bs44bjf</identifier>
 <initial_root_password>ehgebhewvtwh</initial_root_password> 
 <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted>
 <label>zaza</label>
 <local_remote_access_ip_address>109.123.91.35</local_remote_access_ip_address> 
 <local_remote_access_port nil="true"/>
 <locked type="boolean">true</locked>
 <memory type="integer">128</memory>
 <min_disk_size type="integer">5</min_disk_size>
 <note nil="true"/>
 <operating_system>linux</operating_system>
 <operating_system_distro>ubuntu</operating_system_distro> 
 <preferred_hvs type="array"/>
 <recovery_mode nil="true"/>
 <remote_access_password>x9yk3fIMXZBG</remote_access_password> 
 <service_password nil="true"/>
 <state>new</state>
 <storage_server_type nil="true"/>
 <strict_virtual_machine_id nil="true"/>
 <suspended type="boolean">false</suspended>
 <template_id type="integer">8</template_id>
 <template_label>Ubuntu 13.04 x64</template_label>
 <updated_at type="datetime">2013-06-11T16:03:59+03:00</updated_at>
 <user_id type="integer">1</user_id>
 <vip nil="true"/>
 <xen_id nil="true"/>
 <ip_addresses type="array">
 <ip_address>
 <address>109.123.91.171</address>
 <broadcast>109.123.91.191</broadcast>
 <created_at type="datetime">2013-06-11T14:16:21+03:00</created_at>
 <customer_network_id nil="true"/>
 <disallowed_primary type="boolean">false</disallowed_primary>
 <gateway>109.123.91.129</gateway>
 <hypervisor_id nil="true"/>
 <id type="integer">386</id>
 <ip_address_pool_id nil="true"/>
 <network_address>109.123.91.128</network_address>
 <network_id type="integer">9</network_id>
 <pxe type="boolean">false</pxe>
 <updated_at type="datetime">2013-06-11T14:16:21+03:00</updated_at>
 <user_id nil="true"/>
 <free type="boolean">false</free>
 <netmask>255.255.255.192</netmask>
 </ip_address>
 </ip_addresses>
 <monthly_bandwidth_used>0</monthly_bandwidth_used>
 <total_disk_size type="integer">6</total_disk_size>
 </virtual_machine>
<?xml version="1.0" encoding="UTF-8"?> <virtual_machine> 
<add_to_marketplace nil="true"/>
<admin_note nil="true"/>
<allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>
<allowed_hot_migrate type="boolean">true</allowed_hot_migrate>
<allowed_swap type="boolean">true</allowed_swap>
<booted type="boolean">false</booted>
<built type="boolean">false</built>
<cpu_shares type="integer">1</cpu_shares>
<cpus type="integer">1</cpus>
<created_at type="datetime">2013-06-11T16:03:58+03:00</created_at>
<customer_network_id nil="true"/>
<deleted_at nil="true"/>
<edge_server_type nil="true"/>
<enable_autoscale type="boolean">false</enable_autoscale>
<enable_monitis type="boolean">false</enable_monitis>
<firewall_notrack type="boolean">false</firewall_notrack>
<hostname>zaza</hostname>
<hypervisor_id type="integer">1</hypervisor_id>
<id type="integer">15</id>
<identifier>l2lnf62bs44bjf</identifier>
<initial_root_password>ehgebhewvtwh</initial_root_password> 
<initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted>
<label>zaza</label>
<local_remote_access_ip_address>109.123.91.35</local_remote_access_ip_address> 
<local_remote_access_port nil="true"/>
<locked type="boolean">true</locked>
<memory type="integer">128</memory>
<min_disk_size type="integer">5</min_disk_size>
<note nil="true"/>
<operating_system>linux</operating_system>
<operating_system_distro>ubuntu</operating_system_distro> 
<preferred_hvs type="array"/>
<recovery_mode nil="true"/>
<remote_access_password>x9yk3fIMXZBG</remote_access_password> 
<service_password nil="true"/>
<state>new</state>
<storage_server_type nil="true"/>
<strict_virtual_machine_id nil="true"/>
<suspended type="boolean">false</suspended>
<template_id type="integer">8</template_id>
<template_label>Ubuntu 13.04 x64</template_label>
<updated_at type="datetime">2013-06-11T16:03:59+03:00</updated_at>
<user_id type="integer">1</user_id>
<vip nil="true"/>
<xen_id nil="true"/>
<ip_addresses type="array">
<ip_address>
<address>109.123.91.171</address>
<broadcast>109.123.91.191</broadcast>
<created_at type="datetime">2013-06-11T14:16:21+03:00</created_at>
<customer_network_id nil="true"/>
<disallowed_primary type="boolean">false</disallowed_primary>
<gateway>109.123.91.129</gateway>
<hypervisor_id nil="true"/>
<id type="integer">386</id>
<ip_address_pool_id nil="true"/>
<network_address>109.123.91.128</network_address>
<network_id type="integer">9</network_id>
<pxe type="boolean">false</pxe>
<updated_at type="datetime">2013-06-11T14:16:21+03:00</updated_at>
<user_id nil="true"/>
<free type="boolean">false</free>
<netmask>255.255.255.192</netmask>
</ip_address>
</ip_addresses>
<monthly_bandwidth_used>0</monthly_bandwidth_used>
<total_disk_size type="integer">6</total_disk_size>
</virtual_machine> 


Where:

Strumenti personali
Namespace
Varianti
Azioni
Navigazione
Strumenti