Posts Tagged ‘Vmware’

Enabled SSH Login on your VCenter Appliance ( this can be done through the GUI or via Direct Console Access )

Run the below commands replacing username and snmp servername

snmp.set --users username/-/-/none
snmp.set --communities liability
snmp.set --v3targets snmpservername@161/username/none/trap

 

This command will show you all the current settings

snmp.get

 

VN:F [1.9.22_1171]
Rating: 8.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

After I found HP’s version of 6.5 wasn’t stable yet : http://pariswells.com/blog/random/hp-vmware-6-5-psod 

We needed to roll back to v6 UP2

You can usually do this if you’ve done an upgrade by Pressing SHIFT and R on the Vmware load screen and roll back to the old version. For some reason the upgrade process had not set a restore point so we will have to do this manually.

I did try the below method of backing up and restore the config files , however this does not work between versions 🙁 

 

vicfg-cfgbackup.pl --server ESXi_host_IP_address -s backup.tgz
 
vicfg-cfgbackup.pl --server=ESXi_host_IP_address --username=root -l backup.tgz
 
vicfg-cfgbackup.pl --server=ESXi_host_IP_address --username=root -r

So we will have to do this manually

Settings to copy down before reinstall.

  1. IP/Subnet/Gateway and DNS of Server
  2. All VSwitch Configurations ( Names , Vlan ID’s ) as well as VKernel IP’s
  3. Make sure if your using NFS You get the paths for these , also check the VSwitch Active Active Settings ( E.g. IP Hash ) 
  4. Scratch Disk Locations ( Click the Configuration tab, then click Advanced Settings under Software. Ensure that Syslog.global.logDir  )
  5. NTP Settings

Reinstall server from scratch and reenter manually

 

VN:F [1.9.22_1171]
Rating: 4.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

ESX Version 5

You need to use the CLI to edtit this per below : 

PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> get-vmho

stsnmp | set-vmhostsnmp -enable:$true -readonlycommunity @(“%communityname%”) -addtarg

et -targetcommunity ‘%communityname%’ -targethost ip.ip.ip.ip

PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> get-vmho

stsnmp | test-vmhostsnmp

 

ESX version > 5

 

esxcli system snmp set --communities %communityname%
 
esxcli system snmp --targets ip.ip.ip.ip@162/%communityname%
 
esxcli system snmp set --enable true
 
esxcli system snmp test
 
/etc/init.d/snmpd restart

 

 

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

 

Use this command on the host to check for Power-On Reset Errors

grep vob.scsi.scsi.scsipath.por /var/log/vobd.log

e.g.

Note – ESXi uses UTC for its timezone so minus 5 hours to match EST

These should corrolate with Event log

Source multiple Errors/ Disk and LSI_SAS

“need to be taken offline to perform a Full Chkdsk”

Resolution

Migrate machine to new host to still see it happens and update all firmware and Vmware version before Vmware Support tell you to! 

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

 

rdm_basic1It might be worth checking if these still need to be RDM’s. This was previously used for older versions of VMDK’s could only use 2TB , now with esx 5.5 and Virtual Machine hardware 10 this is upped to 62TB

Changed Pysical RDM to Virtaul RDM to VMDK’s

Use the webclient for this

1) Shutdown the server
2) Upgrade the Virtual Hardware to 10
3) Remove the Physical RDM Lun
4) Re-Add the Lun as Virtual
5) Power on server
6) Storage VMotion to New SAN

 

FYI Virtual RDM’s cannot be resized without shutting down the machine unlike Physical 

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

vmware_view_pilot-5132020[1]

  1. Login to the host where the virtual machine lies and try and do a snapshot via here instead of VCentre
  2. If Take Snapshot is greyed out on the host , then check the settings of the device for :
  • Does it have an PCI Devices cards mapped to it? E.g. for Use of Tape Drives. If so these will need to be removed as Vmware doesn’t support snapshotting these.
  • Does it have any physical mapped Drives to it instead of virtual , again is not supported for snapshotting
    1. Try shutting down the VM to see if you can snapshot it shutdown insteaf of powered off
  1. Restart the Management Agents on the hosts
VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

 

Run Vmware Powercli

Run 

Connect-ViServer %name of server%

Run the output of below to a text file

E.g. .\Get-PendingUpdate.ps1 | Output-File file.txt

 

