VMware Cloud Community
S_COLA
Contributor
Contributor

vCPUs less power than CPUs ?

Hello,

I'm encoutering a small virtualization problem, I hope you'll be able to help.

We recently vitualized a physical PC (Windows 2000, P4 2.8Ghz, signle-core/no hyperthreading, 512MB). The newly made VM had exactly the same settings (1 CPU, 512MB). The problem is the following : when the OS starts, several services are also started and one takes 100% of the CPU for 30-40 minutes. On the physical machine, the other services could start all the same. On the virtual machine, nothing starts before the "100%-CPU Service" has started.

We solved the problem by adding a second vCPU and setting affinity, but I'd like to understand why something working on a physical PC doesn't work on a virtual one. Should we plan to use 2 vCPUs for each physical one on our VMs ?

Thanx a lot.

0 Kudos
12 Replies
psharpley
Enthusiast
Enthusiast

When you did the P2V, what software did you use?

It is necessary to uninstall software and hardware that will have been copied across in the conversion. Hidden devices can be removed by typing SET DEVMGR_SHOW_NONPRESENT_DEVICES=1 in a command prompt on the VM and then in this window enter DEVMGMT.MSC This starts device management, and 'show hidden devices' under the view menu item. Any hidden devices (greyed out) can be deleted/removed as required. Add/remove programs to remove anything no longer appropriate in the virtualised environment (e.g h/w management agents).

You shouldn't need an extra CPU just because it's virtualised, I think the overhead is only around 5%. What processor speed is your ESX host?

0 Kudos
esiebert7625
Immortal
Immortal

Never use 2 vCPU's unless you have to, most servers/apps will run better on just one. You can actually slow the VM down by giving it 2 vCPU's because of the way the scheduler works. Also you generally never want to use affinity, it's better to let ESX do the scheduling of CPU's. Also vMotion/DRS will not work if you use affinity. I'd follow the below steps to cleanup the VM and see if that helps...

What should I do after I successfully convert my virtual machine?

If you change from a multi-processor system to a uni-processor system you need to manually change the HAL on the Windows server after the conversion. To do this go into Device Manager after the machine first boots and discovers it's new hardware and then click on Computer then right-click on the processor and select Update Driver. Then select Install from specific location and then Don't search I will choose the driver to install. Then select show All compatible hardware and select the appropriate processor. For example, if you went from a dual cpu to a single cpu then select ACPI uni-processor PC instead of ACPI multi-processor PC. You will need to reboot once you change this. To verify what HAL you are using you right-click your hal.dll in c:\windows\system32 and select the Version tab and select Internal Name and it should say halmacpi.dll for multi-processor acpi and halacpi.dll for uni-processor acpi.

Next clean up all the non-present hardware after the P2V conversion. To do this go to a CMD prompt and type SET DEVMGR_SHOW_NONPRESENT_DEVICES=1 and then DEVMGMT.MSC and then select Show Hidden Devices. Delete any old grayed out hardware.

Next remove any vendor specific applications/drivers. For example on a HP server you should go to Add/Remove programs and remove any HP management agents, survey utility, array config utility, version control agent, etc. Also check your NIC and make sure there are no vendor specific drivers there (ie. teaming). Check the Services to see if all there is anything vendor specific related there and disable any services that are.

0 Kudos
S_COLA
Contributor
Contributor

Your message with subject: New message: "vCPUs less power than CPUs ?"

0 Kudos
S_COLA
Contributor
Contributor

First of all, thanks for your answers.

Second, my mistake : The VM was not generated using a P2V tool, but created using a template. Then, all services where installed as they were on the physical machine. Sorry if my explanations were not clear enough...

I will also consider your advice about using only one CPU and removing affinity. If we can, we'll switch back to one CPU / No affinity, but, as long as it doesn't work, we really have no choice.

0 Kudos
esiebert7625
Immortal
Immortal

What Service/Process is having the high cpu usage?

0 Kudos
S_COLA
Contributor
Contributor

Your message with subject: New message: "vCPUs less power than CPUs ?"

0 Kudos
S_COLA
Contributor
Contributor

It's an home-made process : it loads informations from a database in memory. The complete process takes around 30-45 minutes and, during this time, the CPU is working at 100% (and other process can't run)

0 Kudos
dsanders
Expert
Expert

Even if you are forced to use a second vCPU, I would not use affinity.

0 Kudos
S_COLA
Contributor
Contributor

Your message with subject: New message: "vCPUs less power than CPUs ?"

0 Kudos
esiebert7625
Immortal
Immortal

I would consider 2 vCPU's then, if you have one process that pegs the processor at 100% for quite some time this makes it impossible for any other services to run on the server since they cannot get cpu time. Adding a 2nd processor will allow for other services to function while the one process utilizes the other cpu. You might also consider setting the process to Low priority which will allow other services to get more cpu time.

http://www.petri.co.il/forums/showthread.php?t=2010

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Thanks, Eric

Visit my website:

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

0 Kudos
Hernandes
Contributor
Contributor

Thank you for your answers but, basically, the main question is still there : Why everything works fine on a physical server with one CPU but needs two vCPUs on a VM ?

0 Kudos
S_COLA
Contributor
Contributor

Your message with subject: New message: "vCPUs less power than CPUs ?"

0 Kudos