Avatar of benc007
benc007
Flag for United States of America asked on

Windows 2012 Server - How to Copy / Replicate a VM

I want to copy a VM on the same physical Windows Server 2012, and rename it as VM-COPY.  How do I do this?

I looked at Hyper V Server Replication, but it seems like this is only for replicating VMs to a different server.
Windows Server 2012Hyper-VStorage Software

Avatar of undefined
Last Comment
Seth Simmons

8/22/2022 - Mon
aravind anche

i will copy the vhd disk and make it as copy and create new Vm with vhd copy
Alvaro Lamadrid

It seems like there is a very useful wizard in hyper v to accomplish such task. Here is the link.

https://techjourney.net/how-to-clone-vm-virtual-machine-in-hyper-v/

They will approach it from a cloning stand point, but since hyper be dosent seems to support cloning a running VM out of the box this tutorial will guide you through make a full copy of the VM.

PD: watch out for the network config...
benc007

ASKER
RE: i will copy the vhd disk and make it as copy and create new Vm with vhd copy
Please provide steps on how to do this, but I think this only copies the files and not an entire image of the VM (which has certain programs, settings, etc.)

When I right click the VM I want to copy, I also see Save, Checkpoint and Export.  Can this be used to copy the VM and all the settings to VM-COPY which is on the same physical server?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
aravind anche

ok here what I did couple days ago!
I was low on space on a drive , So i saved the vm (There is a save button on top left hand side when you connect to VM.).
Then I copied the vhd and snapshots associated to that to the another drive and created new vm using that vhd. It has all just like the parent VM.
benc007

ASKER
Alvaro Lamadrid - I have events and processes running on the source VM.  If I clone it, do I have to stop the events and processes that are running on the source VM first?

dj 3094 - Do you think Alvaro's way is faster and easier?
Lee W, MVP

Is the VM part of a domain?  if so, you can't do that without causing problems.  Windows networks do not support cloning / imaging systems that are in production.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Alvaro Lamadrid

The comment regarding the computer being joined to a domain or not , and your comment regarding your services etc... Sadly I don't think I can't give an specific advise , I'll say clone it and remove the PC from the domain change the name of it , then put it back . Remember backing up user profiles if you don't have roaming profiles or folder redirection . This steps should give a computer just like the one you cloned from and I don't think you will have an issue with Active Directory
Lee W, MVP

I'll say clone it and remove the PC from the domain change the name of it , then put it back . Remember backing up user profiles if you don't have roaming profiles or folder redirection . This steps should give a computer just like the one you cloned from and I don't think you will have an issue with Active Directory

its unwise AT BEST to do such a thing with a production environment- such steps would leave you in an unsupported state.
Alvaro Lamadrid

Lee, maybe I wasn't clear enough , when I said un join the PC from the domain a meant the new clone , the one in production oviously needs to stay in production.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
benc007

ASKER
Lee W - "Is the VM part of a domain? " ... what do you mean exactly?  The VM uses a few IP addresses but it doesn't host any websites.
Alvaro Lamadrid

benc007 - I think we are assuming too much at the time of give you an advise

I use Xen Server 7 and my replication or cloning process is seamlessly. I guess we touched the domain part because we assumed that you have a Windows based network and that the VM was running Windows .

In my opinion if you need not only the answer to "How to clone a VM in Hyper V" but also how to plan to deploy a clone of a machine that can be a server of some service or a user computer I feel like we will need more info to help with the plan.
aravind anche

""Alvaro Lamadrid - I have events and processes running on the source VM.  If I clone it, do I have to stop the events and processes that are running on the source VM first?

dj 3094 - Do you think Alvaro's way is faster and easier?"

Both  take same effort
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Alvaro Lamadrid

Even though Hyper V might allow you to clone the VM while its on (It depends on your environment), I would like to recommend you to schedule a Maintenance WIndow and perform the cloning while the original VM is off. Then at the time of turning on the new VM make sure your network settings wont create a problem with the original VM  (IP conflicts). That should give you a functional clone of the original VM. So, yes I will recommend to have the VM off.
benc007

ASKER
Alvaro - RE: Even though Hyper V might allow you to clone the VM while its on (It depends on your environment), I would like to recommend you to schedule a Maintenance WIndow and perform the cloning while the original VM is off. Then at the time of turning on the new VM make sure your network settings wont create a problem with the original VM  (IP conflicts). That should give you a functional clone of the original VM. So, yes I will recommend to have the VM off.

I can't turn the original VM off because it's running critical processes.  How can I clone this VM without turning the original VM off?

After cloning, how can I run the same critical processes on the clone?
Alvaro Lamadrid

Benc007 ,

Before I post anything you MUST! read this part. This is a recommendation that I found online and I agreed 100% with the guy who posted:

"Before cloning a VM, you may want to prepare the source VM with the Sysprep (System Preparation Tool) utility to reset and remove the unique security identifier (SID) for the VM, and avoid issues such as two computers have a same IP address or two computers have the same computer name. This step is recommended for VM that is joined to Active Directory (AD) domain on the same network, but is not required most of the time, and can usually be skipped for virtual machines running as workstation (don’t join domain).
Sysprep.exe utility is normally located in the following location:

C:\Windows\System32\Sysprep

In the System Preparation Tool window, select Enter System Out-of-Box Experience (OOBE), check the Generalize checkbox’, and choose Shutdown as the shutdown options when the Sysprep process completed.

Syspreg VM for Cloning

After Syspreg the virtual machine, you have to go through the entire setup process again when you boot up the virtual machine or its clones again. However, all applications installed and all user data remain exactly as it is"

I dont know if you can do it , since you said that you are running critical processes on it but its a good point to pay attention to.

It seems like Hyper V does not support "hot clonning" by default or it does not supports it natively . However you can use this System Center Virtual Machine Manager.

You might have to do a lot of reading or 10 mins of a Youtube video, in any case here is the primary link on how to succeed with Center Virtual Machine Manager :

https://technet.microsoft.com/en-us/library/gg610610(v=sc.12).aspx

Sincerely,

Alvaro Lamadrid
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
benc007

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Seth Simmons

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: benc007 (https:#a42103239)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

seth2740
Experts-Exchange Cleanup Volunteer