Wednesday, December 3, 2014

VMKcore partitions on ESXi hosts with non-local Disks

When running ESXi from local storage, a VMKcore partition is created during install.
If your ESXi Host 5.0/5.1/5.5 experiences a Purple Screen Of Death (PSOD), it hopefully creates a diagsnostic coredump. This coredump contains useful information for root cause analysis.

When a PSOD should occur, you can retrieve the dump information using the esxcfg-dumppart command: esxcfg-dumppart –log <ESX dump file> or esxcfg-dumppart –L <ESX dump file> from a shell session.

If there is no available disk partition for a coredump on your ESXi host, such as in Auto-Deploy or "USB/Memcard installs" where there is no local disks, you will get the following error message:

“No vmkcore disk partition is available and no network coredump server has been configured. Host core dumps cannot be saved.”

In such configuration cases, it is better to move the core dumps to a datastore. This has to be a VMFS volume, which rules out NFS. Since the vmkcore dump partition has to be available at boot time, software iSCSI is ruled out too. Only hardware iSCSI or FC LUNs are possible.

Setting VMKcore partition
The following steps are needed to configure the vmkcore partition. In my example I’m using a 10GB LUN provisioned by iSCSI.
Create the LUN
On my shared storage I created a 10GB iSCSI target and assigned it to my ESXi host. Then on the ESXi host you add the iSCSI target. Do a rescan and then add the iSCSI target like you would normally add a new datastore by pressing the “Add Storage” option in the Storage menu on the configuration tab. Choose to add a Disk/LUN and name it something like: vmkcore-esx01. After a rescan the LUN should be available in your storage view.
Change the partition type
Now the datastore needs to have the disk type changed. To do this you will have to logon to the ESXi host using tech support mode. After you are logged in, list all partitions using the fdisk -l command. You will now see a list of partitions in which you should search for your 10GB disk. In my case it looked like:
Disk /dev/disks/naa.5000144f33903730: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Now to change the partition type, run fdisk /dev/disks/naa.5000144f33903730 (copy it from your fdisk list). In fdisk hit “t” to change the partition’s ID, then hit “fc” to change the partition type to VMKcore. Now hit “w” to write the partition table and exit fdisk.
Set and activate the partition
The last step is now to tell ESXi to use a new vmkcore partition using the following command. First we double check for suitable vmkcore partitions:
esxcfg-dumppart –f
 
If the fdisk action went well, you should now see the /dev/disks/naa.5000144f33903730 partition again in the list. To set the partition use the following command:
esxcfg-dumppart -s naa.5000144f33903730:1
If you receive the message: “Unable to set dump partition naa.5000144f33903730:1. 
Use the command switch -a to activate the partition using the following command:
esxcfg-dumppart -a naa.5000144f33903730:1

Friday, October 24, 2014

Configuring SNMP v1/v2c/v3 Using ESXCLI 5.1

To access the new SNMP namespace in ESXCLI, you just need to run the following command: esxcli system snmp

Note: ESXCLI is available in both the ESXi Shell as well as remotely via vCLI 5.1 or through PowerCLI’s Get-EsxCli cmdlet. You will also need to be running ESXi 5.1 to see the new SNMP namespace.
We have a very thorough walk through of SNMP v1, v2c, and v3 configurations using ESXCLI in our documentation which can be found here, but I thought I quickly show you how easy it is to configure both a SNMP v1/v2c and v3 for your ESXi hosts.

SNMP v1 Configurations:

There are 4 steps:
  1. Set the community string
  2. Set the SNMP target which includes the port and the community string
  3. Enable SNMP service on the ESXi host
  4. Validate SNMP configuration by performing a test operation
esxcli system snmp set –communities public
esxcli system snmp set --targets esxi-host.local@161/public
esxcli system snmp set --enable true
esxcli system snmp test
Another way you can check to ensure you can reach the ESXi host from your SNMP target system is by using the snmpwalk utility which is available on most UNIX/Linux systems. Run the following command which requires you to specify the SNMP version, the community string and the hostname or IP Address of the ESXi host:
snmpwalk -v1 -c public esxi-host
If the command was successful, then you should see a huge list of SNMP data being returned from the ESXi hosts.

