OTV container rebalance for vVOL

 ONTAP tools redistribute vVols among existing volumes based on space usage, thin provisioning, LUN count, and storage capability profiles


Use OTV WebCLI using:

<OTV IP>:9083/cli


Use below commands:

container rebalance -container_name=<vVOL Name>

Note: This is supported only for VMFS/LUN vvols


We can validate the volume details from ontap cluster using "vol show *Vvol*"


Enable FIPs on vCenter Server

 Note: Supported from vCenter Server 70u2 onwards.

FIPS 140-2 is a U.S. and Canadian government standard that specifies security requirements for cryptographic modules


To Enable:

  1. Log in to the vCenter Server system with the vSphere Client.
  2. From the Menu, select Developer Center.
  3. Click API Explorer.
  4. From the Select API drop-down menu, select appliance.
  5. Scroll down through the categories and expand system/security/global_fips.
  6. Expand GET and click Execute under Try it out.
    You can view the current setting under Response.
  7. Change the setting.
    1. To enable FIPS, expand PUT, enter the following in the request_body, and click Execute.
      { "enabled":true }
    2. To disable FIPS, expand PUT, enter the following in the request_body, and click Execute.
      { "enabled":false }

Offline installation of VMware powerCLI modules

 

Offline Installation of VMware PowerCLI Module

  • On a computer with internet access open powershell (as an administrator)
  • Find-Module -Name VMware.PowerCLI
  • Save-Module -Name VMware.PowerCLI -Path Path  (path to download the modules)
  • Copy the files you downloaded to the offline computer
  • Move the copied files to C:\Windows\System32\WindowsPowerShell\v1.0\Modules (requires admin rights)
  • Import-Module -Name <Module Name>

Connect-VIServer Error: Invalid server certificate. Use Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction

Error:

Connect-VIServer Error: Invalid server certificate. Use Set-PowerCLIConfiguration

to set the value for the InvalidCertificateAction


Solution:

From power cli run below command to make it ignore.

>Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

>Get-PowerCLIConfiguration.

Access to resource settings on the host is restricted to the server that is managing it: 'x.x.x.x'

 Error:

Access to resource settings on the host is restricted to the server that is managing it: 'x.x.x.x'


Solution:


1.SSH into the ESXi host
2.Restart the hostd service by running the following command 
/etc/init.d/vpxa stop
/etc/init.d/hostd restart
3.Perform the Operation now and start VPXA:
/etc/init.d/vpxa start

How to deassociate an esxi from vcenter server when Vcenter is not accessible

Error:

 Access to resource settings on the host is restricted to the server that is managing it.

Solution:

 Please disconnect Vcenter Server from ESXI login.

 Follow these steps:

  • connect directly to your ESXi host using the vSphere Client
  • select the ESXi host in the left inventory panel
  • change to the “Summary” tab
  • scroll down till you see the “Host Management” section

In the “Host Management” section you have two possibilities:





vCenter Server gives "Failed to connect Service" after reboot

 Error:


"Failed to connect Service" after reboot



Solution:

After a reboot, you have to waits for some time for all services to come up.

vcenter server management network configuration not allowed

 Error:


While changing the network from DCUI console you will get errors as :

management network configuration not allowed


Solution:

From the DCUI console press Alt-F1 and log in as root. Now edit the IPV4 config as below

VI /etc/systemd/network/10-eth0.network
root@VCSA [ ~ ]# cat /etc/systemd/network/10-eth0.network
[Match]
Name=eth0

[Network]
Gateway=192.168.199.2
Address=192.168.199.7/24
LinkLocalAddressing=no
DHCP=yes
Domains=lab.local

[DHCP]
UseDNS=false

[Route]
Gateway=192.168.199.2
Destination=0.0.0.0/0

Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding

Error:

While doing Vcenter VM operations getting errors as :

 Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding


Solution:

Restart the vCenter server.

Configure Timeout Settings in vCenter server webclient

 


  1. In the vSphere Client, navigate to the vCenter Server instance.
  2. Select the Configure tab.
  3. Under Settings, select General.
  4. Click Edit.
  5. Select Timeout settings.
  6. In Normal, type the timeout interval in seconds for normal operations.
    Do not set the value to zero (0).
  7. In Long, enter the timeout interval in minutes for long operations.
    Do not set the value to zero (0).
  8. Click Save.

    9.Restart the vCenter Server system for the changes to take effect.

            service-control --stop --all

            service-control --start –all

