By default, all
hard disks defined in the
VirtualHardwareSection
of a
Vm element
use the storage profile specified for the
Vm. You
can override this default for any of these disks when you instantiate a vApp
template, compose or recompose a vApp, or reconfigure a virtual machine.

Every
Vm
element includes a
StorageProfile element.
The storage profile referenced in this element normally provides storage for
all the hard disk
Items
in the virtual machine's
VirtualHardwareSection.
You can override this default by updating the virtual machine's
VirtualHardwareSection
to add
storageProfileOverrideVmDefault
and
storageProfileHref
attributes to the
Item
that defines the hard disk. You can update a
VirtualHardwareSection
when you are instantiating a vApp template, composing or recomposing a vApp, or
reconfiguring a virtual machine.

Important

You
cannot override the default storage profile for any hard disk of a virtual
machine that is deployed in a VDC where fast provisioning is enabled.

Prerequisites

Verify that
you are logged in to the vCloud API endpoint as an End User.

Procedure

1

Retrieve the hard disk
configuration from the virtual machine.

Make a GET request to
the virtual machine's
virtualHardwareSection/disks
link.

GET https://vcloud.example.com/api/vApp/vm-4/virtualHardwareSection/disks

In the
VirtualHardwareSection
of the retrieved
Vm,
modify the
rasd:HostResource
element of the
Item
that defines the disk for which you want to override the default storage
profile.

Request bodies must contain
all required elements and attributes, even if you are not changing their
values. Because optional elements and attributes typically revert to default
values if they are omitted or empty, it is a best practice to include optional
elements in request bodies that modify existing objects.
Link
elements and
href
attributes from responses do not need to be included in modified sections. Some
elements and attributes are read-only and cannot be modified. See the schema
reference for details.

a

In the
VirtualHardwareSection
of the
Vm, find the
Item that represents
the hard disk for which you want to override the default storage profile.

b

Add a
storageProfileHref to
the
rasd:HostResource
element of the
Item and set its value
to the
href of the storage
profile you want to use for this disk. The storage profile you specify must be
available in the VDC where this virtual machine is deployed.

c

Add a
storageProfileOverrideVmDefault
attribute to the
rasd:HostResource
element of the
Item. The value of this
attribute controls whether changes to the virtual machine's
StorageProfile affect
the storage profile that this disk uses.