Posts

Showing posts with the label VMware troubleshooting

Connect-VIServer Could not connect using requested protocol | VMware PowerCLI

When we try to connect to Vcenter server/ESXi using the command Connect-VIServer -Server 172.25.xx.xx from vSphere PowerCLI, received the below error : 

Connect-VIServer : 05/07/2012 11:17:31 Connect-VIServer Could not connect using the requested protocol.
At line:1 char:17
+ Connect-VIServer <<<< -Server 172.25.xx.xx
+ CategoryInfo : ObjectNotFound: (:) [Connect-VIServer], ViServerConnectionException
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_ProtocolError,
VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer.

Root cause

The vSphere PowerCLI session is using system proxy. You can verify

Powershell script to backup vApp machines using Veeam backup

These are just basic powershell scripts. You can use your own logic to enhance this.

cls
#Load vmware pssnapin

if(!(Get-PSSnapin | ?{$_.Name -eq "VMware.VimAutomation.Core"}))
{
    Add-PSSnapin VMware.VimAutomation.Core
}

How to shrink size of a vmdk file in ESXi 5.0?

Image
Scenario
When we try to reduce or shrink the size of an existing vmdk file, the operation fails.
Resolution  
There is no option to reduce the size using vSphere client. For this you may need to use putty or cli. Please remember to delete unwanted data from the OS and to shrink the partition internally using the diskmgmt.msc tool. After shrinking , perform the below:

How to reclaim size of a thin provisioned vmdk file in ESXi 5.0?

Image
Scenario

When we use thin provisioned vmdk, the size of the vmdk expands as we pile up data in the OS. But if we delete some data from OS, the reclaimed space in the OS will not be reclaimed from the vmdk. It will continue to occupy the maximum space it have ever used after creation.
Resolution  

Disable warnings when SSH enabled in vSphere ESXi 5.0

The security feature of ESXi 5.0 prompts a warning for ESXi hosts, when SSH is enabled. This can be annoying for system admins. 

The following steps explain how to disable this warning:


Select the ESXi host from the Inventory.Select Advanced Settings from the Software menu.Navigate to UserVars > UserVars.SuppressShellWarning.Set the value from 0 to 1.Click OK.

How to remove Dead or Error iscsi targets from ESXi | VMware

Issue:-

Sometime we may find an iscsi target associated to an iscsi adapter being greyed out and marked as Dead or Error. In VMkernel log you may receive an error as given below:

WARNING: NMP: nmpDeviceAttemptFailover:658:Retry world failover device "naa.6090a05850f3465b871325e61b6af905" - failed to issue command due to Not found (APD), try again...

This is a result of an improper deletion of a LUN/iscsi target from the storage adapter.

Resolution:-

Enter the host into maintenance mode (Just to be safe)

esxcfg-rescan -d vmhba3

Replace vmhba id with the id of your vmhba adpater.
Ensure that you are not receiving any errors by checking vmkernel log file

tail -f /var/log/vmkernel.log

Exit from maintenance mode

You may be required to refresh the storage adapters after the rescan.

Clipboard Copy and Paste does not work in vSphere Client 4.1

To be able to copy and paste between the guest operating system and the remote console, you must enable the Copy and Paste options using the vSphere Client. Alternatively, you can use RDP (Remote Desktop Protocol) to connect to the Windows virtual machines.

To enable this option for a specific virtual machine:
Log into a vCenter Server system using the vSphere Client and power off the virtual machine.Click Edit Settings. Navigate to Options > Advanced > General and click Configuration Parameters. Click Add Row. Type these values in the Name and Value columns:isolation.tools.copy.disable falseisolation.tools.paste.disable false Note: These options override any settings made in the VMware Tools control panel of the guest operating system.
Click OK to close the Configuration Parameters dialog, and click OK again to close the Virtual Machine Properties dialog.Power on the virtual machine. 

Note: If you vMotion a virtual machine to a host where the isolation.tools.*="FALSE" …

Resizing an IDE virtual disk

Remove the IDE vmdk from the VMEdit the “vmdk” file (can be found under cd /vmfs/volumes/<datastore_name>/<vm_name>/)Change ddb.adapterType from “ide” to “lsilogic”Add the IDE vmdk to the VMChange the size of the diskRemove the IDE vmdk from the VMEdit the “vmdk” file Change ddb.adapterType from “lsilogic” to “ide”Add the IDE vmdk to the VMPower on the VM and “extend” the partition within Windows 7
Thanks for Duncan Epping's blog.

Connect-VIServer Could not connect using requested protocol

Issue:-

When tried to connect to Vcenter server/ESXi using the command Connect-VIServer -Server 172.25.xx.xx from vSphere PowerCLI, received the below error : 

Connect-VIServer : 05/07/2012 11:17:31 Connect-VIServer Could not connect using the requested protocol.
At line:1 char:17
+ Connect-VIServer <<<< -Server 172.25.xx.xx
+ CategoryInfo : ObjectNotFound: (:) [Connect-VIServer], ViServerConnectionException
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_ProtocolError,
VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer.

Root cause:-

The vSphere PowerCLI session is using system proxy. You can verify this using the command 
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-PowerCLIConfiguration

Proxy Policy Default Server
Mode
------------ ---------------
UseSystemProxy Multiple

Resolution:-

Disable proxy for the vSphere PowerCLI session using the command

[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere Powe…

Issue taking backup of ESXi Configuration

Issue:-

You might have faced the following issue when trying to take a configuration backup of ESXi

C:\Program Files\VMware\VMware vSphere CLI>vicfg-cfgbackup.pl -save --server 172.xx.xx.xxx backup.bak
Enter username: root
Enter password:*****
Server version unavailable at 'https://localhost:443/sdk/vimService.wsdl' at C:/Program Files/VMware/VMware vSphere CLI/Perl/lib/VMware/VICommon.pm line 545, <STDIN> line 2.



Resolution:-
Run the perl.exe and vicfg-cfgbackup.pl from the original location
C:\>"C:\Program Files\VMware\VMware vSphere CLI\Perl\bin\perl.exe" "C:\Program Files\VMware\VMware vSphere CLI\bin\esxcfg-cfgbackup.pl" -save --server 172.xx.xx.xx test_bkf.bkf Enter username: root Enter password:******* Saving firmware configuration to test_bkf.bkf ...
By default the backup of configuration file will be saved under
C:\Users\username\AppData\Local\VirtualStore\Program Files\VMware\VMware vSphere CLI

Cannot create VMs with virtual machine version 9 in VMware ESXi

                  One of the main addtion of VMware ESXi 5.1 is the introduction of new VM version (VM version 9). 

But when we try to create a new virtual machine using vsphere client 5.1, the option to choose VM version 9 will not be available. This is an intentional omission from VMware. To promote the use of vSphere web client. The new option of VM version 9 is available only in vSphere web client