SNMP v2c Configurations:

SNMP v2c configuration is similar to SNMP v3 configuration but without any authentication or privacy protocols configured.
There are 4 steps:
  1. Set the community string
  2. Configure an SNMP user and we will use the “-” symbol for no authentication or privacy protocols.
  3. Set the SNMP target which includes the port and user in our previous step
  4. Enable SNMP service on the ESXi host
  5. Validate SNMP configuration by performing a test operation
esxcli system snmp set –c public
esxcli system snmp set –users john/-/-/none
esxcli system snmp set –t x.x.x.x@161/community/none/trap
esxcli system snmp set –e true
esxcli system snmp test
Again, we can verify using the snmpwalk utility just like we did in the v1 example but now we will need to include the username that we had configured. To validate, run the following command:
snmpwalk -v2c -c public -u john esxi-host
Note: There currently is not an SNMP v2c specific example in the ESXCLI documentation, but we are looking to update the documentation with this example.

SNMP v3 Configurations:

There are 8 steps (not all are applicable):
  1. Set the engine Id (need to convert string to hexidecimal string)
  2. Set the authentication protocol which either be SHA1, MD5 or none
  3. Set the privacy protocol which can be AES128 or none
  4. Generate the authentication and privacy hash from the user supplied passwords if either protocols were enabled. You can either provide a file that has the password or use the -r flag which specifies the raw input password
  5. Configure an SNMP user and associating the authentication and privacy hash from the previous step
  6. Set the SNMP target which includes the port and user
  7. Enable SNMP service on the ESXi host
  8. Validate SNMP configuration by performing a test operation
esxcli system snmp set –engineid 766d77617265
esxcli system snmp set –authentication SHA1
esxcli system snmp set –privacy AES128
esxcli system snmp hash -r -A secret1234 -X secret5678
esxcli system snmp set –users william/f9f7311379046ebcb5d134439ee5b7754da8a90f/d300f16eec59fb3b7ada7844ff764cbf4641fe5f/priv
esxcli system snmp set –v3targets esxi-host@161/john/priv/trap
esxcli system snmp set –enable true
esxcli system snmp test
You can also use the snmpwalk utility to query an SNMPv3 host and using the information we supplied earlier to configure SNMP on the ESXi host. To do so, run the following command (you will need to specify the v3 specific flags which includes the username, authentication/privacy password as well as the authentication & privacy protocols):
snmpwalk -v3 -u john -l AuthPriv -a SHA -A secret1234 -x AES -X secret5678 esxi-host

Now that you know how to configure SNMP settings for a single ESXi host, how do you go about applying this across all your ESXi hosts, say 100 or 10,000? There are several ways which will depend on how your environment is setup. If you are using vCenter Server to centrally manage your ESXi hosts, then you can easily proxy ESXCLI authentication using vCenter Server and you do not need to specify the login credentials to each and every ESXi host. Here is an example of connecting to an ESXi host called esx-1.local which is being managed by vcenter-1.local and we will enable the SNMP test command:
esxcli –server vcenter-1.local –vihost esxi-1.local system –user administrator snmp test
Notice, instead of specifying the hostname of the ESXi host we are using the –server flag, to specify the vCenter Server and –vihost to specify the specific ESXi host we would like to operate on. Finally, we will also need to provide the credentials to connect to the vCenter Server.
If you are not using vCenter Server or prefer to connect to each individual ESXi hosts, then you will need to specify the individual credentials to each ESXi host. You also can interact with the ESXCLI interface using PowerCLI if you are more familiar with that by using the Get-EsxCli cmdlet.
In all three options, you simply just need to specify a list of ESXi hosts which can then be read from a flat text file, CSV, etc. and place the ESXCLI commands in a “for” loop which will iterate through the list of ESXi hosts and apply the SNMP configurations.

Tuesday, October 14, 2014

vCenter Update Manager fails "does not have db_owner privilege on MSDB database"

Database owner privileges error during vCenter Update Manager install

Another vCenter Update Manager install problem!
The DB user entered does not have the required permissions needed to install and configure VMware Update Manager with the selected DB. Please correct the following error(s) : The database user “ does not have db_owner privilege on the MSDB database.

