VMware Cloud Community
java_cat33
Virtuoso
Virtuoso
Jump to solution

Steps required after P2V - Dev Con, Device Mangler etc

Hi - After a server is P2V'd, ALL server management agents removed, changed the HAL, installed VMware tools etc....

VM performance is fine - does anyone perform any additional steps? I've seen posts about people removing hardware drivers etc, however I remove all un-necessary devices before powering on the VM. When turning on the hidden devices I do not see any hidden devices.

Does anyone use Dev Con or Device Mangler etc??

Also I've noticed you cannot change the HAL to a uniprocessor from a multi if the Windows box is W2K3 SP1 - however this is resolved if W2K3 SP2 is installed. Anyone know of any other work arounds?

I did read on a MS site there was a hotfix - however it looks like this is no longer available as it is now part of W2K3 SP2.....

1 Solution

Accepted Solutions
snapper
Enthusiast
Enthusiast
Jump to solution



        1. 25 June 08 - Updated **





Last update, I promise.



I made some additional chages to this hardware removal script and tested it over the past couple of months with conversions. It now removes (for my Win 2000/2003) machines all non-present devices except those listed under 'non plug and play drivers'. This is the location of vendor specific devices and still needs to be cleaned manually. Other than that, the script should remove all other non-present devices.



Cheers,

SP


Someone pointed out that the script attached here doesn't actually work! The actual line that did the removal was configured to just echo the command .. oops. This has been fixed now Smiley Happy










Devcon is not able to detect ghosted devices. You can do a devcon find and a devcon findall which shows the difference between present and non-present devices.





The way described in my previous email will remove the important non-present devices such as media, networking, sound/video etc, but you can define this by which class you use. Some of the devices (especially system devices) come up as non present, inparticular was the terminal services redirector, so removing all devices (difference between find|findall) removed some of these, and hence why we are using devices in just a few classes.





I search for devices in the following classes:

net cdrom diskdrive display fdc hdc keyboard media monitor scsiadapter unknown floppydisk processor volume





If you want to do a complete automated ghosted hardware removal, the best way would be to run devcon on the physical hardware prior to imaging (devcon find), and compare this with an output run on the virtual machine (devcon findall). The difference between them will be the devices that were presented on the physical and no longer present on the virtual and remove them. Personally, I still think this cause cause troubles because of the software devices present.











I have attached the mentioned scripts to this post. The zip file contains 4 batch files:

1_runonvm.cmd - run on virtual machine to remove most of the non-present hardware

2_rundevmgr.cmd - run on virtual machine, sets the environment variable and launches devcon

downgrade_UP.cmd - automated script to change the current HAL to a uniprocessor (2000/2003)

upgrade_MP.cmd - automated script to change current HAL to multiprocessor (2000/2003)





The folder should be fully self-contained, contains binaries and is path-independant, so can run from network share (1_runonvm.cmd requires writing to the folder though).





If you use and make any improvements, feel free to let me know. Use at your own risk, obviously.





-SP

Don't forget to award points where appropriate 🙂

View solution in original post

Reply
0 Kudos
23 Replies
OlivierTremolie
Enthusiast
Enthusiast
Jump to solution

Hi,

When I use P2V, I also change VM's configuration about local devices : Floppy, CDROM, Serial port, USB, etc... I always delete all local entry to improuve performance, except CDROM I only disconnect it.

Olivier

###############

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

Olivier ############### If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
Reply
0 Kudos
icontrolyourpow
Enthusiast
Enthusiast
Jump to solution

To see devices which no longer exist, you will need to set an environment variable named "devmgr_show_nonpresent_devices" to 1 and launch Device Manager from a shell in which that variable is active. After doing this, checking the show hidden devices option will function as expected.

The HAL hotfix is available if you call Microsoft.

Converter creates converted 2k3 servers with BusLogic adapters. I always change that to the recommended LSI adapter type. I do not know why Converter does this or if there are any negative consequences of changing it to LSI Logic. I have not seen any.

I've noticed assigned shares are often incorrect for the resources allocated to the converted VM. Opening and re-OK'ing the dialog seems to resolve this behavior.

java_cat33
Virtuoso
Virtuoso
Jump to solution

Hi guys - yes I already do what you guys do also.

Sounds like I've got it pretty covered :smileygrin:

I might give MS a call and get the hotfix (although we need to go to SP2 at some stage soon anyway).....

Reply
0 Kudos
OlivierTremolie
Enthusiast
Enthusiast
Jump to solution

Hi,

I agree with you about BusLogic adapters and you're right changing it by LSI adapter. Converter uses BusLogic because you can have a specific adapter card on your physical server. So, by using BusLogic, your VM won't have trouble to start (BusLogic is a generic adapter). Changing adapter, you also have to convert disk. Notice that the convert doesn't work on Windows 2000 server because the boot step on W2k doesn't accept new card/disk. Windows 2003 haven't got problem, but you have to reboot after the first boot.

