GNS3 / gns3-gui

GNS3 Graphical Network Simulator
http://www.gns3.com
GNU General Public License v3.0
2.15k stars 435 forks source link

Large virtual disks #2572

Open gdsotirov opened 6 years ago

gdsotirov commented 6 years ago

Why are the virtual disks in the GNS3 image for VMware ESXi so large? The first one is 19.5 GB and the second is 97.7 GB. If I use thin provision the space required (for new deployment) is just 1.4 GB for the whole VM. And for existing VMs I see about 4 GB used. The problem is that if I have to copy or move the VM then over 117 GB in total have to be transferred, which is waste of time and resources. The virtual disks could always be increased if necessary, but shrinking them is not that trivial. Could you reconsider the size of the virtual disks in the OVF image?

grossmj commented 6 years ago

What size would be enough? Also, we have implemented an option to shrink the VM disk size, I think that will solve your issue.

shrink_gns3vm

gdsotirov commented 6 years ago

The first disk (mounted as /) that is 20 GB could be as small as 2 GB, because only about 1.1 GB seem to be used and on upgrades the used space raises with just about 200-300 MB (easily reclaimed with apt-get clean). The second one (mounted as /opt) that is 200 GB uses only about 500 MB (!) and I'm not even sure why it's necessary. It could thus be as small as 1 GB. I'm aware of "Shrink the VM disk" option in the menu, but I do not see any effect of it. I have to manually convert the thick provisioning disks coming out of the OVF to thin provisioned with vmkfstools CLI command (e.g. vmkfstools -i orig.vmdk -d thin thin.vmdk).

grossmj commented 6 years ago

@ehlers do you have any recommendations regarding this? thanks!

gdsotirov commented 6 years ago

@ehlers I though I did, but anyway here below my recommendations summarized:

Both are better be thin provision. As I wrote before it's easier to enlarge the disks (if necessary) than to shrink them. And allocating 200 GB disk when just 500 MB are used on the partition is just too much waste of space unless perhaps you're in a data center with almost unlimited storage space and/or do not care at all :-)

grossmj commented 6 years ago

The second one (mounted as /opt) that is 200 GB uses only about 500 MB (!) and I'm not even sure why it's necessary. It could thus be as small as 1 GB.

GNS3 projects are stored in /opt and these can quickly take a lot of space.

Both are better be thin provision.

I will check out thin provision, I wasn't aware of it before you mentioned it. Does this apply to VMware ESXi only?

gdsotirov commented 6 years ago

GNS3 projects are stored in /opt and these can quickly take a lot of space.

OK, but how much is "lot of space"? Even so, I believe there OVF could have a lot more reasonable disk sizes and again it's easier to enlarge the disk if necessary than to shrink it.

Does this applies only to VMware ESXi?

I'm not sure, but I think thin provisioned disks are possible with KVM and qemu.

grossmj commented 6 years ago

I'm not sure, but I think thin provisioned disks are possible with KVM and qemu.

I couldn't find any information about this. I've looked into doing it for the ESXi OVA we have however we don't build it on an ESXi server (we convert from the Workstation version OVA) and ESXi is required to run vmkfstools. Is there another way to convert disk images to thin provisioning?

gdsotirov commented 6 years ago

I couldn't find any information about this.

I wrote that I'm not sure, because I'm not experienced with KVM, but according to KVM's FAQ various disk formats are supported (see What virtual disk formats can KVM use?), including VMware and VMware disks for sure support thin provisioning.

Is there another way to convert disk images to thin provisioning?

As far as I'm aware it's only possible by migrating the virtual disk (see VMware KB2014832), which I'm pretty sure is similar to what vmkfstools does, because thinning cannot be done without copying the disk.

The only other why I know is to create the disk as thin provisioned.

cristian-ciobanu commented 6 years ago

@gdsotirov the disks for GNS3 VM are thin provisioned so after deployment it should take little space around 1.4 GB like you mentioned. I assume you use thick provisioning when deploying the VM on ESXi so that's why it preallocated the whole space of 117GB for both disks. People who use images in a multivendor environment (Cisco, Juniper, F5, PaloAlto etc) can require a lot of space inside the VM because some images are large (for example my image folder is over 100GB although I'm not using the GNS3 VM). For people which are not experienced with VMware using a small disk will be an issue when trying to perform expand operations on the disk size because after enlarging the size of the disk from VM settings it will also require to extend the filesystem inside the VM which requires Linux knowlegde. I think this is an issue more about disk provisioning rather than resizing the disk space.

@grossmj By looking at the OVF specification of the GNS3 VM disks I see the vmdk type is VIXDISKLIB_DISK_STREAM_OPTIMIZED according to http://pubs.vmware.com/vsphere-5-5/index.jsp?topic=%2Fcom.vmware.vddk.pg.doc%2FvddkDataStruct.5.3.html which is a monolithic sparse format compressed for streaming Also I saw there the VIXDISKLIB_DISK_VMFS_THIN format. Not sure which is the difference between these two. I deployed the GNS3 VM ESXi ova file in VMware Workstation and it's using only 1.4 GB of space. I do not have an ESXi install to test.

gdsotirov commented 6 years ago

I assume you use thick provisioning when deploying the VM on ESXi so that's why it preallocated the whole space of 117GB for both disks.

I'm not quite sure what you mean by this @cioby23. The default in ESXi is Think provisioning, but I create all my virtual machines with Thin provisioning. For GNS3 with the OVF I do not have this option...

People who use images in a multivendor environment (Cisco, Juniper, F5, PaloAlto etc) can require a lot of space inside the VM because some images are large (for example my image folder is over 100GB although I'm not using the GNS3 VM).

Yes, sure, but we're not all running in the data centers ;-)

For people which are not experienced with VMware using a small disk will be an issue when trying to perform expand operations on the disk size because after enlarging the size of the disk from VM settings it will also require to extend the filesystem inside the VM which requires Linux knowlegde.

Yes, but what I asked is not "small disk", but a more reasonable size. For me even 2-4 GB disks would be OK, but let them be 16 or 32 GB Thin provisioned. Although, this would still require more disk space or network traffic if would be much more faster. People could share their opinions about the most reasonable sizes for a default installation, because if one needs something more specific I believe he'll have the knowledge to do it. I constantly resize disks and extend file systems and I do not consider it a burden when justified.

I think this is an issue more about disk provisioning rather than resizing the disk space.

Not exactly. A thin provisioned disk takes small disk space only when in VMware file system. If copied on another partition or over the network it's inflated, so it actually becomes thick.

saviodsouza commented 4 years ago

Can I put in a suggestion that may work?

How about setting up lvm for /opt? Leave the original GNS3-VM small in size but set it up with lvm so additional virtual disks of any size can be added to increase storage requirements for each use case.

grossmj commented 2 years ago

Using LVM is something we should do when we migrate the GNS3 VM to Ubuntu 22.04 LTS