Identify VMDK sharing

Some times we may need to find out whether VMDK files are shared with some other vms. Using below script we an easily find that. We just need to give the vm name & it  will check for all the vmdk paths in all the VMS

 

connect-viserver vcentername

$vmname=read-host -Prompt “Enter the VM Name”

 

if (get-vm $vmname -erroraction SilentlyContinue)

{

$vdisk=get-vm $vmname |Get-VMHardDiskDrive

 

 

$allvms=get-vm

 

 

foreach ($allvm in $allvms)

{

if ($allvm.name -ne $vmname)

{

$vmdiskpath=get-vm $allvm |get-harddisk

foreach($disk in $vdisk)

{

if ($vmdiskpath.filename -eq $disk.filename)

{

$msg=”There is a VMDKS sharing with ”

$msg2=$allvm.name

$fullmsg=$msg+$msg2

Write-Host $fullmsg -ForegroundColor DarkGreen

}

}

}

 

}

}

else

{

Write-Host “VM is not available in the vCenter, please check the vm name”

}

Some useful commands for ESXi

We can use df -h command to get the file system usage.

When can we use it-Most of the time I had to use it to check the file system usage on vCenter appliance.

clip_image001

We can use find command to find files in the ESXi or vCenter file system

In my below example I have used it to find all the vmx files

Ex

find / -name *.vmx

clip_image002

We can use cat command to open a file and read the data

In my below example I have opened one of the main log file(vmkernel.log) using cat viewer

clip_image003

We can use grep command to search something inside the file

In my below example I used grep commands to find logged errors in the vmkernel.log

clip_image004

We can use ps command to fine running vm’s process

clip_image005

How to configure iSCSI on vSAN

iSCCI is one of the best option where we can use our vSAN datastore from outside. We an configure our vSAN enabled ESXi hosts as iSCSI target.This help us to configure guest level clustering also.

Login to vCenter

Select the cluster

Select Configure

Click on edit button which in line with vSAN iSCSI Target Server option under vSAN services configuration

    clip_image001

Select vmk0 adapter from Default iSCSI net(Here I have selected my default management network)

I’m using default port(3260)

I’m not using authentication for this lab setup.

Also I have selected default vSAN policy

Continue reading “How to configure iSCSI on vSAN”

Configure backup & restore vCenter 6.7

This is a very useful feature when its working with changes.This is the easiest way to restore our vCenter.

As a destination backup media we need to have http,https,ftp or ftps server. Since I had windows server. Just I add web roles with ffp feature sfrom server manager.

Once I completed that process. I have to do the following configuration on windows server.

Open Internet information service manager

clip_image001 Continue reading “Configure backup & restore vCenter 6.7”

vSphere 6.7 Quick boot

vSphere 6.7 quick boot is new feature which is integrated with update manager. When we performing patching activities with earlier versions of vSphere most of the time we need to reboot the ESX hosts. This is very painful because normayy it will take more than 5 minutes to reboot hardware server. Also sometimes we may need to login using ILO\BMC\IDRAC and check the boot status.

With the version 6.7 we can configure quick boot of ESX hosts.This feature will allow us to reboot only the hypervisor without rebooting ESX’s hardware.

Requirements of this feature-

This feature will not work with all the hardware servers.we can follow below link to get the compatible hardware models.

Dell severs

HP Servers

How to check the compatibility of your server-

We can run

/usr/lib/vmware/loadesx/bin/loadESXCheckCompat.py

And check the compatibility of our server with quick boot.

clip_image001

How to configure this feature

1.login to your vCenter web client

Go to the update manager

Select Manage

Select Settings

Click on Edit

clip_image002

Enable quick boot

clip_image003

Now we are going to remediate one of my esx host.

From the target host we can see qucik boot is enable on this

clip_image004

clip_image005

I used VMware hol HOL-1904-01-SDC-HOL to test this feature

Reference links

https://kb.vmware.com/s/article/52477

Migrate vCenter 5.5 windows implementation to vCener 6.5 appliance

First of all we need to run Migration Assistance tool from vCenter 5.5 server. To do this we can mount the vCenter 6.7 installation media to the computer.

Inside the ISO file we can locate migration assistance in the folder migration-assistant

clip_image001

This exe will prompt for sso admin password Continue reading “Migrate vCenter 5.5 windows implementation to vCener 6.5 appliance”