LSI has got more performance than BusLogic, so it is a very good idea to change it.

About devices, I uninstall and delete all locals devices : Floppy, serial, LPT, USB and all around. I have to uninstall in Windows too... I didn't know this variable : devmgr_show_nonpresent_devices. I take note Smiley Happy

Olivier

###############

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

Olivier ############### If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
Reply
0 Kudos
sapirgolan
Contributor
Contributor
Jump to solution

Hi Guys,

I ahve added the "devmgr_show_nonpresent_devices" variable and restarted the VM.

Now When I open the device manager I can see gray devices. Shell I remove them? If so, does the VM performance will be better?

(see attachment)

Reply
0 Kudos
snapper
Enthusiast
Enthusiast
Jump to solution

Our post - P2V process uses devcon for most of the automation.

1. For a defined set of classes (ie, run 'devcon classes'), find the difference between a devcon findall and devcon find. This finds a number of devices that are 'non present', and can be simply removed using devcon remove. This normally covers all the network cards, storage, drives and sound/video components. This does not work well with system device classes, so don't use them unless you want strange behaviour in your VM.

2.You can easily modify the hal between UP and MP in Windows 2000 and 2003 without any hotfixes, and without being dodgy. The process is basically telling the OS the valid options for the HAL.

ie, if you do a devcon hwids @root\*hal* and look at the 'hardware ID's', you will see the 'compatible' IDs. Use devcon to simply add another valid id and switch it to MP or UP as you wish.

to switch from MP to UP - devcon sethwid @root\*hal* :=+ACPIAPIC_MP

to switch from UP to MP - devcon sethwid @root\*hal* :=+ACPIAPIC_UP

then devcon update "%windir%\inf\hal.inf" ACPIAPIC(UP|MP) will force the update, and reboot.

The third part of the post process is to remove known software. This is done by maintaing a list of known software titles (from add remove programs registry entries). This is usually HP openview, Dell software and anything else you come across. If there is a match, the script simply tells it to run the uninstall string listed in the registry. This works 90% of the time.

Anyone is more than welcome to the shell scripts for the above - I just don't have them with me atm Smiley Happy

Cheers,

SP

Don't forget to award points where appropriate 🙂
OlivierTremolie
Enthusiast
Enthusiast
Jump to solution

Well, I'm not sure it will improve performance. But, for me, if you delete them, windows will have got less drivers to load, and so, more disponibility for other.

For security, make a snapshot before delete them... we never know... Smiley Wink

Olivier

###############

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

Olivier ############### If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
Reply
0 Kudos
java_cat33
Virtuoso
Virtuoso
Jump to solution

Hi Snapper - I can see all the hidden devices (HP NIC drivers etc) - is there a way I can just use devcon to remove everything that is hidden / greyed out? Or do I just run "devcon remove"?

I'm new to Dev Con.... and it sounds like you aren't Smiley Wink

Reply
0 Kudos
snapper
Enthusiast
Enthusiast
Jump to solution



        1. 25 June 08 - Updated **





Last update, I promise.



I made some additional chages to this hardware removal script and tested it over the past couple of months with conversions. It now removes (for my Win 2000/2003) machines all non-present devices except those listed under 'non plug and play drivers'. This is the location of vendor specific devices and still needs to be cleaned manually. Other than that, the script should remove all other non-present devices.



Cheers,

SP


Someone pointed out that the script attached here doesn't actually work! The actual line that did the removal was configured to just echo the command .. oops. This has been fixed now Smiley Happy










Devcon is not able to detect ghosted devices. You can do a devcon find and a devcon findall which shows the difference between present and non-present devices.





The way described in my previous email will remove the important non-present devices such as media, networking, sound/video etc, but you can define this by which class you use. Some of the devices (especially system devices) come up as non present, inparticular was the terminal services redirector, so removing all devices (difference between find|findall) removed some of these, and hence why we are using devices in just a few classes.





I search for devices in the following classes:

net cdrom diskdrive display fdc hdc keyboard media monitor scsiadapter unknown floppydisk processor volume





If you want to do a complete automated ghosted hardware removal, the best way would be to run devcon on the physical hardware prior to imaging (devcon find), and compare this with an output run on the virtual machine (devcon findall). The difference between them will be the devices that were presented on the physical and no longer present on the virtual and remove them. Personally, I still think this cause cause troubles because of the software devices present.











I have attached the mentioned scripts to this post. The zip file contains 4 batch files:

1_runonvm.cmd - run on virtual machine to remove most of the non-present hardware

2_rundevmgr.cmd - run on virtual machine, sets the environment variable and launches devcon

downgrade_UP.cmd - automated script to change the current HAL to a uniprocessor (2000/2003)

upgrade_MP.cmd - automated script to change current HAL to multiprocessor (2000/2003)





