oi ip config

ifconfig -a

svcadm disable network/physical:nwam
svcadm enable network/physical:default

dladm show-phys

ifconfig e1000g0 192.168.0.1/24 broadcast + up

/etc/resolv.conf

iscsi setup and stuff!

Here is a nice powercli way to setup iscsi networking, and set the vlans and all sorts of fun stuff! 🙂

$h = get-vmhost rey-esxi-03*
$vs = $h | Get-VirtualSwitch -name vSwitch0


New-VMHostNetworkAdapter -VMHost $h -PortGroup vmk-iscsi-01 -VirtualSwitch $vs -SubnetMask 255.255.255.0 -IP 192.168.152.19
$vpg = $h | get-virtualportgroup -name vmk-iscsi-01
$vpg | Set-VirtualPortGroup -vlanid 152
$vpgo = $vpg | get-nicteamingpolicy
$vpgo | set-NicTeamingPolicy -makenicactive vmnic1

New-VMHostNetworkAdapter -VMHost $h -PortGroup vmk-iscsi-02 -VirtualSwitch $vs -SubnetMask 255.255.255.0 -IP 192.168.152.20
$vpg = $h | get-virtualportgroup -name vmk-iscsi-02
$vpg | Set-VirtualPortGroup -vlanid 152
$vpgo = $vpg | get-nicteamingpolicy
$vpgo | set-NicTeamingPolicy -makenicactive vmnic3

New-VMHostNetworkAdapter -VMHost $h -PortGroup vmk-iscsi-03 -VirtualSwitch $vs -SubnetMask 255.255.255.0 -IP 192.168.152.21
$vpg = $h | get-virtualportgroup -name vmk-iscsi-03
$vpg | Set-VirtualPortGroup -vlanid 152
$vpgo = $vpg | get-nicteamingpolicy
$vpgo | set-NicTeamingPolicy -makenicactive vmnic5

New-VMHostNetworkAdapter -VMHost $h -PortGroup vmk-iscsi-04 -VirtualSwitch $vs -SubnetMask 255.255.255.0 -IP 192.168.152.22
$vpg = $h | get-virtualportgroup -name vmk-iscsi-04
$vpg | Set-VirtualPortGroup -vlanid 152
$vpgo = $vpg | get-nicteamingpolicy
$vpgo | set-NicTeamingPolicy -makenicactive vmnic7

openssl.cfg for vcenter 5.0 (not 5.1)

for god sakes please use ver .9.8, if you use 1.0, the pfx wont work correctly and web services will be broke and you will be pulling your hair out.

Alan

add sans to openssl.cfg
# Extensions to add to a certificate request

basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName= @alt_names

[req]
req_extensions = v3_req
And in the v3_req section:

[ v3_req ]
subjectAltName = @alt_names

[alt_names]
DNS.1 = in2vc01
DNS.2 = in2vc01.corp.allscripts.com
IP.1 = 10.143.100.25

openssl.exe genrsa 1024 > rui.key

mine had to be 2048

openssl.exe genrsa 2048 > rui.key

openssl req -config openssl.cfg -new -key rui.key > rui.csr
openssl req -text -noout -in rui.csr
to verify

submit as 64 to cert, approve

openssl pkcs12 -export -in rui.crt -inkey rui.key -name in2vc01.corp.allscripts.com -passout pass:testpassword -out rui.pfx

[powershell]
# Get the hostsystem object for every host currently disconnected.
$VMhosts = Get-View -ViewType ‘Hostsystem’ `
-Property ‘name’ `
-Filter @{"Runtime.ConnectionState"="disconnected"}

Foreach ($VMhost in $VMhosts)
{
# Create a reconnect spec
$HostConnectSpec = New-Object VMware.Vim.HostConnectSpec
$HostConnectSpec.hostName = $VMhost.name
$HostConnectSpec.userName = ‘root’
$HostConnectSpec.password = ‘password’

# Reconnect the host
$taskMoRef = $VMhost.ReconnectHost_Task($HostConnectSpec,$null)

# optional, but i like to return a task object, that way I can
# easily integrate this into a pipeline later if need be.
Get-VIObjectByVIView -MORef $taskMoRef
}
[/powershell]

vCenter 5 upgrade leaves convertor red in health for service status

I ran into an issue where an upgrade to vCenter 5 left some trails of convertor behind… very annoying as i want it to be all green!!
here is the fix

Click me

get ldp, you don’t have to if you are server 2008 r2
run click cmd run as admin
ldp.exe

connection -> connect to your vc
connection -> bind

view -> tree
leave base dn blank
double click dc=virtualcenter,DC=vmware,DC=int
double click on OU=Health,DC=virtualcenter,DC=vmware,DC=int
double click on
OU=ComponentSpecs,OU=Health,DC=virtualcenter,DC=vmware,DC=int
double click on random string below it
(CN=GUID,OU=ComponentSpecs,OU=Health,
DC=virtualcenter,DC=vmware,DC=int)

right click
(CN=com.vmware.converter,CN=ED9D182F-7F51-42FF-B546-ADB0F518351,OU=ComponentSpecs,OU=Health,
DC=virtualcenter,DC=vmware,DC=int)

and choose delete

restart vc, log back in, and go click refresh!

welcome back all green!!

Alan

find vms with resource settings and set ram

[powershell]
$vms = Get-VM
foreach ($vm in $vms){
$vmre = $vm | Get-VMResourceConfiguration
if ($vmre.MemLimitMB -ne ‘-1’){
$rp = $vm | Get-VMResourceConfiguration
$rpvmmb = $rp.MemLimitMB
write-host $vm ", mem granted= " $vm.memorymb ", mem resources = " $rpvmmb
}}
[/powershell]

cooler one to only show when they don’t match!

[powershell]
$vms = get-vm
foreach ($vm in $vms){
$vmre = $vm | Get-VMResourceConfiguration
if ($vmre.MemLimitMB -ne ‘-1’){
$rp = $vm | Get-VMResourceConfiguration
$rpvmmb = $rp.MemLimitMB
if ($vm.memorymb -ne $rpvmmb){
write-host $vm ", mem granted= " $vm.memorymb ", mem resources = " $rpvmmb
}}}
[/powershell]

Dell OSMA in esxi

vihostupdate.pl –server ncvm18 –username root –password * -i -b “Z:\VMware\4.1U1\OM-SrvAdmin-Dell-Web-6.5.0-2247.VIB-ESX41i_A01.zip”

vicfg-advcfg.pl –server ncvm19 –username root –password * –set 1 UserVars.CIMEnabled

vicfg-advcfg.pl –server ncvm19 –username root –password * –set 1 UserVars.CIMoemProviderEnabled

http://search.dell.com/searchcom_redirect.aspx?c=us&l=en&s=biz&cs=555&k=Dell+OpenManage+Offline+Bundle+and+VIB+for+ESXi&tdc=7&p=1&rpp=12&cd=4&cat=sup&sfp=web&dtype=downloads&did=R300511&redp=http%253a%252f%252fsupport.us.dell.com%252fsupport%252fdownloads%252fformat.aspx%253freleaseid%253dR300511%2526c%253dus%2526l%253den%2526cs%253d555%2526s%253dbiz&redpe=bf2ff222-985b-a822-3fd9-da4eda7b367e