image
Cause: You’ll encounter this problem if you are using a service account to install VUM. To solve this, temporarily give the service account the sysadmin server role. To do this, perform the following tasks.

  1. Open the Microsoft SQL Server Management Studio
  2. In the Object Explorer, navigate to Security > Logins
  3. Right-click on the user you’re using to install VUM then click Properties.
  4. Click Server Roles
  5. Select sysadmin then click OK.

image

Once you’ve installed VUM, you can remove the the sysadmin role from the service account.

Monday, August 25, 2014

View Composer Fault: Unable to decrypt credentials for component Unknown and configID: null

When trying to recompose, deploy, or restart Linked-clone pools I keep getting this error.

View Composer Fault: Unable to decrypt credentials for component Unknown and configID: null

I'm currently running the following:

vCenter 5.1.0  Build 1473063
View Connection 5.3
View Composer 5.3


Fix:

In View Horizon Administrator, View Configuration, Servers select your vCenter Server and click "Edit". In the "Edit vCenter Server" tab, select the "Edit" button under "vCenter Server Settings" and try using another account other than the one that is currently selected. Make sure it authenticates and then change it back to the original account.
Try another maintenance move within one of your pools again and see if it works now! This worked in our situation.

What we found out is when this account is configured the first time, View Horizon will cache those credentials for ease of use when trying to deploy 100 or 1000 VM desktops. You wouldn't want View Horizon to authenticate each time a VM gets deployed, it would bogg down your Domain Controllers and/or saturate your network with authentication requests.

NOTE:We used the same vCenter server name in our case because we had to rebuild our vCenter server due to a Microsoft Patch that crashed our working server.

Monday, April 14, 2014

Deploying or recomposing View desktops fails when the parent virtual machine has CBT enabled (2032214)

  • In the /var/log/vmware/vpxa.log file on the ESXi host, you see entries similar to:
