Promoting a Virtual Machine's Disk
Promoting a virtual machine’s disk improves performance.
Important: You can use the PromoteDisks API only when connected to a vCenter Server system.
You can use PromoteDisks to copy disk backings or to consolidate disk backings.
- Copy – If the unlink parameter is true, any disk backing that is shared by multiple virtual machines is copied so that this virtual machine has its own unshared version. Files are copied into the home directory of the virtual machine. This setting results in improved read performance, but higher space requirements. The following call copies and shares disks, and then collapses all unnecessary disks.
myVm.PromoteDisks(True, [])
- Consolidate – If the unlink parameter is false, any disk backing that is not shared between multiple virtual machines and not associated with a snapshot is consolidated with its child backing. The net effect is improved read performance at the cost of inhibiting future sharing. The following call eliminates any unnecessary disks:
myVm.PromoteDisks(False, [])
Promoting a virtual machine’s disk might also be useful if you end up with disk backings that are not needed for snapshots or for sharing with other virtual machines.
Both uses of PromoteDisks take an optional second argument, which allows you to apply the method to only a subset of disks. For example, you can unshare and consolidate only the virtual disk with key 2001 as follows:
for any of my VMs in dev if (dev.key == 2001) disk2001 = dev myVm.PromoteDisks(True, [disk2001])