Steps to Clone a Windows (NICE) Virtual PC at Cern


P.C. Burkimsher

Background

We assume we have a virtual PC declared and running Windows already. We want to make a new virtual PC which is a clone of our original.

Important: A Virtual PC (VPC) has several “names” i.e. ways of identifying itself. When we make a clone, we have to adjust each of the names in turn.

I used the following naming convention for my VPCs: Each VPC name has a prefix which is the name of the real physical computer I normally run this VPC on. Why? It’s probably not necessary in fact, but it does make it clearer (to me) which are the real machines and which ones are the VPCs when I’m looking at entries in WinServices and LanDb.

A Virtual PC at Cern is registered/named/known as follows:

  1. In the “Virtual PC console” on your host (physical) machine. The name here seems to be just a local name. It carries little significance, other than to distinguish the VPCs in the VPC console list. (I believe you can trivially change it to something else at any time.)
  2. Inside Windows XP. When the VPC is running, look in Start>Ctrl panels> System > Computer name. There are 2 names here. The “Computer description” seems to be another local name that you can freely change by typing in a new “description”. On the other hand, pressing the “Change...” button shows you yet another, different name. This is a serious name and identifies what the “name” of this “Windows Computer” really is. This is the name that appears in the Cern databases. If your serious name is not declared in the Cern databases, then you will not be able to join the Cern domain (and hence not see your MyDocuments folder etc).
  3. In LanDB (http://net). This is where you declare the MAC address (network card) of your machine to Cern.
  4. In NICE Services. The “Computer Account” must show up in https://winservices.web.cern.ch/winservices/Services/ComputerAccounts/ComputerAccountStatus.aspx
Beware! Do not be tempted to pre-declare things in landb (and Winservices) to be "ready". Do it at the right moment in the sequence below, or you'll have problems!

The following instructions refer to VPC1 and VPC2. I am using these names below as parameters. You will substitute these names with your source machine name and new destination (clone) machine name respectively!

Initial Steps to make a clone (MS VPC and VMWare)

Assume your source VPC has the serious name pcitconnVpc1.
You will NEED a login name with admin privs on this machine (i.e. not in th Cern domain, but local to this computer.) If it doesn't already have such a user account, create one now.
Assume we want vpc1's clone to have the serious name pcitconnVpc2.
Shut down the virtual PC VPC1.
What you do next depends on whether you are cloning a Microsoft VPC or a VMware Server PC. Follow the appropriate paragraph for MS VPCs or VMWare Virtual Machines. Don't forget to come back here and perform the "Final Steps" which are common to both platforms!

Platform specific steps

If you are cloning a Microsoft VPC, then follow these instructions.
If you are cloning a VMWare machine, then follow these instructions instead.

Final steps to complete your clone. (MS VPC and VMWare)

Declare the new serious name to LanDb. Register it as a “Portable” computer. Give the new MAC address you decided upon. The LanDb update should be immediate (i.e. a “flash” update) and the information you give should also appear immediately in the NICE Services Db.
You may now boot VPC2. It should boot and join the Cern domain as you would expect. If you have problems, see below. I suggest you now rename your C drive, eg PcnnnVpcM as appropriate.

What about vpc1 that we managed to remove from winservices? By waiting long enough (probably overnight), the Landb entry is re-propagated to Winservices db too. On first boot though, it will not join the Cern domain. rather, login with a local username and go to Start>CtrlPanels>System>ComputerName and press "Network id". Go through the wizard, asking to join the Cern domain. You will need to give the username/password of the "main user" (or responsible person?) of the machine.
Finish up by rebooting VPC1.

Other Remarks

If you are running PVSS on your cloned machine, the license checker realizes that your machine has changed. You may need a new license for VPC2 (or, at the very least, you will have to change the hostname in line 1 of your license).

Now tell someone, somewhere to backup your new cloned machine!

I recommend that you right click on your new Clone's C drive and change the Settings so that the VPC does not index the C drive for fast searching.




Specific steps applicable to MS VPCs ONLY

(Assumes you have already performed the initial steps detailed above).
Duplicate the pcitconnVpc1.vmc (Virtual machine Config) file. Call it pcitconnVpc2.vmc
Duplicate the pcitconnVpc1.vhd (Virtual Hard Disk) file. Call it pcitconnVpc2.vhd
Edit the pcitconnVpc2.vmc file (in 2 places, ie on 2 lines) to refer to the new (vpc2) .vhd file. Do not be tempted to change the MAC address yet!
Run the Virtual PC Manager and add Vpc2 to its list of known VPCs. (This involves nothing more than telling it where the new .vmc and .vhd files are i.e. "Add an existing Virtual Machine".)
Boot Vpc2, ie from the new "disk".
Realise that inside VPC2 (ie in start>ctrl panels>system) the serious machine name will still be vpc1 and it still using the real vpc1's MAC address!
Vpc2 (serious name pcitconnVpc1) should start and boot normally into the Cern domain. (If it does not, see the Troubleshooting section below.) We next change its serious name.
Press Start>ctrl panels>system>Computer name. Set the computer description freely.
Press “Change...” and give the new serious name “pcitconnVpc2”.
The machine should change its serious name and tell you that you need to reboot. Do a shutdown (without reboot.)
For now, we merely note that vpc1 has been removed from the Winservices db and replaced with vpc2. We further notice that Landb still knows about vpc1 but is still unaware of vpc2.
If we go ahead and reboot now we would have our new name but would still be using VPC1’s MAC address. So, next we edit the pcitconnVpc2.vmc file with an appropriate new Ethernet (=Hardware=MAC) address.
After editing pcitconnVpc2.vmc, do not yet reboot VPC2!
Don't forget to go back and perform the final steps (common to both MS VPCs and VMWare)!

How to get a new MAC address (MS VPC only)

I noticed that Microsoft Virtual PC would allocate MAC addresses as follows:
The first machine I created using MS VPC console was given the number : 00-xx-yy-61-aa-bb
The next machine I created using MS VPC console was given the number : 00-xx-yy-63-aa-bb
...where the 4th pair of digits is going up in jumps of 2.
So I suggest you add 2 to the 4th pair of digits of your VPC1’s MAC address and use that. However, it would be a VERY good idea to search in LanDb (address above) just to be sure that no-one else is currently using this number!!

Don't forget to go back and perform the final steps (common to both MS VPCs and VMWare)!

Specific steps applicable to VMWare Virtual Machines ONLY

(Assumes you have already performed the initial steps detailed above).
Duplicate the folder that contains all of the VM files. Call it pcitconnVpc2

Run the VMWare Server console and add Vpc2 to its list of known VPCs. (Edit Virtual machine settings > options > Add existing machine > browse to the machine's .vmx file.) Call your new machine vpc2.
Copy the .vmx file somewhere safe. It contains the existing MAC address that you will need later.
Boot Vpc2.
VMWare asks "Create a new UUID?". Yes, do create a new UUID.
You may then interrupt the boot sequence with the "stop" button.
Copy the (now updated) .vmx file somewhere safe. It contains the new MAC address that you will need later.
Take yet another copy of the old .vmx file (that contains the original MAC address) and use it to overwrite the present .vmx file. In other words, revert to the old MAC address. NB there is more than one line different in the files, it is not just a matter of editing the "Mac Address" line in the file!
Boot Vpc2.
This time, KEEP the old UUID. (Thisd allows the new machine to join the Cern domain and rename itself.)
Realise that inside VPC2 (ie in start>ctrl panels>system) the serious machine name will still be vpc1 and it still using the real vpc1's MAC address!
Vpc2 (serious name pcitconnVpc1) should start and boot normally into the Cern domain. (If it does not, see the Troubleshooting section below.) We next change its serious name.
Login (to the CERN Domain) with an admin privileged account on VPC2. (If it says "can't connect to Domain" you haven't followed the sequence scrupulously enough and now have a mismatch between the Cern databases and your MAC address. Untangling this can take days frown See If you have Problems. )
Press Start>ctrl panels>system>Computer name. Set the computer description freely.
Press “Change...” and give the new serious name “pcitconnVpc2”.
The machine should change its serious name and tell you that you need to reboot. Do a shutdown (without reboot.)
For now, we merely note that vpc1 has been removed from the Winservices db and replaced with vpc2. We further notice that Landb still knows about vpc1 but is still unaware of vpc2.
If we go ahead and reboot now we would have our new name but would still be using VPC1’s MAC address.
Hence you should now switch to VPC2's (new) .vmx file which contains the new MAC address. I strongly suggest you do this by copying the safe file of new MAC address, overwriting the existing .vmx file.
After swapping .vmx files, do not yet reboot VPC2!

Now go back and perform the final steps (common to both MS VPCs and VMWare)!

If you have problems

The first time that I did this, I did things in the wrong order. At one point I needed to delete my Cern Db definitions and start again. I deleted from LanDb OK, but then had to wait 4 days (yes, 4 days!) for the deletion to be propagated (synchd) to NICE Services Db. I tried asking helpdesk to sync it immediately and they just said “wait”. I asked “How long for?” Then they said “3rd level support says ‘wait’ ”.

Another time it didn't work either. Even though the serious vpc name was declared in landb with MAC address A and I was using MAC address A in the .vmc file, I still couldn't join the domain (but could only login locally). I checked that the Vpc Console>Settings>Networking had the Intel Gigabit Network adapter selected (not NAT!) I went to Start>CtrlPanels>System>ComputerName and pressed "Network id". I went through the wizard, asking to join cern domain and rebooted. Phew!

END

-- PaulBurkimsher - 19 Mar 2009

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2010-09-14 - FedericoPilo
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback