Exported ova size smaller than the fixed size VM.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Alex80
Posts: 23
Joined: 28. Jan 2019, 15:26

Exported ova size smaller than the fixed size VM.

Post by Alex80 »

Hi all!

I have an 100 GB fixed size VM. When I export this VM to ova, and after I import back I see that the fixed size disk change to dynamically allocated disk.

How I export and import back VM so that the stored size stay fixed? I haven't found any solution yet.

Thank you very muck for the answers!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Exported ova size smaller than the fixed size VM.

Post by mpack »

The OVA standard mandates stream optimized VMDK.

Why on earth would you willingly use fixed sized disks anyway? Tell me you don't believe the disks work faster...

Also, why are you using export/import? If you just want to copy a VM you can simply copy the VM folder. Howto: Move a VM.
Alex80
Posts: 23
Joined: 28. Jan 2019, 15:26

Re: Exported ova size smaller than the fixed size VM.

Post by Alex80 »

This server is a represents a real server with real disks. So it must be the same, which is not dynamic. On the other hand, we haven't got any knowladge about the dynamic disks, so this is the simple reason why we use fixed size storage.

This is a serious 7/24 server, we can't stop it, so we can't move or clone. But we can use save state.
If the machines is in save state, we can export the machines in order to make a backup. The advantage is this method that when we would like to import back we don't need to register the VM.

Is there any export format which not reduce the size?

Or we should use linux cp command?
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Exported ova size smaller than the fixed size VM.

Post by Martin »

OVA is a transport format which compresses the disk data (mostly be leaving out empty sectors).
If you import this on another system you can define the virtual disks with fixed size again if you really want.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Exported ova size smaller than the fixed size VM.

Post by scottgus1 »

The reduced size comes from the OVA standard's requirement that the disk file be compressed.

Virtualbox defaults to using dynamic drives when it imports.

The only major side effect of using a dynamic drive is that you must remember how big it might get one day and be sure you have sufficient host PC disk space to absorb it as it grows. Since you already have the space necessary to handle the fixed disk size, you will have space to handle the dynamic restored disk.

Sorry for the firmness, but it has to be said: Your backup scheme needs a new scheme. A saved-state guest is tied directly to the physical CPU and other possible hardware that the guest was communicating with when it was save-stated, as well as the exact version of Virtualbox that the guest was running under. Your backups cannot be moved off this particular computer (what will happen if the host dies?) and you will have to keep track of the Virtualbox version and restore that version to get the guest running again, hopefully. (If you have multiple guests with saved-state backups under different versions of Virtualbox, and they all need to be restored, then how will you get them all running?)

Also, your 24/7 guest must be turned off to be save-stated, so it can't really be 24/7.

The best fully-restorable backup is a full file & folder copy of a completely shut-down (not save-stated) guest folder, containing all the files therein, as well as any disk files that may reside outside the folder. The backup can be FC file-compared, or hashes can be taken and compared for off-site backup where FC would not be practical. If the disk file(s) are inside the folder right next to the guest's .vbox file, then that backup can be restored to any capable Virtualbox host running any supported host OS. If a disk file is outside the guest folder, then the .vbox file contains an absolute path to the disk file, and that path must be re-created on the new host (or the .vbox file needs to be manually edited). Virtualbox 6.0 and later allow moving a disk file into the guest folder next to the .vbox file, using the main Virtualbox window's File menu, Virtual Media Manager, Move command.

If you must really have 24/7 running, get fully-compatible in-the-guest 3rd-party live backup software, and use a Virtualbox network to get the backup files out of the guest to the backup drives.

Exporting is not recommended for backing up a VM. The process might change some guest settings to conform to the OVA/OVF standard, as well as compress the disk file. Any change in the guest means there's no way to FC- or hash-confirm the backup. Export is intended for using a guest under another hypervisor besides Virtualbox.
Alex80
Posts: 23
Joined: 28. Jan 2019, 15:26

Re: Exported ova size smaller than the fixed size VM.

Post by Alex80 »

Hey guys, thanks for the advices, it was really helpful for me. I have only one question.
How can I use a copied VM in the same VirtualBox?
(Copied means that I make a full file & folder copy of a completely shut-down guest folder).
As I know I have to change the UUID of the vdi?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Exported ova size smaller than the fixed size VM.

Post by mpack »

Alex80 wrote:How can I use a copied VM in the same VirtualBox?
You can't. If you want to use the copied VM on the same PC then you have clone the VM, not simply copy the folder. Just right click the VM and choose "Clone". Read the manual too.
Post Reply