Resync vCloud VS

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

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

XML Request Example

1
curl -i -X POST -u 'user:userpass' --url http://onapp.test/virtual_machines/vm-0a81025d-877b-4b34-9c4c-7bbf8d436e1d/resync.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example

1
curl -i -X POST -u 'user:userpass' --url http://onapp.test/virtual_machines/vm-0a81025d-877b-4b34-9c4c-7bbf8d436e1d/resync.json -H 'Accept: application/json' -H 'Content-Type: application/json'

XML Output Example

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<virtual_machine>
  <id type="integer">26</id>
  <hypervisor_id type="integer">7</hypervisor_id>
  <template_id nil="true"/>
  <identifier>vm-0a81025d-877b-4b34-9c4c-7bbf8d436e1d</identifier>
  <hostname>msartemname</hostname>
  <memory type="integer">1024</memory>
  <cpus type="integer">1</cpus>
  <cpu_shares type="integer">1</cpu_shares>
  <created_at type="dateTime">2021-10-20T10:02:36+03:00</created_at>
  <updated_at type="dateTime">2021-10-21T10:30:31+03:00</updated_at>
  <built type="boolean">true</built>
  <locked type="boolean">false</locked>
  <booted type="boolean">true</booted>
  <xen_id nil="true"/>
  <remote_access_password nil="true"/>
  <local_remote_access_port nil="true"/>
  <label>msartem_resync_vm</label>
  <recovery_mode nil="true"/>
  <user_id type="integer">23</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">10</cpu_units>
  <cpu_sockets nil="true"/>
  <draas_keys type="array"/>
  <iso_id nil="true"/>
  <cores_per_socket type="integer">1</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 type="integer">32</vapp_id>
  <vmware_tools>10240</vmware_tools>
  <vcenter_moref>vm-4228</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 nil="true"/>
  <virsh_console type="boolean">false</virsh_console>
  <trim_disabled type="boolean">false</trim_disabled>
  <draas_shadow_ip_address_join_id nil="true"/>
  <infrastructure_mode type="boolean">false</infrastructure_mode>
  <vcenter_resource_pool_id nil="true"/>
  <ip_addresses type="array">
    <networking_ip_address>
      <id type="integer">348</id>
      <address>192.68.1.2</address>
      <broadcast nil="true"/>
      <network_address nil="true"/>
      <gateway>192.68.1.1</gateway>
      <created_at type="dateTime">2021-10-20T10:28:12+03:00</created_at>
      <updated_at type="dateTime">2021-10-20T10:28:12+03:00</updated_at>
      <user_id nil="true"/>
      <pxe type="boolean">false</pxe>
      <hypervisor_id nil="true"/>
      <ip_range_id nil="true"/>
      <external_address nil="true"/>
      <primary type="boolean">false</primary>
      <vcloud_edge_gateways_sub_allocated_ip_range_id nil="true"/>
      <free type="boolean">false</free>
      <netmask>255.255.255.224</netmask>
    </networking_ip_address>
    <networking_ip_address>
      <id type="integer">494</id>
      <address>192.68.1.3</address>
      <broadcast nil="true"/>
      <network_address nil="true"/>
      <gateway>192.68.1.1</gateway>
      <created_at type="dateTime">2021-10-20T15:09:31+03:00</created_at>
      <updated_at type="dateTime">2021-10-20T15:09:31+03:00</updated_at>
      <user_id nil="true"/>
      <pxe type="boolean">false</pxe>
      <hypervisor_id nil="true"/>
      <ip_range_id nil="true"/>
      <external_address nil="true"/>
      <primary type="boolean">false</primary>
      <vcloud_edge_gateways_sub_allocated_ip_range_id nil="true"/>
      <free type="boolean">false</free>
      <netmask>255.255.255.224</netmask>
    </networking_ip_address>
  </ip_addresses>
  <monthly_bandwidth_used type="decimal">0.0</monthly_bandwidth_used>
  <total_disk_size type="integer">3</total_disk_size>
  <support_incremental_backups type="boolean">true</support_incremental_backups>
  <cpu_priority type="integer">1</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>vcloud</hypervisor_type>
</virtual_machine>

As a result of this API call, the ReimportVCloudVirtualMachine transaction will be scheduled on Control Panel. After this transaction is completed, disks, NICs, CPU, and RAM of the current VS will be updated.