The folder should be fully self-contained, contains binaries and is path-independant, so can run from network share (1_runonvm.cmd requires writing to the folder though).





If you use and make any improvements, feel free to let me know. Use at your own risk, obviously.





-SP

Don't forget to award points where appropriate 🙂
Reply
0 Kudos
java_cat33
Virtuoso
Virtuoso
Jump to solution

Thanks for all your help Snapper Smiley Happy

Reply
0 Kudos
Merages
Contributor
Contributor
Jump to solution

Hi Guys,

After a P2V, download devcon

create a script with :

devcon sethwid @ROOT\PCI_HAL\0000 := !E_ISA_UP !ACPIPIC_UP !ACPIAPIC_UP !ACPIAPIC_MP !MPS_UP !MPS_MP !SGI_MPS_MP !SYSPRO_MP !SGI_MPS_MP > nul

devcon sethwid @ROOT\ACPI_HAL\0000 := !E_ISA_UP !ACPIPIC_UP !ACPIAPIC_UP !ACPIAPIC_MP !MPS_UP !MPS_MP !SGI_MPS_MP !SYSPRO_MP !SGI_MPS_MP > nul

devcon sethwid @ROOT\PCI_HAL\0000 := +ACPIAPIC_MP > nul

devcon sethwid @ROOT\ACPI_HAL\0000 := +ACPIAPIC_MP > nul

devcon update %windir%\inf\hal.inf ACPIAPIC_MP > nul

run the script (on the same place that devcon.exe)

and reboot.

PS : the first reboot could not run right, so you may need to do a power off then power on

++

Reply
0 Kudos
snapper
Enthusiast
Enthusiast
Jump to solution

Merages,

You'll notice that in my previous post (above), the scripts listed (downgrade_mp.cmd and upgrade_up.cmd) already do precisely this. ie, add the correct hardware IDs (hwids) to the HAL device. I believe your version will add the hwids of all listed HAL types from the hal.inf file, which is fine it just means it will allow Windows to detect it based on the best hwid match. The scripts provided will detect the current type of HAL (ie, acpiapic or acpipic etc) and modify it to be the same type but either the multiprocessor, or uniprocessor version of the same.

Adding all the known hwids is probably more appropriate if you are making a hardware independant image for deployment (which is very doable, by the way).

Cheers,

Simon

Don't forget to award points where appropriate 🙂
Reply
0 Kudos
Jeffrey_Wall
Contributor
Contributor
Jump to solution

Love this tool and use it daily however am running into trouble on x64 platforms. Any ideas / tips / tricks to get it to run on 2003 x64?

Thank you.

~ Jeffrey

Reply
0 Kudos
rnotaro
Contributor
Contributor
Jump to solution

I found a 64 bit devcon but havent been able to find a 64 bit lmod if one even exists. Anyone else got this working on 64 bit WIndows 2003?

Reply
0 Kudos
snapper
Enthusiast
Enthusiast
Jump to solution

Hi all,

I have modified the script so that it should work with x64 Windows. I simply relocated the awking of some output to use findstr instead of a third party application which does not work under 64 bit Windows.

There are several other modifications:

By default, this will create a directory under the %systemdrive% (normally C:) \admin with the same name as the script. The output files are placed in here, including the list of removed devices.

For the time being (until I get access to a x64 platform), you will need to replace the devcon.exe with the 64bit version and name it the same. When I get the opportunity, I'll use wmic to get the actual os version correctly, and use the appropriate 32|64 bit.

I've included contact information in the output screen as well - please use this if there are errors or improvements, as I don't monitor this post Smiley Happy

Cheers,

Simon

twitter: saniti






Don't forget to award points where appropriate Smiley Happy

Don't forget to award points where appropriate 🙂
Reply
0 Kudos
s1xth
VMware Employee
VMware Employee
Jump to solution

Anyone able to get this script to work under Windows XP? I would love if it would!

http://www.virtualizationimpact.com http://www.handsonvirtualization.com Twitter: @jfranconi
Reply
0 Kudos
chacho
Contributor
Contributor
Jump to solution

I just converted a physical WS2003 that had two procesors, and I reomved on, I let the VM with onkly one procesor. DO I have to do all this you specified here ?

Reply
0 Kudos
snapper
Enthusiast
Enthusiast
Jump to solution

Sorry for the delay but I have updated the version of the script significantly.

It will now:

- Work on all flavours of Windows including 32 and 64 bit. So XP, Windows 2008 x64.

- Based on feedback, have added some new device classes that it will remove

- Creates a list of removed devices in the output folder (%systemdrive%\admin\Don't forget to award points where appropriate Smiley Happy

Don't forget to award points where appropriate 🙂
Reply
0 Kudos
OlivierTremolie
Enthusiast
Enthusiast
Jump to solution

Thank you very much for this update Snapper !

Olivier ############### If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
Reply
0 Kudos