Difference between revisions of "Copying VM from one machine to another"

From Nuclear Physics Group Documentation Pages
Jump to navigationJump to search
 
Line 1: Line 1:
Not completed yet.
+
1. In the VMWare Infrastructure Web Access page select:
First click Virtual Machine from the menu and select Add Virtual Machine to Inventory.
+
  Virtual Machine>Add Virtual Machine to Inventory
Browse through and find the VM you want to add and select the .vmx file in the directory.
+
  Browse through and find the VM you want to add and select the .vmx file in the directory.
  
When you hit Power On you will get a message giving you two options to choose from when copying a VM from machine to
+
2. When you hit Power On you will get a message giving you two options to choose from  
machine and then starting that VM:
+
when copying a VM from machine to machine and then starting that VM:
I moved it
+
  I moved it
I copied it
+
  I copied it
  
I moved it
+
==I moved it==
If you pick "I moved it" it preserves everything in the VM and as long as
+
This option preserves everything in the VM and as long as
 
the VMWare server configuration is identical between the two machines
 
the VMWare server configuration is identical between the two machines
 
the VM will start with no problems.
 
the VM will start with no problems.
  
NOTE: If you copy the VM while it is running make sure to run
+
'''Important Note:'''
      rm -rf *.vmem *.lck in the copied directory before starting the VM
+
  If you copy the VM while it is running make sure to run rm -rf *.vmem *.lck  
 +
  in the copied directory before starting the VM
 +
 
 +
==I copied it==
 +
This will give you some trouble because VMWare server will try to reconfigure
 +
the virtual network interfaces by changing the MAC addresses.
 +
 
 +
You can change the MAC on each virtual interface in the main configuration of
 +
the machine on the VMWare Infrastructure Web Access page.
 +
  Click on "Network Adapter 1" and click edit.
 +
  In this window you can manually enter the MAC.
 +
 
 +
The easiest way is to go into the virtual console and recreate the interface files in
 +
/etc/sysconfig/network-scripts.
  
I copied it
 
This will give you some trouble because when you copy the virtual machine and
 
tell it you copied it, VMWare server will try to reconfigure things, and
 
it will change the MAC addresses on the virtual interface.
 
You can change the MAC on each interface in the main configuration of
 
the machine on VMWare server.
 
The easiest way is to go into the virtual console and recreate the interface files
 
in /etc/sysconfig/network-scripts.
 
 
In fedora 11 you can't login into the gui as root, so with the focus on the
 
In fedora 11 you can't login into the gui as root, so with the focus on the
 
console just hit Ctrl-Alt-F1-9.
 
console just hit Ctrl-Alt-F1-9.
NOTE:If interfaces don't come up then this may be due to a mismatch
+
 
    in MAC addresses and correcting the MACs in /etc/sysconfig/
+
'''Important Note:'''
    network-scripts sometimes will not work.  I found by going into
+
  If interfaces don't come up then this may be due to a mismatch in MAC addresses and correcting the MACs in  
     /etc/udev/rules.d/70-persistent-net.rules and changing the eth0
+
    /etc/sysconfig/ network-scripts/
    and eth1 MACs.  I was also lead to udev by doing a
+
  But sometimes this will not work.  So I found by running the command:
    dmesg|grep eth and you will see something like "eth1 being renamed to eth4".
+
    dmesg|grep eth0
 +
  it would output something like this:
 +
     "eth1 being renamed to eth4"
 +
  This lead me to change the eth0 and eth1 MACs in:
 +
    /etc/udev/rules.d/70-persistent-net.rules

Revision as of 19:32, 22 December 2009

1. In the VMWare Infrastructure Web Access page select:

 Virtual Machine>Add Virtual Machine to Inventory
 Browse through and find the VM you want to add and select the .vmx file in the directory.

2. When you hit Power On you will get a message giving you two options to choose from when copying a VM from machine to machine and then starting that VM:

 I moved it
 I copied it

I moved it

This option preserves everything in the VM and as long as the VMWare server configuration is identical between the two machines the VM will start with no problems.

Important Note:

 If you copy the VM while it is running make sure to run rm -rf *.vmem *.lck 
 in the copied directory before starting the VM

I copied it

This will give you some trouble because VMWare server will try to reconfigure the virtual network interfaces by changing the MAC addresses.

You can change the MAC on each virtual interface in the main configuration of the machine on the VMWare Infrastructure Web Access page.

 Click on "Network Adapter 1" and click edit.
 In this window you can manually enter the MAC.

The easiest way is to go into the virtual console and recreate the interface files in /etc/sysconfig/network-scripts.

In fedora 11 you can't login into the gui as root, so with the focus on the console just hit Ctrl-Alt-F1-9.

Important Note:

 If interfaces don't come up then this may be due to a mismatch in MAC addresses and correcting the MACs in 
   /etc/sysconfig/ network-scripts/
 But sometimes this will not work.  So I found by running the command:
   dmesg|grep eth0
 it would output something like this:
    "eth1 being renamed to eth4"
 This lead me to change the eth0 and eth1 MACs in:
   /etc/udev/rules.d/70-persistent-net.rules