DISKLIB-CTK : Could not open tracking file. File open returned IO error 4.
DISKLIB-CTK : Could not open change tracking file "/vmfs/volumes/<UUID>/<parent vm name>-ctk.vmdk": Could not open/create change tracking file.
DISKLIB-LIB : Could not open change tracker /vmfs/volumes/<UUID>/<parent vm name>-ctk.vmdk: Could not open/create change tracking file.
DISKLIB-LIB : Failed to open '/vmfs/volumes/<UUID>/<parent vm name>-000002.vmdk' with flags 0x21e Could not open/create change tracking file (2108).
[NFC ERROR] NfcFileDskOpenDisk: Failed to open '/vmfs/volumes/<UUID>/<parent vm name>-000002.vmdk': Could not open/create change tracking file (2108).
[NFC ERROR] NfcFile_Open: Open failed:
[NFC ERROR] NfcFile_Clone: Failed to open source file
[VpxNfcClient] File transfer [ds:///vmfs/volumes/<UUID>/<parent vm name>-000002.vmdk-> ds:///vmfs/volumes/<UUID>/replica-<id>/replica-<id>.vmdk] failed.
[VpxNfcClient] NFC file error for file ds:///vmfs/volumes/<UUID>/<parent vm name>-000002.vmdk
[VpxNfcClient] Closing NFC connection to server


Resolution

To work around this issue, disable CBT on the parent virtual machine. Ensure that there are no snapshots on the parent virtual machine. For more information, see Consolidating snapshots in vSphere 5.x (2003638).

To disable CBT:
  1. Power off the virtual machine.
  2. Right-click the virtual machine and click Edit Settings.
  3. Click the Options tab.
  4. Click General under the Advanced section, then click Configuration Parameters. 
  5. Set the ctkEnabled parameter to false for the corresponding SCSI disk.
To prevent any third-party applications from enabling Change Tracking on the virtual machine:
  1. Open the .vmx file of the virtual machine using a text editor.
  2. Add this entry to the file:

    ctkDisallowed="true"

Thursday, April 10, 2014

Netapp VSC 4.1 Plugin vCenter - Optimization and Migration

One of my most frequently read articles is on how to use MBRAlign to align your virtual machine disks on Netapp storage. Well, after Netapp has released their new Virtual Storage Console (VSC4) the tedious task of using MBRAlign might be eased for some admins.

Optimization and Migration
The new VSC4 console for vSphere has a new tab called Optimization and Migration. Here you are able to scan all or some of your datastores to check the alignment of your virtual machines. The scan manager can even be set on a schedule so that changes to the datastore will be recognized.
VSC_Datastores_Scan

Once you have scanned your datastores you can go the the Virtual Machine Alignment section and see if your virtual machines are aligned.
VSC_Actually_Aligned2
What if your virtual machines are not aligned already? Netapp has a new way to align your virtual machines without having to take them offline.
 
Disclaimer: I’ve looked for documentation on exactly how this process works, but couldn’t find any.


Aligning Virtual Machines
Lets go through the process of aligning a misaligned virtual machine using VSC4.
First, we select the virtual machine that is misaligned and choose the migrate task. This opens the alignment wizard.

Choose your filer.
VSC_WIZ1

Next choose a datastore. If we already have a functionally aligned datastore with an offset that’s the same as your unaligned virtual machine’s offset, you can select an existing datastore. If you don’t have an existing datastore that will align with your vm, you’ll receive an error message like the one below. If that’s the case, create a new datastore from the wizard.
VSC_WIZ3

Choose the datastore type.
VSC_WIZ4

In our case we’ll create a new datastore.
VSC_WIZ5

Once the migration is complete you’ll see your virtual machine in a new datastore and it will be aligned. Notice how the virtual machine offset matches the name of the new datastore that was created. Offset 7 was put into the AlignedDatastore1_optimized_7 datastore.
VSC_FunctionallyAligned

Now you can rest easy, knowing that your virtual machines are not suffering performance issues due to unaligned disks, and no downtime was required to do so.

Wednesday, April 9, 2014

VDR - Cannot take a quiesced snapshot of Windows 2008 R2 virtual machine error -3960

* Backup applications, such as VMware Data Recovery, fail with the error:

Failed to create snapshot for <vmname>, error -3960 (cannot quiesce virtual machine)



====================Solution=============================================

This is not a VMware issue.

This issue occurs due to a known issue with VSS application snapshots and ESXi/ESX 4.1 and later.

To work around this issue, disable VSS application-based snapshots and revert back to file system quiesced snapshots.

Notes:

Option 1 - Disable VSS application quiescing using the vSphere Client:
  1. Power off the virtual machine.
  2. Log into vCenter Server or the ESXi/ESX host through the vSphere Client.
  3. Right-click the virtual machine and click Edit settings.
  4. Click the Options tab.
  5. Go to Advanced > General > Configuration Parameters.
  6. Add or modify the row disk.EnableUUID with the value FALSE.
  7. Click OK to save.
  8. Click OK to exit.
  9. Right-click the virtual machine and click Remove from Inventory to unregister the virtual machine from the vCenter Server inventory.
  10. Register the virtual machine back to vCenter Server. For more information, see Registering or adding a virtual machine to the inventory on vCenter Server or on an ESXi/ESX host (1006160).

    Note: If this change is done via the command line, use vim-cmd command to reload the vmx is enough to see the changes. For more information, see Reloading a vmx file without removing the Virtual machine from inventory (1026043).
  11. Power on the virtual machine.
Note: To configure the disk.EnableUUID parameter for VMware Data Protection (VDP), see the Resolution section in Backing up a Windows Server 2008 R2 virtual machine using VMware Data Protection 5.1 fails with the error: Execution Error: E10055:Failed to attach disk. (2035736).


Option 2 - Disable VSS application quiescing using VMware Tools:
  1. Open the C:\ProgramData\VMware\VMware Tools\Tools.conf file in a text editor, such as Notepad. If the file does not exist, create it.
  2. Add these lines to the file:

    [vmbackup]
    vss.disableAppQuiescing = true

  3. Save the file.
  4. Exit the editor.
  5. Restart the VMware Tools Service for the changes to take effect. Click Start > Run, type services.msc, and click OK.
  6. Right-click the VMware Tools Service and click Restart.