2,187
edits
m (→ESX Host: Added link) |
m (Anomise) |
||
Line 16: | Line 16: | ||
<source lang="powershell"> | <source lang="powershell"> | ||
[vSphere PowerCLI] E:\> get-vm -name " | [vSphere PowerCLI] E:\> get-vm -name "vserver1" | ||
Name PowerState Num CPUs Memory (MB) | Name PowerState Num CPUs Memory (MB) | ||
---- ---------- -------- ----------- | ---- ---------- -------- ----------- | ||
vserver1 PoweredOn 1 756 | |||
[vSphere PowerCLI] E:\> get-vm -name " | [vSphere PowerCLI] E:\> get-vm -name "vserver1" | Format-List * | ||
PowerState : PoweredOn | PowerState : PoweredOn | ||
Line 34: | Line 34: | ||
HardDisks : {Hard Disk 1} | HardDisks : {Hard Disk 1} | ||
NetworkAdapters : {Network Adapter 1} | NetworkAdapters : {Network Adapter 1} | ||
Host : | Host : esx1.domain.com | ||
HostId : HostSystem-host-301 | HostId : HostSystem-host-301 | ||
HARestartPriority : ClusterRestartPriority | HARestartPriority : ClusterRestartPriority | ||
Line 41: | Line 41: | ||
CustomFields : {} | CustomFields : {} | ||
Id : VirtualMachine-vm-25136 | Id : VirtualMachine-vm-25136 | ||
Name : | Name : vserver1 | ||
[vSphere PowerCLI] E:\> get-vm -name " | [vSphere PowerCLI] E:\> get-vm -name "vserver2" | Format-List * | ||
PowerState : PoweredOff | PowerState : PoweredOff | ||
Line 55: | Line 55: | ||
HardDisks : {Hard Disk 1} | HardDisks : {Hard Disk 1} | ||
NetworkAdapters : {Network Adapter 1, Network Adapter 2, Network Adapter 3} | NetworkAdapters : {Network Adapter 1, Network Adapter 2, Network Adapter 3} | ||
Host : | Host : vserver2.domain.com | ||
HostId : HostSystem-host-662 | HostId : HostSystem-host-662 | ||
HARestartPriority : ClusterRestartPriority | HARestartPriority : ClusterRestartPriority | ||
Line 62: | Line 62: | ||
CustomFields : {} | CustomFields : {} | ||
Id : VirtualMachine-vm-697 | Id : VirtualMachine-vm-697 | ||
Name : | Name : vserver2 | ||
[vSphere PowerCLI] E:\> get-vm -name " | [vSphere PowerCLI] E:\> get-vm -name "vserver2" | ForEach-Object {$_.NetworkAdapters} | ||
MacAddress : 00:50: | MacAddress : 00:50:AB:CD:40:59 | ||
WakeOnLanEnabled : True | WakeOnLanEnabled : True | ||
NetworkName : | NetworkName : Some_Network | ||
Type : Flexible | Type : Flexible | ||
ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl | ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl | ||
Line 75: | Line 75: | ||
Name : Network Adapter 1 | Name : Network Adapter 1 | ||
MacAddress : 00:50: | MacAddress : 00:50:AB:CD:55:40 | ||
WakeOnLanEnabled : True | WakeOnLanEnabled : True | ||
NetworkName : | NetworkName : Another_Network | ||
Type : Flexible | Type : Flexible | ||
ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl | ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl | ||
Line 83: | Line 83: | ||
Name : Network Adapter 2 | Name : Network Adapter 2 | ||
MacAddress : 00:50: | MacAddress : 00:50:AB:CD:56:da | ||
WakeOnLanEnabled : True | WakeOnLanEnabled : True | ||
NetworkName : | NetworkName : Yet_Another_Network | ||
Type : Flexible | Type : Flexible | ||
ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl | ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl | ||
Line 104: | Line 104: | ||
| Get list of VM's, sorted by name | | Get list of VM's, sorted by name | ||
|- | |- | ||
| <code> get-vmguest -VM (get-vm -name " | | <code> get-vmguest -VM (get-vm -name "vserver1") </code> | ||
| Get VM guest info (IP address, OS) | | Get VM guest info (IP address, OS) | ||
|- | |- | ||
| <code> Get-VM " | | <code> Get-VM "vserver1" <nowiki>|</nowiki> %{(Get-View $_.Id).config.uuid} </code> | ||
| Get VM's UUID | | Get VM's UUID | ||
|- | |- | ||
| <code> Shutdown-VMGuest -VM (get-vm -name " | | <code> Shutdown-VMGuest -VM (get-vm -name "vserver1") </code> | ||
| Sends OS shutdown command via VM Tools | | Sends OS shutdown command via VM Tools | ||
|} | |} | ||
Line 119: | Line 119: | ||
! Command !! Description | ! Command !! Description | ||
|- | |- | ||
| <code> get-vmhost -name | | <code> get-vmhost -name esxt1* <nowiki>|</nowiki> %{(Get-View $_.ID).Config.Product} </code> | ||
| Get ESX software version (inc build no) | | Get ESX software version (inc build no) | ||
|- | |- | ||
| <code> Get-ScsiLun -VMHost | | <code> Get-ScsiLun -VMHost esxt1* -LunType disk </code> | ||
| Get ESX disk VML ID's (SAN ID are a part of the VML - useful for identifying LUN's with SAN team). See [[ESX#SAN_LUN_ID|ESX SAN LUN ID]] | | Get ESX disk VML ID's (SAN ID are a part of the VML - useful for identifying LUN's with SAN team). See [[ESX#SAN_LUN_ID|ESX SAN LUN ID]] | ||
|- | |- | ||
| <code> Get-ScsiLun -VMHost | | <code> Get-ScsiLun -VMHost esxt1* -LunType disk <nowiki>|</nowiki> Get-ScsiLunPath </code> | ||
| Get ESX SCSI paths info | | Get ESX SCSI paths info | ||
|} | |} |