1. Get a putty session to vCenter appliance
2. Run belwo command
3. Select Option 03 and it will generate new password for SSO admin
1. Get a putty session to vCenter appliance
2. Run belwo command
3. Select Option 03 and it will generate new password for SSO admin
$getallvms=(get-vm -ComputerName (Get-ClusterNode))
$result=@()
foreach ($item in $getallvms)
{
$vmname=$item.Name
$vmfullpath=$item.ConfigurationLocation
$vmpathtrim=$vmfullpath.Substring(18)
$pathindex=$vmpathtrim.indexof(“\”)
$csvpathfrom=$vmpathtrim.substring(0,$pathindex)
$properties=@{
Name=$vmname
Path=$csvpathfrom
#Write-Host $item.name
}
$result+=New-Object psobject -Property $properties
}
$result |Sort-Object path
This is a very useful feature with vSphere 7.Earlier version when we need to do modification or apply OS patches to template we need to convert template back to vm and had do that, but with vCenter 7 , we can maintain versioning.
How to do that?
1. First thing these templates should be in content library
2. I have created my template and its in my content library. If I click on template , we can see the version tab
3. Now I’m going to install Windows patches on this template, therefore I select the template and click on Check out VM From This Template on versioning tab. Then I have to give temporary name for this vm
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”
}
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.
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
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
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
We can use ps command to fine running vm’s process
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
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