Edit Disk

To edit a disk, use the following request:

PUT /settings/disks/:id.xml
PUT /settings/disks/:id.json

XML Request Example

curl -i -X PUT http://onapp.test/settings/disks/546.xml -d '<disk><label>for BU</label><disk_size>6</disk_size><require_format_disk>1</require_format_disk><mounted>true</mounted><mount_point>/mnt/disk1</mount_point><file_system>ntfs</file_system><virtio_enabled>0</virtio_enabled><override_minimum_disk_size>true</override_minimum_disk_size></disk>' -u user_email:api_key -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example

curl -i -X PUT http://onapp.test/settings/disks/2.json -d '{"disk":{"label":"for BU", "disk_size":"1", "require_format_disk":"1", "mounted":"true", "mount_point":"/mnt/disk1", "file_system":"ext4", "virtio_enabled":"1", "override_minimum_disk_size": "true"}}' -u user_email:api_key -H 'Accept: application/json' -H 'Content-type: application/json'

Where:

label - the disk label

disk_size - the disk space in GB

require_format_disk - set 1 to format disk; otherwise, set 0

mounted - set true to mount the disk inside OS automatically; otherwise, set false

mount_point - a physical location in the partition used as a root file system

file_system - for Linux templates, you can choose ext4 file system instead of the ext3 default one

virtio_enabled - set 1 to enable virtio mode; otherwise, set 0

(lightbulb)override_minimum_disk_size - true if you want to decrease disk size to the value less than minimum disk size; otherwise, false

To set the file system parameter, you must set the require_format_disk option.

You can also edit a disk through another URL: onapp.test/virtual_machines/:virtual_machines_id/disks/:id
  • You cannot decrease the size of the Integrated Storage data store disks.
  • You cannot resize a disk that uses GUID Partition Table (GPT).
  • You cannot decrease the disk size for Windows-based and FreeBSD-based virtual servers. Only the increase disk size option is available.
  • You can't resize the primary disk for FreeBSD-based virtual servers.
  • Decreasing disk size for Linux-based virtual servers may lead to filesystem inconsistencies. Make sure you have current backups before proceeding.


Page History

v. 6.6 Edge 3

  • Added the virtio_enabled parameter

v. 6.7 Edge 1

  • Added the override_minimum_disk_size parameter