Identify VMDK sharing

Tags

, , , ,

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

Tags

, , , , , ,

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

Tags

, , , , , , , ,

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 use VMDK sharing for Guest OS clustering

Tags

, , , , , ,

Operating system clustering is one of the major and popular high availability mechanism in system infrastructure products. Advantage of the os clustering is it can identify the application level failure.

As a systems administrators most of the time we may need to work with MS windows failover clusters. Most of the file servers and SQL clusters are depend on this failover cluster technology. Most of the situation one of the main requirement is this failover cluster is shared lus/disk. Earlier most of the time we sued to have minimum two physical servers for this cluster operation which is directly connect to SAN device(Shared storage). But to get the benefits of virtualization platform and reduce the cost , now we have to use same cluster features on top of the virtualization platform.

1. In my below example Im using two test virtual machines.

image

2. Now we need to add new scsi controller per this vm


Continue reading

How to increase disk space of vCenter appliance

Tags

, , , ,

vCenter appliance is a vm and most of the time we are running it on the same ESXi cluster.

In some cases we may need to increase the disk capacity of some partition(most of the time its log file path).If our vCenter is running out of disk space, vCenter related services may not tart as expected. To resolve this issue we need to increase the free space capacity of the vCenter appliance.

How to do this

Continue reading