VMware Cloud Community
grob115
Enthusiast
Enthusiast

Clone VM to Template before resizing host partition

Hi, I'm in a bit of a trouble here. Just created a VM with everything I need installed and realized the 10GB VHDK I allocated ended up only have about 6-7GB on the host, which is running CentOS with the default partition (it uses EXT3 and LVM I think).

So I powerd off the VM and went ahead to set the disk size to 15GB but when I powered it back up again, the host still sees the original disk size. Went online and search around, I think I need to run quite a few commands (don't understand them) or boot from the install CD and see if the partition manager built in the installer can recognize and auto resize it?

Before I do this, I want to take a copy of the VM "just in case". I am trying to follow the directions in the manual on P170 at . However, I don't see the options "Convert to Template", or "Clone to Template" when I right click.

I am at Home->Inventory, and right click on the VM on the left side pane. I also read somewhere that I should see these options under the Summary->Commands? However, I only see "Power On" and "Edit Settings". Am I missing some kind of rights? I'm logged in as "root".

Attached is what I'm seeing on the vSphere Client.!file:///C:/Users/Titus/AppData/Local/Temp/moz-screenshot-1.png!

0 Kudos
6 Replies
DSTAVERT
Immortal
Immortal

You don't have the Clone or Template options. Those require vCenter server. You have expanded the raw disk space but you still need to expand the usable disk space within the OS. Use the LVM tools within Centos to add the additional space. http://www.centos.org/modules/newbb/viewtopic.php?topic_id=15531

It is probably easier it use the VMware Standalone converter from the download page. You can customize the size of the cloned disk space.

-- David -- VMware Communities Moderator
0 Kudos
grob115
Enthusiast
Enthusiast

Hello,

Thanks for the info. I'll check that out. Guess you're referring to this:

http://downloads.vmware.com/d/info/datacenter_downloads/vmware_vcenter_converter_standalone/4_0#prod...

In order to use the vCenter Server I need another box to run it, and the only other box I have is an Intel based Atom Linux based device. Guess I'm out of luck, and the only way is to manually create the VM and install everything? How's taking a snapshot different than cloning? Can I take a snapshot, and then provision new VMs based on snapshots?

I think if I go with vCenter Server I also need to pay for license and the cheapest is like $490-$500 for a year? Do you know if I can still continue to use it after 1 year, just that I don't get support? Or the software will cease to function?

0 Kudos
DSTAVERT
Immortal
Immortal

The link you have posted is correct.

vCenter gives you a consolidated view of your ESX(i) hosts and Virtual Machines. If you have a single ESXi host and a handful of Virtual machines it probably doesn't make much sense to get the Essentials Bundle. If you have more than one host or anticipate adding more the Essential Bundle can be worthwhile. The software continues to function after the year.

You must understand snapshots. They are far too easy to cause you problems. Taking a snapshot just freezes the base disk. All new changes to the original base disk are written to a delta file vmdk. Please read through Understanding Snapshots

-- David -- VMware Communities Moderator
0 Kudos
grob115
Enthusiast
Enthusiast

Thanks it's only for one host so yeah not worthwhile. Yes I understand the snapshot's delta file part. But if all I need is the complete state when I take the snapshot, without carying what goes on afterwards (ie the stuff that gets written into the delta file), then isn't a "clone to template" essentially the same as a "snapshot"? Put it in another way, I guess we can say a "clone to template" is a "snapshot" without capturing the delta that occurs after the "snapshot"?

Just kind of browse through some of the stuff I Googled about this. It seems like a lot of people have to go through quite a bit of commands in order to get this to work. And I'm not sure if I read it correctly. Is it true that I can only add another partition into the logical group, rather than extending the size of the current partition inside the logical group?

Actually, there is this File-Export OVF Template option available. However, it only allows me to save to my local PC rather than on the server's datastore. The doc (don't remember which one) says it compresses the essential info. Is this basically a clone to template? How is it different than the clone to template on the server's datastore? If my provisioned space is 15GB, does that mean the whole OVF would still be somewhere near that size even if it's smaller?

0 Kudos
DSTAVERT
Immortal
Immortal

Thanks it's only for one host so yeah not worthwhile. Yes I understand the snapshot's delta file part. But if all I need is the complete state when I take the snapshot, without carying what goes on afterwards (ie the stuff that gets written into the delta file), then isn't a "clone to template" essentially the same as a "snapshot"? Put it in another way, I guess we can say a "clone to template" is a "snapshot" without capturing the delta that occurs after the "snapshot"?

You can't make a copy of a VMDK for a running VM since the file is in use. No different than in any other OS. When you take a snapshot the base VMDK file is released and can therefore be copied or cloned. Once you delete the snapshot with the snapshot manager the delta files are committed to the base VMDK.

Just kind of browse through some of the stuff I Googled about this. It seems like a lot of people have to go through quite a bit of commands in order to get this to work. And I'm not sure if I read it correctly. Is it true that I can only add another partition into the logical group, rather than extending the size of the current partition inside the logical group?

With LVM that is correct. The reason for LVM is that you can expand the file system across partitions or even across multiple disks. If you just use the disk directly (/dev/sda1 etc.) you expand the file system differently.

Actually, there is this File-Export OVF Template option available. However, it only allows me to save to my local PC rather than on the server's datastore. The doc (don't remember which one) says it compresses the essential info. Is this basically a clone to template? How is it different than the clone to template on the server's datastore? If my provisioned space is 15GB, does that mean the whole OVF would still be somewhere near that size even if it's smaller?

The export OVF is certainly a way to create a "template" for reuse. It can be smaller than the original VMDK size but it depends on how much disk space had bee accessed from within the OS. You are best to create a fresh VM and make all your upgrades and installs and use it to create your template from that. A well used VM will have deleted file space that can affect the OVF file sizes.

Use the Converter tool. It can take care of expanding or shrinking the disk and the OS view of storage. You won't need to do any expansion within the OS.

-- David -- VMware Communities Moderator
0 Kudos
grob115
Enthusiast
Enthusiast

Hello,

Thanks. Just read the manual for the Converter on P51 at http://www.vmware.com/pdf/converter_standalone_guide401.pdf

Looks like the resize option is only for non-Linux based VMs?

"In the source volumes list, you can select which volumes to copy to the destination virtual machine

and control their size on the destination datastore.

Volume-based cloning depends on the operating system of the host machine. It is not supported for Linux

hosts. "

I'll create a new VM, assign a much larger disk space this time, and clone to OVF to see.

0 Kudos