VMware Cloud Community
phillip_from_oz
Contributor
Contributor

Create a VM from a snapshot

Hi,

I have an existing VM on vsphere 7 with SQLserver.

I cannot stop the VM nor stop the DB.

I thought the best idea would be to create a snapshot then if possible create a VM from that snapshot. 

This way there is a much smaller window for DB updates to cause problem to the DB on the new VM.

I noticed that in the powershell, there is a cmdlet new-VM.

There is an example of new-vm with options '-ReferenceSnapshot' but this example also has '-LinkedClone'.

Does this work with vsphere 7?
Does it do what I expect?
What does '-LinkedClone' mean? Is this required?
If this does not work is there any other way of achieving what I want?

Thanks for any help.

0 Kudos
8 Replies
scott28tt
VMware Employee
VMware Employee

What’s wrong with taking a backup?

VM-level backup software (such as that by Veeam) would take a snapshot, backup the VM, then remove the snapshot, leaving you with a backup of the VM which you could restore if needed.

 


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
phillip_from_oz
Contributor
Contributor

Thanks for the reply.

Backups usually take too much time so there is a possibility of backing up many partial transactions.

VMWare snapshots take just 1 mins so the chances of picking up a partial transaction is low

0 Kudos
scott28tt
VMware Employee
VMware Employee

A VM-level backup creates a snapshot first, like I said, then removes it afterwards.

Snapshots themselves are not backups.

The key question is why do you want to take a snapshot? What are you thinking you might need to do with it later?

 


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
continuum
Immortal
Immortal

You can create a VM from a single snapshot - from a single name-000001.vmdk + name-000001-sesparse.vmdk
I do that to extract data from the sesparse.vmdk.

Basically that is the same as recovering some furniture from the first floor of a house after the basement was destroyed by a flood / fire ...

You can no longer use the house but some of the furniture from the first floor may still be usable.
If you consider to use as a way to speed databases that live inside the snapshots you are on the completely wrong road.
Forget it right now !!!!

I offer such tasks as a service when a VM is corrupt beyond repair but the owner desperately needs some data from within the snapshots.
This workaround / trick / recovery technic only works when the snapshot itself is very large - and has almost reached the nominal size of the basedisk.
This is something you do in emergencies only.

Ulli


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Bectato
Contributor
Contributor

When it comes to databases snapshots are not your friend

0 Kudos
continuum
Immortal
Immortal

Exactly - if you have snapshots as friends you no longer need enemies - or free weekends 😎


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
BigMike23
Enthusiast
Enthusiast

Snapshots are not backups. It is dangerous to consider VM snapshots an actual backup copy of data. While many backup products use snapshots as part of a feature set, a snapshot alone is not a backup

0 Kudos
BigMike23
Enthusiast
Enthusiast

I would use Veeam for this work, it creates a snapshot when you start the backup and backs up that snapshot then removes it. You can use this to restore the VM to another name and location then.

0 Kudos