How to upgrade VMware powercli through offline

 

Step1: Download the VMware powecli Offline bundle

 A) Go to the link: "https://code.vmware.com/web/tool/11.2.0/vmware-powercli" and download ZIP file

or from any machine have internet access download using powershell command:

  B) Save-Module -Name VMware.PowerCLI -Path C:\temp

Step2: copy the ZIP extracted file to windows machine path "C:\Windows\system32\WindowsPowerShell\v1.0\Modules"

Step3: run the command  the below command from powershell path C:\Windows\system32\WindowsPowerShell\v1.0\Modules"

 >> "Get-ChildItem * -Recurse | Unblock-File

>> Import-Module VMware.PowerCLI

Step4:Set CEIP using below command:

>>Set-PowerCLIConfiguration -Scope AllUsers -ParticipateInCeip $false

Step5:If any certificate error run below command:

>>Set-PowerCLIConfiguration -Scope AllUsers -InvalidCertificateAction Warn

vSphere powercli fails with "exception has been thrown by the target of an invocation"

Error:

Command stop-vm  fails with "exception has been thrown by the target of an invocation"


Solution:

Upgrade the VMware Power CLI modules to latest version available.

Login to ESXI fails with /usr/lib/vmware/misc/bin/tally_vob.sh failed: exit code 1 | esxi root account locked

Error:

ssh to ESXI fails:

/usr/lib/vmware/misc/bin/tally_vob.sh failed: exit code 1

Cause:

We can login  using DUCI (Direct User Console Interface). The above error is due to root account locked due to multiple wroong password entered

Solution:

Step 1: Login on DUCI using F2, Select “Troubleshooting Options” and Press Enter

Step 2:Enable  “Disable ESXi Shell”  and "Disable SSH"

Step3:Click Alt+F1 or enable the virtual keyboard and use the key to get a console. 

           Login with the root password here and unlock with the below command.

pam_tally2 –user root –reset

Step4: Now try to log in using SSH & you will be logged in as root successfully.










vmware power cli to power on VMs

Login to vSphere Power cli and run below commands

 C:\> Connect-VIServer


cmdlet Connect-VIServer at command pipeline position 1

Supply values for the following parameters:

Server[0]: 192.168.0.1

Server[1]:


Name                           Port  User

----                           ----  ----

192.168.0.1              443   RANJI.COM\Administrator



 C:\> start-VM ranji.local


Name                 PowerState Num CPUs MemoryGB

----                 ---------- -------- --------

ranji.local          PoweredOn  2        8.000


ESXI 7 local datastore is not visible

Error

ESXI 7 onwards local datastore is missing after installation.


Solution:

ESXi 7 if the local disk size is below 128 GB you won't get the local datastore listed after installation.but if the size is more than 128 GB than you can see that you have local datastore available after the system partition size is utilized. This is due to the system storage partition change in the ESXi architecture.

How to mount a local ISO to a VMware VM using PowerCLI

Using the below power CLI script we can mount an iso image that's there in your windows VM to a VMware VM.

Connect-VIServer -Server <IP> -Protocol https -User <> -Password <pass>

  1. $Datastore = "datastore1"    //datastore on your VC 
  2. Get-Datastore $Datastore | New-DatastoreDrive -Name ds
  3. New-Item -Type Directory -Path ds:\ISOfiles
  4. Copy-DatastoreItem -Item "<Path of the ISO file>" -Destination ds:\ISOfiles\0.iso
  5. Get-VM -Name SCVOVA1 |Get-CDDrive | Set-CDDrive -IsoPath "[$Datastore] ISOfiles\0.iso" -Confirm:$false -Connected $true


Once you are done please remove the PS drive using:

C:\> Remove-PSDrive -Name ds

VCSA upgrade from 6.7 to 7 fails with "A problem occurred while getting data from the source vCenter server"

Error :

While the upgrade from vCenter server from 6.7 to 7.x fails with:

A problem occurred while getting data from the source vCenter server




Solution:

This occurs when the VCSA root password expired. 

Follow the below steps to resolve 

Verify the password expired using login to VCSA using root credential and access shell

  • shell.set --enabled true
  • shell

root@photon-machine [ ~ ]# chage -l root

You are required to change your password immediately (password aged)

