Determine the size of a VM disk file
Â
This page describes how to find out the size of your virtual disk files.
You can then add your virtual disk files to the self-service VM template catalogue of the multicloud platform
Â
Introduction to VM disk file sizes
When you launch a virtual machine, the hypervisor or public cloud region will deploy one or more VM disk files. To launch a VM, most hypervisors require the disk size.Â
The capacity of a VM disk file is the correct size of the disk when it is running on a hypervisor.Â
For fixed disk formats, the capacity is the same as the physical size of the disk image.
For sparse and compressed formats, such as stream-optimized, it is the provisioned size.
You can use the capacity to calculate how much disk space your VM templates will use when deployed.  When you upload an OVA file to the Abiquo self-service catalog, the mutli-cloud platform can get the capacity automatically, but if you use a manual upload method, you will need to get the capacity manually as described in this article.
The disk conversion feature of the multi-cloud platform also uses the capacity when it converts VM disks to other formats and exports VM disks to public cloud.Â
If the disk is in a fixed disk format, you may be able to get the disk size directly from your file system. For details of virtual disk formats, see Template compatibility table
To easily check the disk format and obtain the size that the disk will have when it is deployed, you can use qemu-img or VBoxManage as described here.
Â
Use qemu-img to get the size of a virtual disk
QEMU (from www.qemu.org) is available for Linux, Macintosh, and Windows.
You can use the qemu-img info
command to get the details of a disk.
For example, to get the details of a disk called yVM-disk1.vmdk
user@userpc:~/Downloads $ qemu-img info ./yVM-disk1.vmdk
In the output from the info command, the capacity is the virtual size.
user@userpc:~/Downloads $ qemu-img info ./yVM-disk1.vmdk
image: ./yVM-disk1.vmdk
file format: vmdk
virtual size: 64M (67108864 bytes)
disk size: 14M
Format specific information:
cid: 2107273510
parent cid: 4294967295
create type: streamOptimized
extents:
[0]:
compressed: true
virtual size: 67108864
filename: ./yVM-disk1.vmdk
cluster size: 65536
format:
Â
Use VBoxManage to get the size of a virtual disk
VirtualBox is available from https://www.virtualbox.org/wiki/Downloads.
You can use the VBoxManage showhdinfo command to obtain data about the disk image.Â
VBoxManage showhdinfo /root/VMs/CentOS-5-5-w-LAMP.vmdk
In the output from the showhdinfo
command, the capacity is the Logical Size.
Remember that not all image formats are supported using this method.
Â
Enter the capacity of the VM template in the multi-cloud platform
When you upload an OVA to the self-service catalog of the Abiquo cloud platform, it will automatically enter the capacity in the VM template and display it for your users.
But when you upload a single disk file via the UI, then you must manually enter the capacity, which is a value in bytes.
Remember that the capacity will depend on the type of disk:
For fixed disk formats, use the physical size of the disk image.
For sparse and compressed formats, use the provisioned size.
If you are have an OVF file to manually upload a template, it must have a correct ovf:capacity
attribute. For example, here is an extract of an OVF file.
If you are uploading a single disk manually, you must enter the capacity but if you don't know the correct size at that time, you can always enter a best-guess value. Then before you create a VM, edit the VM template and enter the correct value.
After you add the template, you can change the capacity when you edit the template.
Â
The administrator maintains a template catalogue to give users self-service access to VMs
Â
For more details, see Add virtual machine templates to Abiquo and Create a virtual machine
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved