vCenter: A general system error occurred: Invalid fault

I tried to enable maintenance mode on an ESX host and got the following error:

image

Just like my earlier post today, the solution was to restart the management service. Login to the ESX Service Console and run the following command:

service mgmt-vmware restart

after the restart of the service I was able to enable maintenance mode on the specific host.

Source: http://communities.vmware.com/message/1188234

vSphere: vCenter shows VMName (Invalid)

After some issues with a NFS share I noticed that a couple of VM’s changed to Invalid. The VM was still fully operational but vCenter didn’t recognized the VM’s anymore.

image

I found the following knowledge base article: http://kb.vmware.com/kb/1015778 which describes the following symptoms:

•Virtual machines display as invalid in vCenter Server
•The command service mgmt-vmware restart fails to stop the management agent
•The command vmware-cmd -l returns the error:

PANIC: SyncWaitQ: The system limit on the total number of open files has been reached

•The command ps -auxwww shows a large amount of SSHD processes running

In my case the solution was to restart the management agent on the host where the VM’s where running on.

Just Married 23 July 2010

vSphere 4.1 Download Links Are Ready

image_thumb1_thumb1_thumb[1]

Breaking news: The download links for vSphere 4.1 are ready:

thanks to @vConsult!

 

To be continued. Need some sleep zzzZZZZ (3:27)

vSphere: Set NFS Advanced Configuration Settings via esxcfg-advcfg

Yesterday I created a post about changing the advanced configuration settings for NFS via PowerCLI. Today I will show you how you can change the advanced configuration settings with the use of esxcfg-advcfg. This is quite useful for kickstart installations.

This is a snippet from my ks.cfg file:

# Set NFS advanced Configuration Settings
/usr/sbin/esxcfg-advcfg -s 30 /Net/TcpipHeapSize
/usr/sbin/esxcfg-advcfg -s 120 /Net/TcpipHeapMax
/usr/sbin/esxcfg-advcfg -s 10 /NFS/HeartbeatMaxFailures
/usr/sbin/esxcfg-advcfg -s 12 /NFS/HeartbeatFrequency
/usr/sbin/esxcfg-advcfg -s 5 /NFS/HeartbeatTimeout
/usr/sbin/esxcfg-advcfg -s 32 /NFS/MaxVolumes

So how do you know what values you need to enter when you want to use this command. Bouke has a html version of the esxcfg manuals on his blog: http://www.jume.nl/esx4man/man8/esxcfg-advcfg.8.html. But this page doesn’t show the information I needed. Open the Advanced Settings screen in the vSphere client.

image

Open the NFS settings. Let’s use the NFS.MaxVolumes in this example. NFS is the ‘root’ folder the setting in this case MaxVolumes is the child folder. So if you want to change this setting via /usr/sbin/esxcfg-advcfg we need to use the /NFS/MaxVolumes. If you want to know what the current value is, just run the following command from the service console:

/usr/sbin/esxcfg-advcfg –g /NFS/MaxVolumes

This will be the output:

image

When you change the value to 32 via this command:

/usr/sbin/esxcfg-advcfg -s 32 /NFS/MaxVolumes

This will be the output:

image

PowerCLI: Changing Advanced Configuration Settings for NFS

 go2.wordpress[1]  image_thumb[1] 

After reading Jase’s post http://www.jasemccarty.com/blog/?p=532 about setting the advanced configuration settings. I wanted to create a script and add it to the Community Powerpack (more info about the Powerpack here: http://www.virtu-al.net/2010/06/04/goodbye-virtu-al-hello-community/)

So I created two PowerCLI scripts to achieve this. You can see a short demo here:

 

This script will be added to the new version of the Powerpack.If you don’t want to wait until  the new version of the Community Powerpack comes online, you can use the following script to set the advanced settings on all of your ESX hosts:

param(
    [parameter(Mandatory = $true)]
    [string[]]$vCenter
)

Connect-VIServer $vCenter

$esxHosts = Get-VMHost | Sort Name
foreach($esx in $esxHosts){
    Write-Host "Updating TCP and NFS Advanced Configuration Settings on $esx"

    # Update TCP Settings
    if((Get-VMHostAdvancedConfiguration -VMHost $esx -Name Net.TcpipHeapSize).Values -ne "30"){
        Set-VMHostAdvancedConfiguration -VMHost $esx -Name Net.TcpipHeapSize -Value 30 -Confirm:$false
    }
    if((Get-VMHostAdvancedConfiguration -VMHost $esx -Name Net.TcpipHeapMax).Values -ne "120"){
        Set-VMHostAdvancedConfiguration -VMHost $esx -Name Net.TcpipHeapMax -Value 120 -Confirm:$false
    }

    # Update NFS Settings
    if((Get-VMHostAdvancedConfiguration -VMHost $esx -Name NFS.HeartbeatMaxFailures).Values -ne "10"){
        Set-VMHostAdvancedConfiguration -VMHost $esx -Name NFS.HeartbeatMaxFailures -Value 10 -Confirm:$false
    }
    if((Get-VMHostAdvancedConfiguration -VMHost $esx -Name NFS.HeartbeatFrequency).Values -ne "12"){
        Set-VMHostAdvancedConfiguration -VMHost $esx -Name NFS.HeartbeatFrequency -Value 12 -Confirm:$false
    }
    if((Get-VMHostAdvancedConfiguration -VMHost $esx -Name NFS.HeartbeatTimeout).Values -ne "5"){
        Set-VMHostAdvancedConfiguration -VMHost $esx -Name NFS.HeartbeatTimeout -Value 5 -Confirm:$false
    }
    if((Get-VMHostAdvancedConfiguration -VMHost $esx -Name NFS.MaxVolumes).Values -ne "64"){
        Set-VMHostAdvancedConfiguration -VMHost $esx -Name NFS.MaxVolumes -Value 64 -Confirm:$false
    }
}

 

You can start the script with the parameter –vCenter in my case this is vc01:

image

The script will generate the following output.

image

Note on the first ESX host I already changed the NFS.HeartbeatFrequency during the test of the cmdlets.

vSphere: The Virtual Machine is installing VMware Tools and Cannot Initiate a Migration Operation

image_thumb1_thumb[1]

After upgrading a large group Virtual Machines  to the latest build of VMware Tools. I got an error when I started a vMotion task on a some VMs.

image

The warning is pretty clear but I couldn’t cancel the VMware Tools wizard from the vSphere client. After a short search on Google I found a post from Bob Plankers

The solution is quite simple. Logon to the ESX host where the VM is running on and run the following command:

/ust/bin/vmware-cmd -l

Now you get a list of all the registered VMs on that host. Copy the full path of the vmx from the VM you want to migrate with vMotion. Now run the vmware-cmd pathtovmx getid command:

/usr/bin/vmware-cmd /vmfs/volumes/datastore-name/vm-folder/vmx-file.vmx getid

The latest step is to run the following command. Just replace the idnumber with number you get with the previous command:

/usr/bin/vmware-vim-cmd vmsvc/tools.cancelinstall idnumber

Now you are able to migrate the VM with vMotion again.

Source http://lonesysadmin.net/2009/12/11/how-to-cancel-a-stuck-vmware-tools-install-from-the-esx-cli/

Release: vEcoShell 1.2.6

image

vEcoShell 1.2.6 is GA!!

Quote from vEcoShell blog:

The major difference in 1.2.6 is in how connections to multiple vCenter or ESX Servers are managed.  In previous versions, vEcoShell maintained all session management and required custom code in nearly all of it’s scripts to function properly.  These scripts could not run externally to vEcoShell, so the PowerShell Code tab provided limited value.  With the 1.2.6 release, vEcoShell now lets PowerCLI manage all connections.  This means we were able to remove all custom code from our script library.  Nearly every script that is in vEcoShell today can be run externally.  Simply copy a code block from the "PowerShell Code" tab after a script has completed and paste it into the script editor.  After running the Connect-VIServer command in the console window, the copied funciton will run just as it does in the admin console.

What’s new:

  • it’s the first stable release
  • compatible with PowerCLI 4.0 U1
  • easy Copy and Paste PowerCLI code
  • It will remain Freeware :-)

You can download the vEcoShell 1.2.6 and language packs here: http://vcommunity.vizioncore.com/administration/vecoshell/p/downloads.aspx 

If you’re new to the vEcoShell, checkout the QuickTip videos from Scott Herold here: http://vcommunity.vizioncore.com

CentOS: How To Create a Local VMware Repository

image_thumb1[1] image_thumb[1]

The first step is to configure the repository server. Before you can start, you have to install the createrepo package. Just run the following command:

yum install createrepo

If you didn’t already, also install Apache on the Server that’s hosting the repository.

Let’s create a folder structure so we can place the rpm’s on the server. In case you want create a repository for 32 bit and 64 bit CentOS. You have to create a i386 and a x86_64 directory.

i368:

/var/www/html/repo/centos/5/i386/vmware

Upload your rpm files to the vmware directory and run the createrepo command:

createrepo /var/www/html/repo/centos/5/i386/vmware/

x86_x64

/var/www/html/repo/repo/centos/5/x86_64/vmware

Upload your rpm files to the vmware directory and run the createrepo command:

createrepo /var/www/html/repo/centos/5/x86_64/vmware/

The next step is to test the repository. Just open your favorite web browser and browse to the url. In my case this is: http://distribution.ict-freak.local/repo/centos/5/i386/vmware.

image

If this works, your local vmware repository is ready for action. But first we need to add the repository on the client side.

Open the following file in your favorite text editor

/etc/yum.repos.d/vmware_local.repo

Add the following lines and edit the baseurl so it will match your environment.

[vmware_local]
name=Uniserver CentOS-$releasever-$basearch
baseurl=http://distribution.ict-freak.local/repo/centos/$releasever/$basearch/vmware/
gpgcheck=0
enabled=1

Save the vmware_local.repo file and run the yum update command.

image

Now you’re ready to install packages from the vmware_local repository. Let’s install VMware server 2.0.2-203138 by running the following command:

yum install VMware-server

The install process will start:

image

When you also upload the VMware Tools rpm file, you can install or update the package with the following commands:

Install:

yum install VMwareTools

Update:

yum update VMwareTools

When you need to upgrade de VMware Tools, the only thing you have to do is upload the new rpm file and run the yum update command. The finals step is to run the vmware-config-tools.pl script. But this step can be replaced by the check-vmware-tools script. More info about this script can be found here: http://bit.ly/97fpcD

PowerCLI: Script to Schedule Memory and or vCPU up/downgrade

After creating the Restart-VMs.ps1 script, I also created a script to schedule vHardware changes. With this script, you’re able to upgrade or downgrade the amount of memory and or the amount of vCPU’s of a VM. Just lik the restart script, you can schedule this script and change the recommended parameters.

These are the parameters you need to supply to the script. The first two parameters are mandatory. When you supply all the parameters, you are able to add/remove Memory and add/remove vCPU’s.

-vCenter enter the vCenter server you want to connect to. It’s possible to connect to multiple vCenter servers.
-vmName enter the name of the VM you want
-MemoryMB enter the amount of memory you want to add or remove from the VM. Be sure you enter the amount in MB.
-MemoryOption Supply the option add or remove.
-CPUCount Enter the amount of vCPU’s you want to add or remove from the VM.
-CPUOption Supply the option add or remove.

This is how the script works.

  1. Connect to vCenter
  2. Shutdown the selected VM
  3. Add/remove memory and or vCPU’s
  4. Poweron the selected VM
  5. Disconnect vCenter

Now it’s time for an example. I have a VM called NAGIOS and needed to remove 512MB RAM and needed to add an extra vCPU. So I started the script with the following parameters:

.\Change-VM_Memory_CPU_Count.ps1 -vCenter vc01.ict-freak.local -vmName NAGIOS -MemoryMB 512 -MemoryOption Remove -CPUCount 1 -CPUOption Add

The VM is powered off and the memory is downgraded to 1024MB RAM and the total number of vCPU’s upgraded to 2.

image

You can download the script below.

Read more of this post