To resync a vCenter virtual server into OnApp, use the following request:

POST /virtual_machines/:id/resync.xml
POST /virtual_machines/:id/resync.json


XML Request Example

curl -i -X POST -u 'user:userpass' --url https://onapp.test/virtual_machines/4/resync.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'
CODE

JSON Request Example

curl -i -X POST -u 'user:userpass' --url https://onapp.test/virtual_machines/4/resync.json -H 'Accept: application/json' -H 'Content-type: application/json'
CODE


XML Output Example

<virtual_machine>
  <id type="integer">2022</id>
  <hypervisor_id type="integer">156</hypervisor_id>
  <template_id nil="true"/>
  <identifier>bohpzakuuvzrwu</identifier>
  <hostname>mscentossnap</hostname>
  <memory type="integer">384</memory>
  <cpus type="integer">1</cpus>
  <cpu_shares type="integer">20</cpu_shares>
  <created_at type="dateTime">2019-09-03T11:41:52+03:00</created_at>
  <updated_at type="dateTime">2019-09-03T11:44:38+03:00</updated_at>
  <built type="boolean">true</built>
  <locked type="boolean">false</locked>
  <booted type="boolean">false</booted>
  <xen_id nil="true"/>
  <remote_access_password nil="true"/>
  <local_remote_access_port nil="true"/>
  <label>ms.centossnapfu</label>
  <recovery_mode nil="true"/>
  <user_id type="integer">376</user_id>
  <operating_system>linux</operating_system>
  <operating_system_distro>centos64Guest</operating_system_distro>
  <allowed_swap type="boolean">true</allowed_swap>
  <template_label nil="true"/>
  <min_disk_size nil="true"/>
  <allowed_hot_migrate nil="true"/>
  <note nil="true"/>
  <admin_note nil="true"/>
  <suspended type="boolean">false</suspended>
  <strict_virtual_machine_id nil="true"/>
  <enable_autoscale type="boolean">false</enable_autoscale>
  <add_to_marketplace nil="true"/>
  <state>delivered</state>
  <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted>
  <edge_server_type nil="true"/>
  <storage_server_type nil="true"/>
  <firewall_notrack type="boolean">false</firewall_notrack>
  <service_password nil="true"/>
  <preferred_hvs type="array"/>
  <local_remote_access_ip_address nil="true"/>
  <cpu_units type="integer">200</cpu_units>
  <cpu_sockets nil="true"/>
  <draas_keys type="array"/>
  <iso_id nil="true"/>
  <cores_per_socket type="integer">0</cores_per_socket>
  <instance_package_id nil="true"/>
  <hot_add_cpu type="boolean">false</hot_add_cpu>
  <hot_add_memory type="boolean">false</hot_add_memory>
  <time_zone nil="true"/>
  <autoscale_service nil="true"/>
  <cdboot type="boolean">false</cdboot>
  <draas_mode type="integer">0</draas_mode>
  <vapp_id nil="true"/>
  <vmware_tools nil="true"/>
  <vcenter_moref>vm-4532</vcenter_moref>
  <template_version nil="true"/>
  <openstack_id nil="true"/>
  <domain>localdomain</domain>
  <vcenter_reserved_memory type="integer">0</vcenter_reserved_memory>
  <deleted_at nil="true"/>
  <properties>
  </properties>
  <acceleration_allowed type="boolean">true</acceleration_allowed>
  <vcenter_cluster_id type="integer">6</vcenter_cluster_id>
  <virsh_console type="boolean">false</virsh_console>
  <ip_addresses type="array"/>
  <monthly_bandwidth_used type="decimal">0.0</monthly_bandwidth_used>
  <total_disk_size type="integer">3</total_disk_size>
  <support_incremental_backups type="boolean">false</support_incremental_backups>
  <cpu_priority type="integer">20</cpu_priority>
  <built_from_iso type="boolean">false</built_from_iso>
  <built_from_ova type="boolean">false</built_from_ova>
  <acceleration type="boolean">false</acceleration>
  <hypervisor_type>vcenter</hypervisor_type>
</virtual_machine>
CODE

Where:

id - id of the virtual server

hypervisor_id - id of the compute resource

template_id - id of the template 

identifier - the VS identifier in the DB

hostname - the VS's host name

memory - the amount of RAM allocated to this VS

cpus - the number of CPU cores assigned to the VS

cpu_shares - the CPU priority value

created_at - the date, when the VS was created  in the [YYYY][MM][DD]T[hh][mm][ss]Z format

updated_at - the date, when the VS was updated  in the [YYYY][MM][DD]T[hh][mm][ss]Z format

built - true if the virtual server is built, otherwise false

locked - true if the virtual server is locked, otherwise false

booted - true if the virtual server is booted, otherwise false

xen_id - this parameter is not applicable to vCenter VS

remote_access_password - the password for remote access

local_remote_access_port - the port ID used for used for console access

label - label of the VS

recovery_mode - true if recovery mode is allowed, otherwise false

user_id - the ID of a new owner in OnApp

operating_system - the OS on which the virtual server is based

operating_system_distro - the distribution of the OS

allowed_swap - true, if swap is allowed; otherwise, false

template_label - label of the template

allowed_hot_migrate - true, if hot migration for the VS is allowed; otherwise, false

note - optional text, added as a note

admin_note -  optional text note

suspended -  true, if the VS is suspended; otherwise, false

enable_autoscale - true, if autoscale is enabled for the VS; otherwise, false

add_to_marketplace - this parameter is not applicable to vCenter VS

initial_root_password_encrypted - true, if root password for the VS is encrypted on the vCenter side; otherwise, false

edge_server_type - this parameter is not applicable to vCenter VS

storage_server_type - this parameter is not applicable to vCenter VS

firewall_notrack - true if the NOTRACK rule is set in iptables

service_password - service account password

preferred_hvs - the array of preferable compute resources based on compute zone that meet some virtual server configuration settings

local_remote_access_ip_address - IP address used for remote access

cpu_units - the number of CPU units per core if the CPU priority is replaced with CPU units in the user bucket

cpu_sockets - the number of CPU sockets per core

cores_per_socket - the number of CPU cores per socket

instance_package_id - id of the instance package

hot_add_cpu -  true, if the CPU parameter can be changed without rebooting the VS; otherwise, false

hot_add_memory - true, if the memory parameter can be changed without rebooting the VS; otherwise, false

time_zone - the time zone of the user

autoscale_service -  this parameter is not applicable to vCenter VS

vapp_id -  this parameter is not applicable to vCenter VS

vcenter_moref - moref of the virtual server on vCenter

template_version - the version of the template

deleted_at - time when the VS was deleted in the [YYYY][MM][DD]T[hh][mm][ss]Z format

acceleration_allowed - true, if acceleration is allowed for the VS; otherwise, false

vcenter_cluster_id - ID of the vCenter cluster

virsh_console - true, if Virsh console is enabled for the VS, otherwise, false

ip_addresses - an array of IP addresses assigned to this virtual server

monthly_bandwidth_used - VS's monthly bandwidth

total_disk_size - the total disk size in GB of all disks assigned to the VS

support_incremental_backups - true, if incremental backups are supported; otherwise, false

cpu_priority - it has the same value as cpu_shares parameter

built_from_iso - true, if the VS was built from an ISO template; otherwise, false

built_from_ova - true, if the VS was built from an OVA template; otherwise, false

acceleration - true, if acceleration is allowed for the VS; otherwise, false

hypervisor_type - the type of the compute resource (vCenter)