vsphere - msmhec.plmsmhec.pl/vmw/documents/s_tasks.pdf · serialnum...
TRANSCRIPT
vSphere
4.0
4.1
Simple Tasks
Scripted Installation (script file on USB drive) ............................................................................. 1
Enable local console and SSH access ................................................................................................. 8
console ................................................................................................................................................ 8
vShere Client...................................................................................................................................... 10
New Datacenter ....................................................................................................................................... 12
vSphereClient .................................................................................................................................... 12
PowerCLI ............................................................................................................................................ 12
SDK..................................................................................................................................................... 13
Rename Datacenter ................................................................................................................................. 14
vSphere Client ................................................................................................................................... 14
PowerCLI ............................................................................................................................................ 14
SDK..................................................................................................................................................... 14
Remove Datacenter ................................................................................................................................. 16
vSphere Client ................................................................................................................................... 16
PowerCLI ............................................................................................................................................ 16
SDK..................................................................................................................................................... 16
Add host to vCenter ............................................................................................................................... 17
vSphere Client ................................................................................................................................... 17
PowerCLI ............................................................................................................................................ 20
Enter Maintenance Mode ...................................................................................................................... 21
vSphere Client ................................................................................................................................... 21
PowerCLI ............................................................................................................................................ 21
SDK..................................................................................................................................................... 22
console .............................................................................................................................................. 22
Exit Maintenance Mode ........................................................................................................................ 23
vSphere Client ................................................................................................................................... 23
PowerCLI ............................................................................................................................................ 23
SDK..................................................................................................................................................... 24
console .............................................................................................................................................. 24
Add NFS Datastore ............................................................................................................................... 25
vSphere Client ................................................................................................................................... 25
PowerCLI ............................................................................................................................................ 26
console .............................................................................................................................................. 26
Configure DNS for ESXi ...................................................................................................................... 27
vSphere Client ................................................................................................................................... 27
PowerCLI ............................................................................................................................................ 27
console .............................................................................................................................................. 27
Create vNetwork Distributed Switch .............................................................................................. 28
vSphere Client ................................................................................................................................... 28
Add Port Group to vNetwork Distributed Switch ........................................................................ 31
vSphere Client ................................................................................................................................... 31
Add Hosts to vNetwork Distributed Switch ................................................................................. 33
vSphere Client ................................................................................................................................... 33
Create Virtual Machine ......................................................................................................................... 36
PowerCLI ............................................................................................................................................ 36
Migrate Virtual Machine Networking to Distributed Switch ................................................... 37
vSphere Client ................................................................................................................................... 37
PowerCLI ............................................................................................................................................ 39
Create Resource Pool ............................................................................................................................. 40
vSphere Client ................................................................................................................................... 40
PowerCLI ............................................................................................................................................ 41
SDK..................................................................................................................................................... 41
Create Cluster ......................................................................................................................................... 43
vSphere Client ................................................................................................................................... 43
PowerCLI ............................................................................................................................................ 45
SDK..................................................................................................................................................... 45
Add host to cluster ................................................................................................................................ 47
PowerCLI ............................................................................................................................................ 47
Turn On HA .............................................................................................................................................. 48
vSphere Client ................................................................................................................................... 48
PowerCLI ............................................................................................................................................ 49
Turn On DRS ............................................................................................................................................ 50
vSphere Client ................................................................................................................................... 50
PowerCLI ............................................................................................................................................ 51
View vNetwork Distributed Switch Info ........................................................................................ 52
console .............................................................................................................................................. 52
View Storage Info .................................................................................................................................. 55
console .............................................................................................................................................. 55
Add Software iSCSI Datastore ........................................................................................................ 63
vSphere Client ................................................................................................................................... 63
PowerCLI ............................................................................................................................................ 68
Software iSCSI CHAP Authentication ............................................................................................ 69
vSphere Client ................................................................................................................................... 69
Software iSCSI CHAP Mutual Authentication ............................................................................. 70
vSphere Client ................................................................................................................................... 70
Add Previously Unmounted VMFS Datastore ................................................................................. 71
vSphere Client ................................................................................................................................... 71
Configuring multiple paths for iSCSI software initiator .......................................................... 74
VMFS Volume Grow ................................................................................................................................ 76
vSphere Client ................................................................................................................................... 76
VMFS Add Extent ................................................................................................................................... 81
vSphere Client ................................................................................................................................... 81
VMFS Resignaturing .............................................................................................................................. 86
vSphere Client ................................................................................................................................... 86
vMA 4.1 in Workstation ......................................................................................................................... 91
vMA 4.1 Configure vi-fastpass ........................................................................................................... 92
vMA 4.1 vilogger..................................................................................................................................... 93
Configure ESXi syslog File Location ................................................................................................. 98
vSphere Client ................................................................................................................................... 98
SDK..................................................................................................................................................... 98
PowerCLI ............................................................................................................................................ 99
Start vSphere Client in other language ........................................................................................ 100
Private VLANs ........................................................................................................................................ 101
vSphere Client ................................................................................................................................. 101
vNetwork Distributed Switch Override Portgroup Policy on Port ........................................ 109
vSphere Client ................................................................................................................................. 109
vNetwork Distributed Switch Port Blocking................................................................................. 112
vSphere Client ................................................................................................................................. 112
vNetwork Distributed Switch - Port Binding - Static ............................................................... 114
vSphere Client ................................................................................................................................. 114
vNetwork Distributed Switch - Port Binding - Dynamic ........................................................... 116
vSphere Client ................................................................................................................................. 116
vNetwork Distributed Switch - Network Migration .................................................................. 121
Create Customization Specification ............................................................................................... 135
vSphere Client ................................................................................................................................. 135
PowerCLI .......................................................................................................................................... 143
Deploy Virtual Machine from Template Using OS Customization ......................................... 145
vSphere Client ................................................................................................................................. 145
PowerCLI .......................................................................................................................................... 148
Bibliography ............................................................................................................................................ 149
1
Scripted Installation (script file on USB drive)
Press TAB key to show the boot options
Looking for USB drive, which is not connected yet...
2
3
vmaccepteula
serialnum --esx=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
rootpw XXXXXXXXXXXXX
autopart --firstdisk --overwritevmfs
install cdrom
network --addvmportgroup=false --device=vmnic0 --bootproto=static --ip=192.168.9.201 --gateway=192.168.9.9 --netmask=255.255.255.0 --hostname=ESXi-21.home.hc
%firstboot --unsupported --interpreter=busybox
esxcfg-vswitch --unlink vmnic0 vSwitch0
esxcfg-vmknic --del 'Management Network'
esxcfg-vswitch --delete vSwitch0
esxcfg-vswitch --add vSS-Management
esxcfg-vswitch --link vmnic0 vSS-Management
esxcfg-vswitch --link vmnic3 vSS-Management
esxcfg-vswitch --add-pg Management vSS-Management
esxcfg-vmknic --add --ip 192.168.9.201 --netmask 255.255.255.0 --portgroup Management
esxcfg-vswitch --add-pg VM-0 vSS-Management
esxcfg-vswitch --add vSS-SWiSCSI-1
4
esxcfg-vswitch --link vmnic1 vSS-SWiSCSI-1
esxcfg-vswitch --add-pg VMk-SWiSCSI-PG-1 vSS-SWiSCSI-1
esxcfg-vswitch --add-pg VM-1 vSS-SWiSCSI-1
esxcfg-vmknic --add --ip 192.168.9.202 --netmask 255.255.255.0 --portgroup VMk-SWiSCSI-PG-1
esxcfg-vswitch --add vSS-SWiSCSI-2
esxcfg-vswitch --link vmnic2 vSS-SWiSCSI-2
esxcfg-vswitch --add-pg VMk-SWiSCSI-PG-2 vSS-SWiSCSI-2
esxcfg-vswitch --add-pg VM-2 vSS-SWiSCSI-2
esxcfg-vmknic --add --ip 192.168.9.203 --netmask 255.255.255.0 --portgroup VMk-SWiSCSI-PG-2
esxcfg-swiscsi --enable
VMHBA=$(/usr/sbin/esxcfg-scsidevs -a |grep "iSCSI Software Adapter" | awk '{print $1}')
esxcli swiscsi nic add -n vmk1 -d $VMHBA
esxcli swiscsi nic add -n vmk2 -d $VMHBA
vmkiscsi-tool -D -a 192.168.9.11 $VMHBA
esxcfg-swiscsi -s
esxcfg-nas --add NFS --host 192.168.9.222 --share /media/dwl/public/NFS
esxcfg-nas --add ISO --host 192.168.9.222 --share /media/dwl/public/ISO_Library
5
6
7
8
Enable local console and SSH access
console
9
10
vShere Client
11
12
New Datacenter
vSphereClient
PowerCLI
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $rootfolder=Get-Folder -NoRecursion
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-Datacenter -Location $rootfolder -Name DC-2
Name Id
---- --
DC-2 Datacenter-datacenter-7
13
SDK [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $rootfolder=Get-Folder -NoRecursion
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $rootfolderview=Get-View $rootfolder.Id
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $rootfolderview.CreateDatacenter('DC-3')
Type Value
---- -----
Datacenter datacenter-12
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-Datacenter
Name Id
---- --
DC-2 Datacenter-datacenter-7
DC-3 Datacenter-datacenter-12
DC Datacenter-datacenter-2
14
Rename Datacenter
vSphere Client
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-Datacenter DC| Set-Datacenter -Name New
Name Id
---- --
New Datacenter-datacenter-2
SDK [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $datacenterview=Get-View -id (Get-Datacenter New).id
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $datacenterview.Rename_Task('renamed')
Type Value
---- -----
Task task-16
15
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-Datacenter
Name Id
---- --
DC-2 Datacenter-datacenter-7
DC-3 Datacenter-datacenter-12
renamed Datacenter-datacenter-2
16
Remove Datacenter
vSphere Client
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Remove-Datacenter DC-2
Confirm
Are you sure you want to perform this action?
Performing operation "Remove-Datacenter" on Target "Datacenter 'DC-2'".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI>
SDK [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $datacenterview=Get-View -id (Get-Datacenter renamed).id
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $datacenterview.Destroy_Task()
Type Value
---- -----
Task task-19
17
Add host to vCenter
vSphere Client
18
19
20
PowerCLI
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Add-VMHost -Name ESXi-22 -Location (Get-Datacenter DC) -Credential $cred -Force
21
Enter Maintenance Mode
vSphere Client
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-VMHost ESXi-
21.home.hc | Set-VMHost -State Maintenance
Name State PowerState Id CpuUsage CpuTotal Memory Memory
Mhz Mhz UsageMB TotalMB
---- ----- ---------- -- -------- -------- ------- -------
esxi-21.home.hc Mainten... PoweredOn ...t-24 37 2186 845 2047
22
SDK [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $hostview=Get-
View -id (Get-VMHost ESXi-21.home.hc).id
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $timeout=0
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI>
$evacuatePoweredOffVms=$false
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI>
$hostview.EnterMaintenanceMode_Task($timeout, $evacuatePoweredOffVms)
Type Value
---- -----
Task task-29
console /bin # vim-cmd hostsvc/maintenance_mode_enter
'vim.Task:haTask-ha-host-vim.HostSystem.enterMaintenanceMode-310'
/bin #
23
Exit Maintenance Mode
vSphere Client
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-VMHost ESXi-
22.home.hc | Set-VMHost -State Connected
Name State PowerState Id CpuUsage CpuTotal Memory Memory
Mhz Mhz UsageMB TotalMB
---- ----- ---------- -- -------- -------- ------- -------
esxi-22.home.hc Connected PoweredOn ...t-34 39 3001 844 2047
24
SDK [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $hostview=Get-
View -id (Get-VMHost ESXi-21.home.hc).id
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $timeout=0
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI>
$hostview.ExitMaintenanceMode_Task($timeout)
Type Value
---- -----
Task task-36
console /bin # vim-cmd hostsvc/maintenance_mode_exit
'vim.Task:haTask-ha-host-vim.HostSystem.exitMaintenanceMode-319'
/bin #
25
Add NFS Datastore
vSphere Client
26
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-Datastore -
Nfs -VMHost ESXi-21.home.hc -Name NFS -NfsHost 192.168.9.222 -Path "/media/dwl/public/NFS"
Name FreeSpaceMB CapacityMB
---- ----------- ----------
NFS 50773 238471
console ~ # esxcfg-nas --add NFS --host 192.168.9.222 --share /media/dwl/public/NFS
Connecting to NAS volume: NFS
NFS created and connected.
27
Configure DNS for ESXi
vSphere Client
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-
VMHostNetwork 192.168.9.221|Set-VMHostNetwork -DnsAddress 192.168.9.231, 192.168.9.222 -
SearchDomain home.hc
HostName DomainName DnsFro ConsoleGateway ConsoleGatewayD DnsAddress
mDhcp evice
-------- ---------- ------ -------------- --------------- ----------
ESXi-23 home.hc False {192.168.9.231, 1...
console ~ # vim-cmd /hostsvc/net/dns_set --dhcp=false --ip-addresses=192.168.9.231,192.168.9.222 --searchdomain=home.hc
Sending this over...
(vim.host.DnsConfig) {
dynamicType = <unset>,
dhcp = false,
virtualNicDevice = <unset>,
hostName = "ESXi-21",
domainName = "home.hc",
address = (string) [
"192.168.9.231",
"192.168.9.222"
],
searchDomain = (string) [
"home.hc"
],
}
28
Create vNetwork Distributed Switch
vSphere Client
29
30
31
Add Port Group to vNetwork Distributed Switch
vSphere Client
32
33
Add Hosts to vNetwork Distributed Switch
vSphere Client
34
35
36
Create Virtual Machine
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-VM -VMHost (Get-VMHost 192.168.9.201) -Name VM1 -Datastore (Get-Datastore -VMHost 192.168.9.201 -Name NFS) -DiskMB 4096 -MemoryMB 256 -DiskStorageFormat thin
Name PowerState Num CPUs Memory (MB)
---- ---------- -------- -----------
VM1 PoweredOff 1 256
37
Migrate Virtual Machine Networking to Distributed Switch
vSphere Client
38
39
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> get-vm vm1|Get-NetworkAdapter|Set-NetworkAdapter -NetworkName dvPG-1
Confirm
Are you sure you want to perform this action?
Performing operation "Setting NetworkName: dvPG-1" on Target "Network adapter 1".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Name Type NetworkName MacAddress WakeOnLanEnabled
---- ---- ----------- ---------- ---------
Network adapter 1 Flexible dvPG-1 00:50:56:9b:00:00 False
40
Create Resource Pool
vSphere Client
41
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-VMHost esxi-21.home.hc|New-ResourcePool -Name RP-1
Name Id
---- --
RP-1 ResourcePool-resgroup-48
SDK $name = "RP-2"
$spec = New-Object VMware.Vim.ResourceConfigSpec
$spec.cpuAllocation = New-Object VMware.Vim.ResourceAllocationInfo
$spec.cpuAllocation.reservation = 0
$spec.cpuAllocation.expandableReservation = $true
$spec.cpuAllocation.limit = -1
$spec.cpuAllocation.shares = New-Object VMware.Vim.SharesInfo
$spec.cpuAllocation.shares.shares = 4000
$spec.cpuAllocation.shares.level = "normal"
42
$spec.memoryAllocation = New-Object VMware.Vim.ResourceAllocationInfo
$spec.memoryAllocation.reservation = 0
$spec.memoryAllocation.expandableReservation = $true
$spec.memoryAllocation.limit = -1
$spec.memoryAllocation.shares = New-Object VMware.Vim.SharesInfo
$spec.memoryAllocation.shares.shares = 163840
$spec.memoryAllocation.shares.level = "normal"
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $resparent=Get-View -Id (Get-VMHost esxi-22.home.hc|Get-ResourcePool).id
$resparent.CreateResourcePool($name, $spec)
43
Create Cluster
vSphere Client
44
45
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-Cluster -Name CL-1 -Location (Get-Datacenter DC)
Name HAEnabled HAFailover DrsEnabled DrsAutomationLevel
---- --------- ---------- ---------- ------------------
CL-1 False 1 False FullyAutomated
SDK $name = "CL-2" $spec = New-Object VMware.Vim.ClusterConfigSpecEx $spec.vmSwapPlacement = "vmDirectory" $spec.dasConfig = New-Object VMware.Vim.ClusterDasConfigInfo $spec.dasConfig.enabled = $false $spec.dasConfig.vmMonitoring = "vmMonitoringDisabled" $spec.dasConfig.hostMonitoring = "enabled" $spec.dasConfig.admissionControlPolicy = New-Object VMware.Vim.ClusterFailoverLevelAdmissionControlPolicy $spec.dasConfig.admissionControlPolicy.failoverLevel = 1 $spec.dasConfig.admissionControlEnabled = $true $spec.dasConfig.defaultVmSettings = New-Object VMware.Vim.ClusterDasVmSettings $spec.dasConfig.defaultVmSettings.restartPriority = "medium" $spec.dasConfig.defaultVmSettings.isolationResponse = "shutdown" $spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings = New-Object VMware.Vim.ClusterVmToolsMonitoringSettings $spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.enabled = $true
46
$spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.failureInterval = 30 $spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.minUpTime = 120 $spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.maxFailures = 3 $spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.maxFailureWindow = 3600 $spec.drsConfig = New-Object VMware.Vim.ClusterDrsConfigInfo $spec.drsConfig.defaultVmBehavior = "fullyAutomated" $spec.drsConfig.vmotionRate = 3 $spec.dpmConfig = New-Object VMware.Vim.ClusterDpmConfigInfo $spec.dpmConfig.enabled = $false $spec.dpmConfig.hostPowerActionRate = 3 [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> get-folder Name Id
---- --
Datacenters Folder-group-d1
vm Folder-group-v18
host Folder-group-h19
datastore Folder-group-s20
Discovered virtual machine Folder-group-v46
$parent= Get-View -Id 'Folder-group-h19' $parent.CreateClusterEx($name, $spec)
47
Add host to cluster
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Move-VMHost -VMHost esxi-22.home.hc -Destination (Get-Cluster CL-1)
Name State PowerState Id CpuUsage CpuTotal Memory Memory
Mhz Mhz UsageMB TotalMB
---- ----- ---------- -- -------- -------- ------- -------
esxi-22.home.hc Connected PoweredOn ...t-34 37 3001 846 2047
48
Turn On HA
vSphere Client
49
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-Cluster CL-2|Set-Cluster -HAEnabled:$true
Configure cluster. - Params: HAEnabled: True,
HAEnabled: True,
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Name HAEnabled HAFailover DrsEnabled DrsAutomationLevel
Level
---- --------- ---------- ---------- ------------------
CL-2 True 1 False FullyAutomated
50
Turn On DRS
vSphere Client
51
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-Cluster CL-2|Set-Cluster -DRSEnable:$true
Configure cluster. - Params: DrsEnabled: True,
DrsEnabled: True,
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Name HAEnabled HAFailover DrsEnabled DrsAutomationLevel
Level
---- --------- ---------- ---------- ------------------
CL-2 True 1 True FullyAutomated
52
View vNetwork Distributed Switch Info
console ~ # /usr/lib/vmware/bin/net-dvs
switch 34 de 1b 50 f8 31 dd 02-05 61 15 8a 96 79 7c 9b (etherswitch) max ports: 256 global properties: com.vmware.common.alias = dvS-1 com.vmware.etherswitch.mtu = 1500 com.vmware.etherswitch.cdp = CDP, listen com.vmware.common.uplinkPorts: dvUplink1, dvUplink2 com.vmware.common.respools.sched: inactive host properties: com.vmware.common.host.portset = DvsPortset-0 com.vmware.host.volatile.status = green com.vmware.common.host.uplinkPorts: 140, 141 port 140: com.vmware.common.port.alias = dvUplink1 com.vmware.common.port.connectid = 1849616204 com.vmware.common.port.portgroupid = dvportgroup-44 com.vmware.common.port.block = false com.vmware.etherswitch.port.teaming: load balancing = source virtual port id link selection = link state up; link speed>=10Mbps; link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure; active = standby = com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames com.vmware.etherswitch.port.vlan = Guest VLAN tagging ranges = 0-4094 com.vmware.etherswitch.port.txUplink = normal com.vmware.common.port.volatile.vlan = VLAN 0 ranges = 0-4094 com.vmware.common.port.statistics: pktsInUnicast = 8115 bytesInUnicast = 2157045 pktsInMulticast = 0 bytesInMulticast = 0 pktsInBroadcast = 1723 bytesInBroadcast = 133580 pktsOutUnicast = 0 bytesOutUnicast = 0 pktsOutMulticast = 0 bytesOutMulticast = 0 pktsOutBroadcast = 77 bytesOutBroadcast = 6740 pktsInDropped = 0 pktsOutDropped = 0 pktsInException = 0
53
pktsOutException = 0 com.vmware.common.port.volatile.status = inUse linkUp portID=67108866 noPassthruReason=1 port 141: com.vmware.common.port.alias = dvUplink2 com.vmware.common.port.connectid = 1849616204 com.vmware.common.port.portgroupid = dvportgroup-44 com.vmware.common.port.block = false com.vmware.etherswitch.port.teaming: load balancing = source virtual port id link selection = link state up; link speed>=10Mbps; link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure; active = standby = com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames com.vmware.etherswitch.port.vlan = Guest VLAN tagging ranges = 0-4094 com.vmware.etherswitch.port.txUplink = normal com.vmware.common.port.volatile.vlan = VLAN 0 ranges = 0-4094 com.vmware.common.port.statistics: pktsInUnicast = 8114 bytesInUnicast = 2156783 pktsInMulticast = 0 bytesInMulticast = 0 pktsInBroadcast = 1755 bytesInBroadcast = 135500 pktsOutUnicast = 0 bytesOutUnicast = 0 pktsOutMulticast = 0 bytesOutMulticast = 0 pktsOutBroadcast = 0 bytesOutBroadcast = 0 pktsInDropped = 0 pktsOutDropped = 0 pktsInException = 45 pktsOutException = 0 com.vmware.common.port.volatile.status = inUse linkUp portID=67108867 noPassthruReason=1 port 10: com.vmware.common.port.alias = com.vmware.common.port.connectid = 1939069329 com.vmware.common.port.portgroupid = dvportgroup-45 com.vmware.common.port.block = false com.vmware.etherswitch.port.teaming: load balancing = source virtual port id link selection = link state up; link speed>=10Mbps; link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure; active = dvUplink1; dvUplink2; standby = com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames com.vmware.etherswitch.port.vlan = No VLAN
54
com.vmware.etherswitch.port.txUplink = normal com.vmware.common.port.volatile.persist = /vmfs/volumes/1c445c7d-fd56af7a/.dvsData/34 de 1b 50 f8 31 dd 02-05 61 15 8a 96 79 7c 9b/10 com.vmware.common.port.volatile.vlan = VLAN 0 com.vmware.common.port.statistics: pktsInUnicast = 0 bytesInUnicast = 0 pktsInMulticast = 0 bytesInMulticast = 0 pktsInBroadcast = 77 bytesInBroadcast = 6740 pktsOutUnicast = 6 bytesOutUnicast = 360 pktsOutMulticast = 0 bytesOutMulticast = 0 pktsOutBroadcast = 105 bytesOutBroadcast = 8880 pktsInDropped = 0 pktsOutDropped = 0 pktsInException = 0 pktsOutException = 77 com.vmware.common.port.volatile.status = inUse linkUp portID=67108868 noPassthruReason=1
55
View Storage Info
console ~ # vsish /> cd storage /storage/> ls bufferCache/ scsifw/ /storage/> cd /storage/scsifw/ /storage/scsifw/> ls npiv/ claimrulelists/ claimrules/ adapters/ paths/ devices/ deviceUids/ plugins/ logAllPluginStates delete add update claimrule info
/storage/scsifw/> cd claimrules /storage/scsifw/claimrules/> ls 0/ 1/ 2/ 3/ 4/ 101/ 65535/ /storage/scsifw/claimrules/> cd 101 /storage/scsifw/claimrules/101/> ls info /storage/scsifw/claimrules/101/> cat info Claimrule information { plugin:MASK_PATH device Uid: vendor :DELL model :Universal Xport driver: Transport Type:Transport Type: 0 -> unknown adapter: channel:0 target:0 lun:0 Claimrule Type:Claimrule Type: 1 -> Match Vendor and Model }
56
/storage/scsifw/> cd adapters /storage/scsifw/adapters/> ls vmhba0/ vmhba1/ vmhba32/ vmhba33/ /storage/scsifw/adapters/> cd vmhba33 /storage/scsifw/adapters/vmhba33/> ls sas/ fc/ block/ debug/ injectError rescanLink statson stats uid info /storage/scsifw/adapters/vmhba33/> cat info Adapter information { adapter:vmhba33 driver:iscsi_vmk channels:64 PCI bus:0 PCI slot:0 PCI function:0 max SG length:68 PAE capable:1 Underlying transport:Transport Type: 5 -> Iscsi with Vendor Supplied IMA Adapter scan state:0 } /storage/scsifw/adapters/vmhba33/> cat uid iqn.1998-01.com.vmware:esxi-21-30358a96 /storage/scsifw/adapters/vmhba33/> cat stats Statistics { commands:1365 blocksRead:25383 blocksWritten:157 readOps:579 writeOps:157 reserveOps:39 reservationConflicts:0 total cmds split:0 total pae cmds:0 per split-type stats:Split type statistics { align:0 maxxfer:0 pae:0 sgsize:0 forcedCopy:0
57
forcedSplit:0 } qInfo valid?:1 queue:queue info { active cmds total :0 active read cmds :0 active write cmds :0 active other cmds :0 queued cmds total :0 queued read cmds :0 queued write cmds :0 queued other cmds :0 queue depth :1024 max queue depth :1024 } Latency:Latency statistics (us) { issue:17697998 issueReads:13579817 issueWrites:1203058 layer:548 layerReads:233 layerWrites:104 queue:548 queueReads:233 queueWrites:104 total:17710854 totalReads:13586663 totalWrites:1205755 cloneSuccess:0 cloneFailure:0 atsSuccess:0 atsFailure:0 zeroSuccess:0 zeroFailure:0 } Task Mgmt:TaskMgmt statistics { abort:0 virtual lun reset:0 abort task:0 lun reset:0 device reset:0 bus reset:0 } total clone read ops:0 total clone write ops:0 total blocks read for clone:0 total blocks written for clone:0 total clone failures:0 total ATS cmds:0 total ATS failures:0 total zero cmds:0 total zero failures:0 total blocks zeroed:0 }
58
/storage/scsifw/> cd devices /storage/scsifw/devices/> ls mpx.vmhba1:C0:T0:L0/ mpx.vmhba32:C0:T0:L0/ eui.c9782789561a1755/ /storage/scsifw/devices/> cd /storage/scsifw/devices/eui.c9782789561a1755 /storage/scsifw/devices/eui.c9782789561a1755/> ls worlds/ handles/ filters/ paths/ partitions/ uids/ iormInfo iormState maxQueueDepth injectError statson stats inquiryVPD/ inquirySTD info /storage/scsifw/devices/eui.c9782789561a1755/> cat info Device information { owning plugin :NMP state :Device State: 0 -> on device type :Device Type: 0 -> Direct-Access vendor :ROCKET model :IMAGEFILE revision :0001 capacity:info { block size :512 num blocks :251658240 } SCSI version:0x04 DevFS registration type:Device devfs registration type: 1 -> Disk devfs registration is pseudo-device?:0 is device reserved?:0 is device removable?:0 is device local?:0 is LUN queue depth being throttled?:0 device availability:Device availability state: 3 -> redundant availability # pending reservations:0 current open count:0 VAAI clone status:VAAI state: 0 -> unknown VAAI zero status:VAAI state: 0 -> unknown VAAI ATS status:VAAI state: 2 -> unsupported } /storage/scsifw/devices/eui.c9782789561a1755/> cat stats Statistics { commands:931
59
blocksRead:25383 blocksWritten:157 readOps:549 writeOps:157 reserveOps:39 reservationConflicts:0 total cmds split:0 total pae cmds:0 per split-type stats:Split type statistics { align:0 maxxfer:0 pae:0 sgsize:0 forcedCopy:0 forcedSplit:0 } qInfo valid?:1 queue:queue info { active cmds total :0 active read cmds :0 active write cmds :0 active other cmds :0 queued cmds total :0 queued read cmds :0 queued write cmds :0 queued other cmds :0 queue depth :32 max queue depth :128 } Latency:Latency statistics (us) { issue:13646820 issueReads:11388754 issueWrites:1205081 layer:10300 layerReads:5300 layerWrites:2716 queue:3077 queueReads:1712 queueWrites:692 total:13653030 totalReads:11392375 totalWrites:1206303 cloneSuccess:0 cloneFailure:0 atsSuccess:0 atsFailure:0 zeroSuccess:0 zeroFailure:0 } Task Mgmt:TaskMgmt statistics { abort:0 virtual lun reset:0 abort task:0 lun reset:0
60
device reset:0 bus reset:0 } total clone read ops:0 total clone write ops:0 total blocks read for clone:0 total blocks written for clone:0 total clone failures:0 total ATS cmds:0 total ATS failures:0 total zero cmds:0 total zero failures:0 total blocks zeroed:0 } /storage/scsifw/devices/eui.c9782789561a1755/> cd paths /storage/scsifw/devices/eui.c9782789561a1755/paths/> ls vmhba33:C0:T0:L0 vmhba33:C1:T0:L0 /storage/scsifw/devices/eui.c9782789561a1755/partitions/ /storage/scsifw/devices/eui.c9782789561a1755/partitions/> ls 0/ 1/ /storage/scsifw/devices/eui.c9782789561a1755/partitions/> cd 0 /storage/scsifw/devices/eui.c9782789561a1755/partitions/0/> ls stats info /storage/scsifw/devices/eui.c9782789561a1755/partitions/0/> cat info Partition Information { world:0 start sector:0 number of sectors:251658240 size of each sector:512 type:0 } /storage/scsifw/devices/eui.c9782789561a1755/partitions/0/> cd .. /storage/scsifw/devices/eui.c9782789561a1755/partitions/> cd 1 /storage/scsifw/devices/eui.c9782789561a1755/partitions/1/> cat info Partition Information { world:0 start sector:128 number of sectors:251658097 size of each sector:512 type:251 } /storage/scsifw/devices/eui.c9782789561a1755/partitions/1/> cat stats Statistics { commands:650 blocksRead:25249 blocksWritten:157
61
readOps:415 writeOps:157 reserveOps:0 reservationConflicts:0 total cmds split:0 total pae cmds:0 per split-type stats:Split type statistics { align:0 maxxfer:0 pae:0 sgsize:0 forcedCopy:0 forcedSplit:0 } qInfo valid?:0 queue:queue info { active cmds total :0 active read cmds :0 active write cmds :0 active other cmds :0 queued cmds total :0 queued read cmds :0 queued write cmds :0 queued other cmds :0 queue depth :0 max queue depth :0 } Latency:Latency statistics (us) { issue:11983618 issueReads:10464811 issueWrites:1205081 layer:7662 layerReads:4256 layerWrites:2716 queue:2312 queueReads:1398 queueWrites:692 total:11988296 totalReads:10467867 totalWrites:1206303 cloneSuccess:0 cloneFailure:0 atsSuccess:0 atsFailure:0 zeroSuccess:0 zeroFailure:0 } Task Mgmt:TaskMgmt statistics { abort:0 virtual lun reset:0 abort task:0 lun reset:0 device reset:0 bus reset:0
62
} total clone read ops:0 total clone write ops:0 total blocks read for clone:0 total blocks written for clone:0 total clone failures:0 total ATS cmds:0 total ATS failures:0 total zero cmds:0 total zero failures:0 total blocks zeroed:0 } /storage/scsifw/> cd /storage/scsifw/paths/ /storage/scsifw/paths/> ls vmhba32:C0:T0:L0/ vmhba33:C1:T0:L0/ vmhba33:C0:T0:L0/ vmhba1:C0:T0:L0/ /storage/scsifw/paths/> cd /storage/scsifw/paths/vmhba33:C1:T0:L0 /storage/scsifw/paths/vmhba33:C1:T0:L0/> ls transport injectError statson stats state deviceUid uidAttr pathUid info /storage/scsifw/paths/vmhba33:C1:T0:L0/> cat info Path information { plugin:NMP adapter:vmhba33 channel ID:1 target ID:0 lun ID:0 max IO Size:131072 path state:Path State: 0 -> on vendor :ROCKET model :IMAGEFILE }
63
Add Software iSCSI Datastore
vSphere Client
64
65
66
67
68
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-
IScsiHbaTarget -IScsiHba (Get-VMHostHba -Type iscsi) -Address 192.168.9.21
Address Port Type
------- ---- ----
192.168.9.21 3260 Send
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-
VMHostStorage -RescanAllHba
Id SoftwareIScsiEnabled
-- --------------------
HostStorageSystem-storageSy... True
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $lun=Get-ScsiLun -
hba vmhba33
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-Datastore -
Name FUNB -Vmfs -Path $lun.CanonicalName
Name FreeSpaceMB CapacityMB
---- ----------- ----------
FUNB 3539 3840
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-
VMHostStorage -RescanAllHba -RescanVmfs
Id SoftwareIScsiEnabled
-- --------------------
HostStorageSystem-storageSy... True
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-Datastore
Name FreeSpaceMB CapacityMB
---- ----------- ----------
FUNB 3539 3840
69
Software iSCSI CHAP Authentication
vSphere Client
70
Software iSCSI CHAP Mutual Authentication
vSphere Client Incoming and outgoing passwords must be different!
71
Add Previously Unmounted VMFS Datastore
vSphere Client
72
73
74
Configuring multiple paths for iSCSI software initiator
75
76
VMFS Volume Grow
vSphere Client
77
78
79
80
81
VMFS Add Extent
vSphere Client
82
83
84
85
86
VMFS Resignaturing
vSphere Client After a snapshot of existing datastore is presented to ESXi host...
87
88
89
The option Keep the existing signature is available...
90
and the result is
91
vMA 4.1 in Workstation Edit vmx file:
scsi0.virtualDev = "buslogic"
=> scsi0.virtualDev = "lsilogic" guestOS = "ubuntu"
=>guestOS = " rhel5-64"
92
vMA 4.1 Configure vi-fastpass login as: vi-admin
[email protected]'s password:
Welcome to vMA
run 'vma-help' or see http://www.vmware.com/go/vma for more details.
[vi-admin@vMA41 ~]$ sudo vifp addserver esxi-21.home.hc
[email protected]'s password:
[vi-admin@vMA41 ~]$ vifp listservers
esxi-21.home.hc ESXi
[vi-admin@vMA41 ~]$ vifpinit esxi-21.home.hc
vifpinit is deprecated, use vifptarget instead.
Usage: vifptarget <option>
option is one of:
--set | -s <server>
--clear | -c
--display | -d
--help | -h
<server> is a fastpass target added using vifp command
[vi-admin@vMA41 ~]$ vifptarget --display
Error: No fastpass target has been set.
[vi-admin@vMA41 ~]$ vifptarget --set esxi-21.home.hc
[vi-admin@vMA41 ~][esxi-21.home.hc]$ vifptarget --display
esxi-21.home.hc
[vi-admin@vMA41 ~][esxi-21.home.hc]$ vicfg-nics -l
Name PCI Driver Link Speed Duplex MAC Address MTU Description
vmnic0 02:01.0 e1000 Up 1000Mbps Full 00:0c:29:82:9b:75 1500 Intel Corporation PRO/1000 MT Single Port Adapter
vmnic1 02:02.0 e1000 Up 1000Mbps Full 00:0c:29:82:9b:7f 1500 Intel Corporation PRO/1000 MT Single Port Adapter
93
vMA 4.1 vilogger [vi-admin@vMA41 ~]$ vilogger list
Target Server: esxi-21.home.hc
Log State Status CollectionPeriod NumRotation MaxFileSize Location (Seconds) (MegaBytes)
hostd Disabled - - - - -
messages Disabled - - - - -
vpxa Disabled - - - - -
[vi-admin@vMA41 ~]$ cd /
[vi-admin@vMA41 /]$ ls
bin boot dev etc home lib lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var
[vi-admin@vMA41 /]$ cd home
[vi-admin@vMA41 home]$ ls
vi-admin vi-user
[vi-admin@vMA41 home]$ cd vi-admin/
[vi-admin@vMA41 ~]$ ls
[vi-admin@vMA41 ~]$
[vi-admin@vMA41 ~]$ mkdir esxi-21-logs
[vi-admin@vMA41 ~]$ ls
esxi-21-logs
[vi-admin@vMA41 vMA]$ vilogger
Error: Missing command parameter.
Usage: vilogger <command>
command is one of:
enable [--server <SERVER>]
[--logname <LOGNAME>]
[--collectionperiod <PERIOD in seconds: 10 to 3600>]
[--numrotation <ROTATION: 1 to 1024>]
[--maxfilesize <SIZE in MB: 1 to 1024>]
disable [--server <SERVER>]
[--logname <LOGNAME>]
[--force]
list [--server <SERVER>]
[--logname <LOGNAME>]
updatepolicy [--server <SERVER>]
[--logname <LOGNAME>]
94
<logpolicy: at least one of the following must be specified>
[--collectionperiod <PERIOD in seconds: 10 to 3600>]
[--numrotation <ROTATION: 1 to 1024>]
[--maxfilesize <SIZE in MB: 1 to 1024>]
help | --help | -h [<command name>]
[vi-admin@vMA41 vMA]$ vilogger enable --server esxi-21.home.hc --logname messages --
collectionperiod 60 --maxfilesize 10
Target Server: esxi-21.home.hc
messages ... Enabled
[vi-admin@vMA41 vMA]$ vilogger list
Target Server: esxi-21.home.hc
Log State Status CollectionPeriod NumRotation MaxFileSize Location
(Seconds) (MegaBytes)
hostd Disabled - - - - -
messages Enabled Scheduled 60 5 10 /var/log/vmware/esxi-21.home.hc/messages.log
vpxa Disabled - - - - -
[vi-admin@vMA41 vMA]$ vilogger enable --server esxi-21.home.hc --logname hostd --
collectionperiod 60 --maxfilesize 10
Target Server: esxi-21.home.hc
hostd ... Enabled
[vi-admin@vMA41 vMA]$ vilogger enable --server esxi-21.home.hc --logname vpxa --
collectionperiod 60 --maxfilesize 10
Target Server: esxi-21.home.hc
vpxa ... Enabled
[vi-admin@vMA41 vMA]$ vilogger list
Target Server: esxi-21.home.hc
Log State Status CollectionPeriod NumRotation MaxFileSize Location
(Seconds) (MegaBytes)
hostd Enabled Scheduled 60 5 10 /var/log/vmware/esxi-21.home.hc/hostd.log
messages Enabled Collecting 60 5 10 /var/log/vmware/esxi-21.home.hc/messages.log
vpxa Enabled Scheduled 60 5 10 /var/log/vmware/esxi-21.home.hc/vpxa.log
[vi-admin@vMA41 vMA]$ vilogger updatepolicy --server esxi-21.home.hc --logname vpxa --
collectionperiod 180 --maxfilesize 10
Target Server: esxi-21.home.hc
vpxa ... Updated
95
[vi-admin@vMA41 vMA]$ vilogger list
Target Server: esxi-21.home.hc
Log State Status CollectionPeriod NumRotation MaxFileSize Location
(Seconds) (MegaBytes)
hostd Enabled Collecting 60 5 10 /var/log/vmware/esxi-21.home.hc/hostd.log
messages Enabled Collecting 60 5 10 /var/log/vmware/esxi-21.home.hc/messages.log
vpxa Enabled Collecting 180 5 10 /var/log/vmware/esxi-21.home.hc/vpxa.log
[vi-admin@vMA41 vMA]$ sudo nano /etc/vmware/vMA/vMA.conf
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password:
GNU nano 1.3.12 File: /etc/vmware/vMA/vMA.conf Modified
<?xml version="1.0" encoding="UTF-8"?>
<config>
<version>4.1</version>
<vifpdLog>
<level>info</level>
<maxFileSize>5</maxFileSize>
<numRotation>10</numRotation>
<location>/var/log/vmware/vma</location>
</vifpdLog>
<vilogdLog>
<level>info</level>
<maxFileSize>5</maxFileSize>
<numRotation>10</numRotation>
<location>/var/log/vmware/vma</location>
</vilogdLog>
<vMALogCollector>
<collectionPeriod>10</collectionPeriod>
<numRotation>5</numRotation>
<maxFileSize>5</maxFileSize>
<location>/home/vi-admin/esxi-21-logs</location>
</vMALogCollector>
<verifySSLCertificates>false</verifySSLCertificates>
</config>
[vi-admin@vMA41 vMA]$ sudo /sbin/service vmware-vilogd restart
96
Stopping vmware-vilogd: [ OK ]
Starting vmware-vilogd: [ OK ]
[vi-admin@vMA41 ~]$ vilogger list
Target Server: esxi-21.home.hc
Log State Status CollectionPeriod NumRotation MaxFileSize Location(Seconds) (MegaBytes)
hostd Enabled Scheduled 10 5 5 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/hostd.log
messages Enabled Scheduled 10 5 5 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/messages.log
vpxa Enabled Scheduled 10 5 5 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/vpxa.log
[vi-admin@vMA41 /]$ vilogger updatepolicy --logname vpxa --collectionperiod 180 --maxfilesize 5
Target Server: esxi-21.home.hc
vpxa ... Updated
[vi-admin@vMA41 /]$ vilogger updatepolicy --logname messages --collectionperiod 60 --maxfilesize
5
Target Server: esxi-21.home.hc
messages ... Updated
[vi-admin@vMA41 /]$ vilogger updatepolicy --logname hostd --collectionperiod 60 --maxfilesize 5
Target Server: esxi-21.home.hc
hostd ... Updated
[vi-admin@vMA41 /]$ vilogger list
Target Server: esxi-21.home.hc
Log State Status CollectionPeriod NumRotation MaxFileSize Location (Seconds) (MegaBytes)
hostd Enabled Collecting 60 5 5 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/hostd.log
messages Enabled Collecting 60 5 5 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/messages.log
vpxa Enabled Collecting 180 5 5 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/vpxa.log
[vi-admin@vMA41 /]$ cd /home/vi-admin/esxi-21-logs
[vi-admin@vMA41 esxi-21-logs]$ ls
esxi-21.home.hc
[vi-admin@vMA41 esxi-21-logs]$ cd esxi-21.home.hc/
[vi-admin@vMA41 esxi-21.home.hc]$ ls
hostd.log hostd.log.1 messages.log messages.log.1 vpxa.log vpxa.log.1
[vi-admin@vMA41 esxi-21.home.hc]$ vilogger disable
Target Server: esxi-21.home.hc
hostd ... Disabled
messages ... Disabled
vpxa ... Disabled
97
[vi-admin@vMA41 esxi-21.home.hc]$ vilogger list
Target Server: esxi-21.home.hc
Log State Status CollectionPeriod NumRotation MaxFileSize Location (Seconds) (MegaBytes)
hostd Disabled - - - - -
messages Disabled - - - - -
vpxa Disabled - - - - -
[vi-admin@vMA41 esxi-21.home.hc]$ vilogger enable
Target Server: esxi-21.home.hc
hostd ... Enabled
messages ... Enabled
vpxa ... Enabled
[vi-admin@vMA41 esxi-21.home.hc]$ vilogger list
Target Server: esxi-21.home.hc
Log State Status CollectionPeriod NumRotation MaxFileSize Location (Seconds) (MegaBytes)
hostd Enabled Scheduled 60 10 10 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/hostd.log
messages Enabled Scheduled 60 10 10 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/messages.log
vpxa Enabled Scheduled 60 10 10 /home/vi-admin/esxi-21-logs/esxi-21.home.hc/vpxa.log
98
Configure ESXi syslog File Location
vSphere Client
SDK $changedValue = New-Object VMware.Vim.OptionValue[] (1)
$changedValue[0] = New-Object VMware.Vim.OptionValue
$changedValue[0].key = "Syslog.Local.DatastorePath"
$changedValue[0].value = "[NFS] ESXi21-Logs/esx21.txt"
$_this = Get-View -Id 'OptionManager-ha-adv-options'
$_this.UpdateOptions($changedValue)
99
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Set-
VMHostAdvancedConfiguration -VMHost 192.168.9.201 -Name Syslog.Local.DatastorePath -Value
"[NFS] ESXi21-Logs/esx21.txt"
Name Value
---- -----
Syslog.Local.DatastorePath [NFS] ESXi21-Logs/esx21.txt
100
Start vSphere Client in other language
101
Private VLANs
vSphere Client
102
103
104
105
106
2000-1 : 100.100.100.1/8 PVLAN Promiscous
2000-2: 100.100.100.2/8 PVLAN Isolated
2000-3 : 100.100.100.3/8 PVLAN Community
2000-4 : 100.100.100.4/8 PVLAN Promiscous
2000-5: 100.100.100.5/8 PVLAN Isolated
2000-6 : 100.100.100.6/8 PVLAN Community
Promiscous to Promiscous
Promiscous to Community
107
Promiscous to Isolated
Community to Community
108
Community to Isolated
Isolated to Isolated
109
vNetwork Distributed Switch Override Portgroup Policy on Port
vSphere Client
110
111
112
vNetwork Distributed Switch Port Blocking
vSphere Client
113
114
vNetwork Distributed Switch - Port Binding - Static
vSphere Client
115
116
vNetwork Distributed Switch - Port Binding - Dynamic
vSphere Client
117
Connect back the Virtual Machines
118
119
120
121
vNetwork Distributed Switch - Network Migration
~ # /usr/lib/vmware/bin/net-dvs
...
(esxi-22)
switch cc 63 1b 50 4e 04 f4 b9-6a 42 15 78 08 cf 55 ad (etherswitch)
max ports: 256
global properties:
com.vmware.common.alias = dvSwitch
com.vmware.etherswitch.mtu = 1500
com.vmware.etherswitch.cdp = CDP, listen
com.vmware.common.uplinkPorts:
dvUplink1, dvUplink2, dvUplink3, dvUplink4
com.vmware.common.respools.sched:
inactive
host properties:
com.vmware.common.host.portset = DvsPortset-1
com.vmware.host.volatile.status = green
com.vmware.common.host.uplinkPorts:
129, 130, 131, 132
port 129:
com.vmware.common.port.alias = dvUplink1
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.connectid = 931103456
com.vmware.common.port.portgroupid = dvportgroup-163
122
com.vmware.common.port.volatile.vlan = VLAN 0
ranges = 0-4094
com.vmware.common.port.statistics:
pktsInUnicast = 240391
bytesInUnicast = 222592320
pktsInMulticast = 166
bytesInMulticast = 15729
pktsInBroadcast = 6001
bytesInBroadcast = 491948
pktsOutUnicast = 396
bytesOutUnicast = 29527
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 172
bytesOutBroadcast = 14568
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
com.vmware.common.port.volatile.status = inUse linkUp portID=83886089 noPassthruReason=1
port 130:
com.vmware.common.port.alias = dvUplink2
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
123
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
port 131:
com.vmware.common.port.alias = dvUplink3
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
port 132:
com.vmware.common.port.alias = dvUplink4
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
124
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
port 98:
com.vmware.common.port.alias =
com.vmware.common.port.connectid = 298572933
com.vmware.common.port.portgroupid = dvportgroup-164
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active = dvUplink1; dvUplink2; dvUplink3; dvUplink4;
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = No VLAN
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.volatile.persist = /vmfs/volumes/1c445c7d-fd56af7a/.dvsData/cc 63 1b 50 4e 04 f4 b9-6a 42 15 78 08 cf 55 ad/98
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.statistics:
pktsInUnicast = 395
125
bytesInUnicast = 29467
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 701
bytesInBroadcast = 72590
pktsOutUnicast = 399
bytesOutUnicast = 30453
pktsOutMulticast = 11
bytesOutMulticast = 660
pktsOutBroadcast = 4606
bytesOutBroadcast = 379432
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 628
com.vmware.common.port.volatile.status = inUse linkUp portID=83886093 noPassthruReason=1
(esxi-21)
switch cc 63 1b 50 4e 04 f4 b9-6a 42 15 78 08 cf 55 ad (etherswitch)
max ports: 256
global properties:
com.vmware.common.alias = dvSwitch
com.vmware.etherswitch.mtu = 1500
com.vmware.etherswitch.cdp = CDP, listen
com.vmware.common.uplinkPorts:
dvUplink1, dvUplink2, dvUplink3, dvUplink4
com.vmware.common.respools.sched:
inactive
host properties:
com.vmware.common.host.portset = DvsPortset-1
com.vmware.host.volatile.status = green
com.vmware.common.host.uplinkPorts:
133, 134, 135, 136
port 133:
com.vmware.common.port.alias = dvUplink1
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
126
com.vmware.common.port.connectid = 881619081
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.volatile.vlan = VLAN 0
ranges = 0-4094
com.vmware.common.port.statistics:
pktsInUnicast = 42522
bytesInUnicast = 16393563
pktsInMulticast = 109
bytesInMulticast = 12806
pktsInBroadcast = 6949
bytesInBroadcast = 573935
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
com.vmware.common.port.volatile.status = inUse linkUp portID=117440514 noPassthruReason=1
port 134:
com.vmware.common.port.alias = dvUplink2
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
127
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
port 135:
com.vmware.common.port.alias = dvUplink3
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
port 136:
com.vmware.common.port.alias = dvUplink4
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
128
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
129
130
(esxi-21)
switch cc 63 1b 50 4e 04 f4 b9-6a 42 15 78 08 cf 55 ad (etherswitch)
max ports: 256
global properties:
com.vmware.common.alias = dvSwitch
com.vmware.etherswitch.mtu = 1500
com.vmware.etherswitch.cdp = CDP, listen
com.vmware.common.uplinkPorts:
dvUplink1, dvUplink2, dvUplink3, dvUplink4
com.vmware.common.respools.sched:
inactive
host properties:
com.vmware.common.host.portset = DvsPortset-1
com.vmware.host.volatile.status = green
com.vmware.common.host.uplinkPorts:
133, 134, 135, 136
port 133:
com.vmware.common.port.alias = dvUplink1
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.connectid = 881619081
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.volatile.vlan = VLAN 0
ranges = 0-4094
com.vmware.common.port.statistics:
pktsInUnicast = 324761
bytesInUnicast = 305087948
pktsInMulticast = 120
bytesInMulticast = 13986
pktsInBroadcast = 7652
bytesInBroadcast = 636131
pktsOutUnicast = 1
bytesOutUnicast = 60
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 8
bytesOutBroadcast = 480
131
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
com.vmware.common.port.volatile.status = inUse linkUp portID=117440514 noPassthruReason=1
port 134:
com.vmware.common.port.alias = dvUplink2
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
port 135:
com.vmware.common.port.alias = dvUplink3
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
132
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
port 136:
com.vmware.common.port.alias = dvUplink4
com.vmware.common.port.connectid = 0
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.portgroupid = dvportgroup-163
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active =
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = Guest VLAN tagging
ranges = 0-4094
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.statistics:
pktsInUnicast = 0
bytesInUnicast = 0
pktsInMulticast = 0
133
bytesInMulticast = 0
pktsInBroadcast = 0
bytesInBroadcast = 0
pktsOutUnicast = 0
bytesOutUnicast = 0
pktsOutMulticast = 0
bytesOutMulticast = 0
pktsOutBroadcast = 0
bytesOutBroadcast = 0
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 0
port 98:
com.vmware.common.port.alias =
com.vmware.common.port.connectid = 298572933
com.vmware.common.port.portgroupid = dvportgroup-164
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active = dvUplink1; dvUplink2; dvUplink3; dvUplink4;
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = No VLAN
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.volatile.persist = /vmfs/volumes/1c445c7d-fd56af7a/.dvsData/cc 63 1b 50 4e 04 f4 b9-6a 42 15 78 08 cf 55 ad/98
com.vmware.common.port.volatile.vlan = VLAN 0
com.vmware.common.port.statistics:
pktsInUnicast = 404
bytesInUnicast = 30007
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 710
bytesInBroadcast = 73313
pktsOutUnicast = 401
bytesOutUnicast = 30573
pktsOutMulticast = 15
bytesOutMulticast = 900
pktsOutBroadcast = 5906
bytesOutBroadcast = 493487
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 637
134
com.vmware.common.port.volatile.status = inUse linkUp portID=117440515 noPassthruReason=1
During migration on target host:
port 98 (SHADOW):
com.vmware.common.port.alias =
com.vmware.common.port.connectid = 298572933
com.vmware.common.port.portgroupid = dvportgroup-164
com.vmware.common.port.block = false
com.vmware.etherswitch.port.teaming:
load balancing = source virtual port id
link selection = link state up; link speed>=10Mbps;
link behavior = notify switch; reverse filter; best effort on failure; shotgun on failure;
active = dvUplink1; dvUplink2; dvUplink3; dvUplink4;
standby =
com.vmware.etherswitch.port.security = deny promiscuous; allow mac change; allow forged frames
com.vmware.etherswitch.port.vlan = No VLAN
com.vmware.etherswitch.port.txUplink = normal
com.vmware.common.port.volatile.persist = /vmfs/volumes/1c445c7d-fd56af7a/.dvsData/cc 63 1b 50 4e 04 f4 b9-6a 42 15 78 08 cf 55 ad/98
com.vmware.common.port.statistics:
pktsInUnicast = 409
bytesInUnicast = 30327
pktsInMulticast = 0
bytesInMulticast = 0
pktsInBroadcast = 754
bytesInBroadcast = 76625
pktsOutUnicast = 406
bytesOutUnicast = 31268
pktsOutMulticast = 17
bytesOutMulticast = 1020
pktsOutBroadcast = 6410
bytesOutBroadcast = 538210
pktsInDropped = 0
pktsOutDropped = 0
pktsInException = 0
pktsOutException = 681
com.vmware.common.port.volatile.status = free
com.vmware.common.port.volatile.vlan = VLAN 0
135
Create Customization Specification
vSphere Client
136
137
138
139
140
141
142
143
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-
OSCustomizationSpec -Name "Windows 7" -OSType Windows -FullName xp -OrgName xp -ChangeSid
-AdminPassword password -TimeZone 100 -AutoLogonCount 2 -Workgroup WORKGROUP
Id Name Description Type
-- ---- ----------- ----
Windows 7 Windows 7 Persistent
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $w7sp=Get-
OSCustomizationSpec -Name "Windows7"
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-
OSCustomizationNicMapping -Spec $w7sp -IpMode PromptUser -SubnetMask 255.255.255.0 -
DefaultGateway 192.168.9.9 -Dns 192.168.9.222
SpecId Position IPMode IPAddress DefaultGateway
------ -------- ------ --------- --------------
Windows 7 2 PromptUser 192.168.9.9
144
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-
OSCustomizationNicMapping -Spec $w7sp -IpMode useDHCP -Position 1
SpecId Position IPMode IPAddress DefaultGateway
------ -------- ------ --------- --------------
Windows 7 1 UseDhcp
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-
OSCustomizationNicMapping -Spec "Windows 7"
SpecId Position IPMode IPAddress DefaultGateway
------ -------- ------ --------- --------------
Windows 7 1 UseDhcp
Windows 7 2 UseDhcp
Windows 7 3 PromptUser 192.168.9.9
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $nmap=Get-
OSCustomizationNicMapping -Spec "Windows 7"
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Remove-
OSCustomizationNicMapping $nmap[0]
Perform operation?
Remove customization NIC mapping?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-
OSCustomizationNicMapping -Spec "Windows 7"
SpecId Position IPMode IPAddress DefaultGateway
------ -------- ------ --------- --------------
Windows 7 1 UseDhcp
Windows 7 2 PromptUser 192.168.9.9
145
Deploy Virtual Machine from Template Using OS Customization
vSphere Client Provide vCenter Server with sysprep files:
vSphere Client
146
147
148
PowerCLI [vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> New-VM -Name
XP_PRO_NEW -Template "XPPRO TEMPLATE" -OSCustomizationSpec XP -VMHost esxi-11.home.hc -
Datastore (Get-Datastore -VMHost esxi-11.home.hc -Name "Local-1")
149
Bibliography (n.d.). Retrieved from Daverdave.com: http://daverdave.com/node/177
VI Toolkit. (n.d.). Retrieved from http://www.vi-toolkit.com/wiki/index.php/Main_Page
VMware, Inc. (Copyright © 2009, 2010). ESXi Installable and vCenter Server (ESXi 4.1 Installable
vCenter Server 4.1). VMware, Inc.