Public Member Functions | |
void | createDynamicImage (in unsigned long long size,[retval] out IProgress progress) |
Starts creating a dymically expanding hard disk image in the background. | |
void | createFixedImage (in unsigned long long size,[retval] out IProgress progress) |
Starts creating a fixed-size hard disk image in the background. | |
void | deleteImage () |
Deletes the existing hard disk image. | |
Public Attributes | |
attribute wstring | filePath |
Full file name of the VHD image of this hard disk. | |
readonly attribute boolean | created |
Whether the virual disk image is created or not. |
Hard disks using VHD images can be either opened using IVirtualBox::openHardDisk() or created from scratch using IVirtualBox::createHardDisk().
Objects that support this interface also support the IHardDisk interface.
When a new hard disk object is created from scatch, an image file for it is not automatically created. To do it, you need to specify a valid file path, and call createFixedImage() or createDynamicImage(). When it is done, the hard disk object can be registered by calling IVirtualBox::registerHardDisk() and then attached to virtual machines.
The description of the VHD hard disk is stored in the VirtualBox configuration file, so it can be changed (at appropriate times) even when accessible returns false
. However, the hard disk must not be attached to a running virtual machine.
{163B88C3-7552-424A-8205-DAF17A004747}
void IVHDImage::createDynamicImage | ( | in unsigned long long | size, | |
[retval] out IProgress | progress | |||
) |
Starts creating a dymically expanding hard disk image in the background.
The previous image associated with this object, if any, must be deleted using deleteImage, otherwise the operation will fail.
size | Maximum logical size of the hard disk in megabytes. | |
progress | Progress object to track the operation completion. |
void IVHDImage::createFixedImage | ( | in unsigned long long | size, | |
[retval] out IProgress | progress | |||
) |
Starts creating a fixed-size hard disk image in the background.
The previous image, if any, must be deleted using deleteImage, otherwise the operation will fail.
size | Logical size of the hard disk in megabytes. | |
progress | Progress object to track the operation completion. |
void IVHDImage::deleteImage | ( | ) |
Deletes the existing hard disk image.
The hard disk must not be registered within this VirtualBox installation, otherwise the operation will fail.
This operation is valid only for non-differencing hard disks, after they are unregistered using IVirtualBox::unregisterHardDisk().
attribute wstring IVHDImage::filePath |
Full file name of the VHD image of this hard disk.
For newly created hard disk objects, this value is null
.
When assigning a new path, it can be absolute (full path) or relative to the VirtualBox home directory. If only a file name without any path is given, the default VDI folder will be used as a path to the image file.
When reading this propery, a full path is always returned.
true
. In this case, the specified file name can be absolute (full path) or relative to the VirtualBox home directory. If only a file name without any path is given, the default VDI folder will be used as a path to the image file. readonly attribute boolean IVHDImage::created |
Whether the virual disk image is created or not.
For newly created hard disk objects or after a successful invocation of deleteImage(), this value is false
until createFixedImage() or createDynamicImage() is called.