Function Get-PendingUpdate { 
<# 
.SYNOPSIS 
Retrieves the updates waiting to be installed from WSUS 
.DESCRIPTION 
Retrieves the updates waiting to be installed from WSUS 
.PARAMETER Computer 
Computer or computers to find updates for. 
.EXAMPLE 
Get-PendingUpdates 
 
Description 
----------- 
Retrieves the updates that are available to install on the local system 
.NOTES 
Author: Boe Prox 
Date Created: 05Mar2011 
#> 
 
#Requires -version 2.0 
[CmdletBinding( 
DefaultParameterSetName = 'computer' 
)] 
param( 
[Parameter( 
Mandatory = $False, 
ParameterSetName = '', 
ValueFromPipeline = $True)] 
[string[]]$Computer 
) 
Begin { 
$scriptdir = { Split-Path $MyInvocation.ScriptName –Parent } 
Write-Verbose "Location of function is: $(&$scriptdir)" 
#Create container for Report 
Write-Verbose "Creating report collection" 
$report = @() 
} 
Process { 
ForEach ($c in $Computer) { 
Write-Verbose "Computer: $($c)" 
If (Test-Connection -ComputerName $c -Count 1 -Quiet) { 
Try { 
#Create Session COM object 
Write-Verbose "Creating COM object for WSUS Session" 
$updatesession = [activator]::CreateInstance([type]::GetTypeFromProgID("Microsoft.Update.Session",$c)) 
} 
Catch { 
Write-Warning "$($Error[0])" 
Break 
} 
 
#Configure Session COM Object 
Write-Verbose "Creating COM object for WSUS update Search" 
$updatesearcher = $updatesession.CreateUpdateSearcher() 
 
#Configure Searcher object to look for Updates awaiting installation 
Write-Verbose "Searching for WSUS updates on client" 
$searchresult = $updatesearcher.Search("IsInstalled=0") 
 
#Verify if Updates need installed 
Write-Verbose "Verifing that updates are available to install" 
If ($searchresult.Updates.Count -gt 0) { 
#Updates are waiting to be installed 
Write-Verbose "Found $($searchresult.Updates.Count) update\s!" 
#Cache the count to make the For loop run faster 
$count = $searchresult.Updates.Count 
 
#Begin iterating through Updates available for installation 
Write-Verbose "Iterating through list of updates" 
For ($i=0; $i -lt $Count; $i++) { 
#Create object holding update 
$update = $searchresult.Updates.Item($i) 
 
#Verify that update has been downloaded 
If ($update.IsDownLoaded -eq "True") { 
$temp = "" | Select Computer, Title, KB,IsDownloaded 
$temp.Computer = $c 
$temp.Title = ($update.Title -split('\('))[0] 
$temp.KB = (($update.title -split('\('))[1] -split('\)'))[0] 
$temp.IsDownloaded = "True" 
$report += $temp 
} 
Else { 
$temp = "" | Select Computer, Title, KB,IsDownloaded 
$temp.Computer = $c 
$temp.Title = ($update.Title -split('\('))[0] 
$temp.KB = (($update.title -split('\('))[1] -split('\)'))[0] 
$temp.IsDownloaded = "False" 
$report += $temp 
} 
} 
 
} 
Else { 
#Nothing to install at this time 
Write-Verbose "No updates to install." 
 
#Create Temp collection for report 
$temp = "" | Select Computer, Title, KB,IsDownloaded 
$temp.Computer = $c 
$temp.Title = "NA" 
$temp.KB = "NA" 
$temp.IsDownloaded = "NA" 
$report += $temp 
} 
} 
Else { 
#Nothing to install at this time 
Write-Warning "$($c): Offline" 
 
#Create Temp collection for report 
$temp = "" | Select Computer, Title, KB,IsDownloaded 
$temp.Computer = $c 
$temp.Title = "NA" 
$temp.KB = "NA" 
$temp.IsDownloaded = "NA" 
$report += $temp 
} 
} 
} 
End { 
Write-Output $report 
} 
}
 
 
$GetVM = Get-VM | 
Where {$_.Guest -match 'windows'} | 
Where {$_.PowerState -eq 'PoweredOn'}
 
Foreach ($vm in $GetVM)
{
$vm.Name
Get-PendingUpdate -Computer $vm.Guest.IPAddress[0]
}

 

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

When trying to join a vcenter to domain I was given the following error in the GUI

“The format of the specified computer name is invalid”

Turns out you can join the computer using a CLI , 

Putty into the VCenter and run

shell.set --enabled true

go to

/opt/likewise/bin/domainjoin-cli join domain.com Domain_Administrator Password

I was then showed this : 

the hostname may not be ‘linux’ or ‘localhost’

Turn out the Vcenter DNS had been set to localhost.localdom ( due to it being added using an IP ) which it didn’t like. Changing the host name to the correct one fixed this

 

VN:F [1.9.22_1171]
Rating: 9.8/10 (6 votes cast)
VN:F [1.9.22_1171]
Rating: +2 (from 2 votes)

Recently after rebooting a VMWare server , the VCenter Server service would not start  

The description for Event ID 1000 from source VMware VirtualCenter Server cannot 

C:\ProgramData\VMware\VMware Virtual Center\Logs. Look at the vpxd.log

<YYYY-MM-DD>T<TIME> 02128 error ‘App’] [VpxdReverseProxy] Failed to create http proxy: An attempt was made to access a socket in a way forbidden by its access permissions.

Checked NetStat and something was running on port 80. Looks like IIS had been installed with default settings which puts default site on port 80. Changed this to another port , reboot IIS and this fixed the issue

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

vmware_view_pilot-5132020[1]This will only work once a host has been added to Vcenter.

Use Vmware CLI to run this with the variables in Square Brackets edited out

This will change from Multipath to Round Robin

Connect-VIServer [VCENTER-SERVER-ADDRESS]
 
$hostview = Get-View -Viewtype HostSystem  –filter @{“Name”=[Fully qualified name of server]}
$storageSystem = Get-View $hostview.ConfigManager.StorageSystem 
$policy = new-object VMware.Vim.HostMultipathInfoLogicalUnitPolicy
#$policy.policy = "VMW_PSP_MRU" 
$policy.policy = "VMW_PSP_RR"
$storageSystem.StorageDeviceInfo.MultipathInfo.lun | foreach { $storageSystem.SetMultipathLunPolicy($_.ID, $policy) }
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)