change: PAM: Authentication token is no longer valid; new one required

Change password

root@photon-machine [ ~ ]# passwd root
New password:
Retype new password:
passwd: password updated successfully

Make password never expires using:

root@photon-machine [ ~ ]# chage -I -1 -m 0 -M 99999 -E -1 root
root@photon-machine [ ~ ]#



Configuring Jumbo Frames on an ESX VM server

 

Default value will be 1500 MTU


To change follow below steps

Login to ESXI server

[root@localhost:~] esxcfg-vswitch --list

Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks

vSwitch0         2816        5           128               1500    vmnic0


  PortGroup Name        VLAN ID  Used Ports  Uplinks

  VM Network            0        1           vmnic0

  Management Network    0        1           vmnic0


[root@localhost:~] esxcfg-vswitch --mtu 9000 vSwitch0

[root@localhost:~]  esxcfg-vswitch --list

Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks

vSwitch0         2816        5           128               9000    vmnic0


  PortGroup Name        VLAN ID  Used Ports  Uplinks

  VM Network            0        1           vmnic0

  Management Network    0        1           vmnic0


[root@localhost:~]


Power ON VM fails " Failed to enumerate all disk”

 

Error:

While power ON VM fails "Failed to enumerate all disk” 


Solution:

Go to VM ->Edit settings->Hard disk

make sure there are no stale hard disks assigned to VM

if that disk is not needed, delete that disk and Power ON

Else make the datastore or disks available/online and then Power ON

Increase SSH Connection Timeout in Linux

 SSH timeouts as a result of inactivity can be quite irritating. Then each time you have to reconnect the session

Steps:

Login with SSH

vi /etc/ssh/sshd_config

change the "ClientAliveInterval" to different value

 Timeout value = ClientAliveInterval * ClientAliveCountMax

  if ClientAliveInterval=1200, Time out =1200*3=3600sec =1hr

service ssh restart


Recent Task is not visible/empty on web client of VCSA 6.7

Error:

Recent Task is not visible/empty on VCSA 6.7


Solution:

Restart the Web client service and then you should be able to see the recent tasks

WinSCP Received too large …. SFTP Packet ….. Cannot initialize SFTP protocol. Is the host running an SFTP server

 Error:

while winSCP to vCenter server using root credentials

Received too large …. SFTP Packet ….. Cannot initialize SFTP protocol. Is the host running an SFTP server


Solution:

In the advanced option:

Specify for SFTP server: shell /usr/libexec/sftp-server




Enabling debug logging on the VMware vSphere Service

  • login to vCenter Server appliance using ssh root


  • Login to Shell prompt and go to the below path


        vCenter Server Appliance 6.7 (HTML) /usr/lib/vmware-vsphere-ui/server/conf/serviceability.xml 

        vCenter Server Appliance 6.7(FLEX) /usr/lib/vmware-vsphere-client/server/configuration 

        Windows vCenter -C:\ProgramData\VMware\vCenterServer\runtime\vsphere-                                ui\server\configuration

  • Open and change the file Serviceability.xml

from

<root level="INFO">

<appender-ref ref="SIFTED_LOG_FILE"></appender-ref>

<appender-ref ref="LOG_FILE"></appender-ref>

</root>

to:

<root level="DEBUG">

<appender-ref ref="SIFTED_LOG_FILE"></appender-ref>

<appender-ref ref="LOG_FILE"></appender-ref>

</root>

  • re-start the vSphere Web Client service.


 -> Flex: service-control --stop vsphere-client

           service-control --start vsphere-client


  -> HTML5: service-control --stop vsphere-ui

                 service-control --start vsphere-ui

How to disable visual console mode for linux

ssh to linux machine

run below command to disable visual console mode:

echo "set mouse-=a" >> ~/.vimrc 

VMware vCenter Server modify the session timeout period

Log in to the vCenter Server Appliance using SSH

Execute shell commands

Modify the following configuration files:

    vi /etc/vmware/vsphere-ui/webclient.properties

Modify the following content:

    session.timeout = *value (default 120, unit minute, for example, modify to 10080, 7 days)

Take effect after restarting the service

    service-control --stop vsphere-ui

    service-control --start vsphere-ui

How to increase ESXi webclient login user application timeout

 To increase the default 15min timeout to 2hr Login to the esxi webclient on the right top corner ->Click the User login tab Select "...