ricky73
Hot Shot
Hot Shot

template with snapshot

Can I create snapshots into template ? So I can get multiple states of the same vm which will deploy to my infrastructure.

What says VMware about it?

11 Replies
Finikiez
Champion
Champion

Actually, template is not a VM where you can take a snapshot.

You can keep a single VM with multiple snapshots and then deploy new VMs using Clone operation.

0 Kudos
Gotzu
Enthusiast
Enthusiast

If you have a vCenter in your infrastructure then do following:

Right click on your virtual machine and select clone to template. This will take a while. time depends on how big is disk of that VM

There after you can right click that template and select deploy VM from template as many time you want and as many number of you want.

Hope that will help.

Cheers!
Rajeev
0 Kudos
ricky73
Hot Shot
Hot Shot

I created multiple snapshot on VM and afterwards I converted to template, I cannot see snapshot.

If I convert it again to vm I can see again the snapshots.

0 Kudos
Gotzu
Enthusiast
Enthusiast

As explained by Finikiez  above that templates are not VMs, you can't do anything to templates until you convert it to VM or deploy VM from template.

Converting template to VM mean in itself that template will disappear and converted to VM

Deploy VM from Template means: Template remains template and you get a copy of it as VM.

Please let me know if this helps!

Cheers!
Rajeev
0 Kudos
Finikiez
Champion
Champion

Just don't convert VM to a template. And clone it to new VMs from a spapshot which you want.

0 Kudos
ricky73
Hot Shot
Hot Shot

I have to revert to snapshot! But my machine is online and I cannot revert to.

0 Kudos
Finikiez
Champion
Champion

Sorry, I lost the thread.

So you have a VM with multiple snapshots and states. Let's call it parent VM.

And what do you want to do further? Do you need all created snapshots? Do you want to deploy multiple VMs from different snapshots of a parent VM?

0 Kudos
ricky73
Hot Shot
Hot Shot

yes, I want to deploy multiple VMs from different snapshots of a parent VM

0 Kudos
Finikiez
Champion
Champion

In this case you have to options:

1. Create multiple templates.

2. Keep multiple snapshots and switch between them.

I don't know the goal and idea what you deploy from that VM. However I think, that create multiple templates is better.

0 Kudos
kjdfhaueiase
Contributor
Contributor

I made the same mistake of trying to keep snapshots on the same machine with the goal of creating other virtual machines.

Goals:

-Maintain one OS system

-Multiple software configurations are snapshots

-Simply clone from snapshots when I quickly need a variation

-Save as template to keep myself (or someone else!) from accidentally changing the template and ruining it.

Our idea doesn't work because of several reasons:

-VMware decided to make templates single focused (quickly create another exact vm for quick scaling and automation)

-Thus, templates should not contain snapshots. They slow down operations like this.

-In fact, snapshots do slow things down. Infrastructure is geared toward speed.

-You and I are probably both doing some kind of testing functions whether it be for roll out, software testing, etc.

Here's what you can do:

-Take the VM you worked so hard on and do the following one snapshot at a time:

1) Restore to snapshot

2) If snapshot is running state, I recommend then you shutdown (no need copying memory if you don't need to)

3) Clone now to a new machine. That machine should be labeled to reflect state of the snapshot you have.

4) When cloning, I recommend using the opportunity to switch to "Thin provision" when chosing storage location. This varies by version of vSphere. Pick shared datastore if it will run on different hosts

5) Convert the cloned VM to a template. Save it in a folder named by template function with other similar templates

That's it!

If you like the original base image, shut down the original machine and delete all the snapshots. Make it into a template related to the base image.

One person mentioned that you can just save it as a VM and clone from the snapshots. On vSphere you need to do that with the APIs and there are some powershell scripts that can help you do that. It is NOT supported in the vSphere UI. Workstation and Fusion let you do this, but I find that if I migrate the VM down to fusion or workstation (yes you can do that by logging into vcenter from those products!), the snapshots go "bye bye.

If you decide to leave the virtual machine around with snapshots (not a template) for the purpose of cloning, I would rename it to something like "If you touch this VM I will first snapshot you a thousand times, and then vmotion you to Antarctica". This would potentially ward off (or incite) co-workers to modify it.

Honestly, the snapshot concept not good for this. If you need to update the base image with windows updates or other software updates, you will have to recreate all of the snapshot states anyway. I haven't come up with a way to make those things propagate.

Linked Clones are a cool concept (theoretically you could update the base and the linked virtual machines would all get the benefit) but in practice, this only works with Horizon View Composer/Virtual Desktops. It's probably not what you're looking for. We just need to bite the bullet and run windows update on every template we make once a month at least.

0 Kudos
continuum
Immortal
Immortal

> (theoretically you could update the base and the linked virtual machines would all get the benefit)
No - it does not work like that.

If you change the base of a linked clone you will corrupt all your linked clones.

Do you need support with a recovery problem ? - send a message via skype "sanbarrow"
0 Kudos