To migrate a vCenter virtual server disk, use the following request:

POST /virtual_machines/:virtual_machine_id/disks/:disk_id/migration.xml
POST /virtual_machines/:virtual_machine_id/disks/:disk_id/migration.json


XML Request Example

curl -i -X POST -u user_email:api_key --url http://onapp.test/virtual_machines/44/disks/45/migration.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<disk_migration><data_store_id>177</data_store_id><type>hot</type></disk_migration>'
CODE


JSON Request Example

curl -i -X POST -u user_email:api_key --url http://onapp.test/virtual_machines/44/disks/45/migration.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"disk_migration": {"data_store_id": 177, "type": "hot"}}'
CODE


XML Output Example

<disk>
      <virtual_machine_id>44</virtual_machine_id>
      <locked>true</locked>
      <id>45</id>
      <data_store_id>60</data_store_id>
      <disk_size>1</disk_size>
      <identifier>899bf19d-9ef6-4a42-a387-79f1c8b6d39b</identifier>
      <created_at>2022-05-24T17:13:36.020+03:00</created_at>
      <updated_at>2022-05-30T11:56:04.111+03:00</updated_at>
      <is_swap>false</is_swap>
      <built>true</built>
      <primary>false</primary>
      <disk_vm_number>2</disk_vm_number>
      <mount_point>/mnt/onapp-disk-123</mount_point>
      <label>Hard disk 2</label>
      <file_system>ext3</file_system>
      <volume_id>null</volume_id>
      <max_bw>1000</max_bw>
      <burst_bw>1000</burst_bw>
      <iqn>null</iqn>
      <integrated_storage_cache_override>false</integrated_storage_cache_override>
      <integrated_storage_cache_enabled>false</integrated_storage_cache_enabled>
      <integrated_storage_cache_settings></integrated_storage_cache_settings>
      <mounted>true</mounted>
      <io_limits></io_limits>
      <io_limits_override>false</io_limits_override>
      <openstack_id>null</openstack_id>
      <temporary_virtual_machine_id>null</temporary_virtual_machine_id>
      <draas_metadata>false</draas_metadata>
      <virtio_enabled>true</virtio_enabled>
      <override_minimum_disk_size>false</override_minimum_disk_size>
      <has_autobackups>false</has_autobackups>
      <add_to_linux_fstab>true</add_to_linux_fstab>
      <add_to_freebsd_fstab>null</add_to_freebsd_fstab>
    </disk>
CODE


Where:

disk_migration - the migration of the disk

data_store_id - the ID of the data store to which the disk is migrated

type - the type of disk migration


disk - the disk which is migrated

virtual_machine_id - the ID of the virtual server using the disk

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

id - the ID of the disk

data_store_id - the ID of the data store on which the disk is located

disk_size - the size of the disk in GB

identifier - the identifier of the disk

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

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

is_swap - true if it is a swap disk; otherwise, false 

built - true if the disk is built; otherwise, false

primary - true if the disk is primary; otherwise, false

disk_vm_number - the number of virtual servers using this disk

mount_point - disk mount point

label - the label of the disk

file_system - the disk filesystem

volume_id - the data store ID

max_bw - maximum bandwidth allowed, MBps

burst_bw - maximum bandwidth allowed, MBps

iqn - the volume ISCSI qualified name

integrated_storage_cache_override - true if the integrated storage cache is overridden by the settings listed in the integrated_storage_cache_settings parameter; otherwise, false

integrated_storage_cache_enabled - true if the integrated storage cache is enabled; otherwise, false

integrated_storage_cache_settings - integrated storage cache settings applied to the disk

mounted - true if the disk is mounted inside the OS automatically; otherwise, false

io_limits - the IO limits applied to the disk

io_limits_override - true if the limits are overridden by the settings listed in the io_limits parameter; otherwise, false

openstack_id - the OpenStack ID

temporary_virtual_machine_id - the ID of the temporary virtual server to which the disk is assigned

draas_metadata - true if the DRaaS metadata applies to the disk; otherwise, false

virtio_enabled - true if virtio mode is enabled; otherwise, false

override_minimum_disk_size - true if the disk size is decreased to the value less than the minimum disk size; otherwise, false

has_autobackups - true if the disk has automatic backups set up; otherwise, false

add_to_linux_fstab - true if the disk is added to your Linux fstab file; otherwise, false

add_to_freebsd_fstab - true if this disk is added to your FreeBSD fstab file; otherwise, false