Archive

Posts Tagged ‘vmware’

VMware PowerCLI script to set the Memory Resources limit on your VMs to Unlimited in bulk

October 19th, 2011 No comments

Had a situation where I needed to reset every VM in one environment to Unlimited that had previously had a an explicitly set memory limit. Here is a nice VMware PowerCLI script that will reconfigure all the affected VMs one by one automatically for you:

get-vm|get-vmresourceconfiguration|where-object{$_.memlimitmb -ne '-1'}|set-vmresourceconfiguration -memlimitmb $null

VMkernel ports change automatically when applying a Host Profile

October 18th, 2011 1 comment

Wonderful little vSphere bug we came across today. Let’s say you have a host with the following VMKernel ports configured on the vSwitch:

-vmk1 = vMotion
-vmk0 = Management Network

When you create a host profile from the host, then apply that profile to a new host you are adding, the VMKernel ports get swapped! They will be:

-vmk1 = Management Network
-vmk0 = vMotion

My co-worker came up with a good workaround. Put your affected host into maintenance mode, then go edit the Host Profile you had applied. It appears the kernel ports are created in the order in the Host Profile. So you just change the order from:

-vMotion
-Management Network

to:

-Management Network
-vMotion

You do this by renaming “vMotion” to something like “vMotion2MN”. Then change the name of “Management Network” to “vMotion” and change “vMotion2MN” to “Management Network”. From here you need to make changes to each port group which are:

-make sure the NICs are ordered correctly
-specifying the correct service for the port group
-making sure the IP is set to explicit

So for the vMotion port group, order the NIC:

Choose vmotion for the service:

Set the explicit IP option:

And for the Management Group, order the NIC:

Choose management for the service:

And set the IP to be explicit:

Make sure to press the OK button in the lower right button after every page or when you navigate to another page, it will lose whatever changes you made. Save the profile and re-apply it to your new host. Now it will recreated the VMKernel ports in the correct order.

vMotion fails saying the operation is not allowed in the current state

June 14th, 2011 No comments

I’ve had this happen several times when an ESX host is stuck thinking it is going into maintenance mode from previous maintenance. You get an error saying it cannot complete the migration and “The operation is not allowed in the current state”. Very cryptic error. Just restart the management agents on the ESX host by SSHing in and typing:

service mgmt-vmware restart

hit enter, then:

service vmware-vpxa restart

and hit enter again. You should see the services restart with an "[ OK ]" after each line.

Try to vMotion again now. If you still get an error, disconnect the ESX host from Virtual Center and then reconnect it. Try to vMotion again and it should work. You can also try restarting VC services too. If you have a better solution, let me know. I know it is a bit tedious to go through this process but it does work.

How to solve the VMware “PCI to PCI bridge detected” install loop

March 11th, 2010 10 comments

Have you ever P2Ved a server to an ESX cluster or converted a VMware Workstation VM into a VMware ESX 3.5 or vSphere 4.0 VM and come across this horrible Found New Hardware message that won’t go away.  Here’s a screenshot of a Windows 2000 Advanced Server that I had to fix and P2V after a catastrophic disaster (RAID failure) displaying this message:

Yes, it’s annoying and it seems like it will never go away.  You keep click on install and it keeps detecting after sucessfully installing as if it’s in a loop.  But the reality of it is that it’s not in a loop.  As silly as it sounds, you have to install it 32 times and it will finally go away! :)

The reason for this is because when you update the VM’s virtual hardware (specifically version 7 VMs from my experience), it comes with 32 separate PCI-to-PCI bridge devices that Windows detects and wants to install.  The only workaround I have found so far is to just sit there and install all 32 manually.  Or you can try editing your VMX and set:

pciBridge.present = False

which should work though I’ve never tried it personally.  Don’t want to potentially break something when it takes all of 2 minutes to install all 32 bridges.  Give it a shot and let me know if that fixes it for you guys. :)