new1234.jpg

Archive

Posts Tagged ‘vSphere 5’

VMware: Configure NetApp NFS datastore(s) Advanced parameters with PowerCLI

January 7th, 2013 3 comments

The settings that NetApp recommends (across all ESX hosts) are:

– NFS.HeartbeatFrequency(NFS.HeartbeatDelta in vSphere) = 12
– NFS.HeartbeatTimeout = 5 (default)
– NFS.HeartbeatMaxFailures = 10

When the number of NFS datastores are increased, we also recommend increasing the heap values:
– Net.TcpipHeapSize =>’30’  to Net.TcpipHeapMax  => ‘120’

To automate this configuration I’ve wrote a PowerCLI script:

#====================================================================#
#   SCRIPT:        Configure_Advanced_NFS_parameters.ps1             #
#   FUNCTION:      Configure NFS / NetApp best practice              #
#   OWNER:         Sander Daems                                      #
#   VENDOR:        NetApp / FAS2040                                  #
#   VSPHERE:       5.0 Update 1 build 623860                         #
#   CREATED:       07/01/2013                                        #
#   MODIFIED:      20/03/2013                                        #
#   VERSION:       v.1.1                                             #
#====================================================================#
#   CHANGELOG:                                                       #
#                                                                    #
#    v.1.0                                                           #
#    - Created script;                                               #
#                                                                    #
#====================================================================#
#   HOST - Specify host and connect                                  #
#====================================================================#
$ESXiHost = Read-Host "Enter ESXi Host name or IP"
Connect-VIServer $ESXiHost
#====================================================================# 
#   ADVANCED - Update TCP Settings                                   #
#====================================================================#
Set-VMHostAdvancedConfiguration -VMHost $ESXiHost -Name Net.TcpipHeapSize -Value 32
Set-VMHostAdvancedConfiguration -VMHost $ESXiHost -Name Net.TcpipHeapMax -Value 128
#====================================================================#
#   ADVANCED - Update NFS Settings                                   #
#====================================================================#
Set-VMHostAdvancedConfiguration -VMHost $ESXiHost -Name NFS.MaxVolumes -Value 256
Set-VMHostAdvancedConfiguration -VMHost $ESXiHost -Name NFS.HeartbeatMaxFailures -Value 10
Set-VMHostAdvancedConfiguration -VMHost $ESXiHost -Name NFS.HeartbeatFrequency -Value 12
Set-VMHostAdvancedConfiguration -VMHost $ESXiHost -Name NFS.HeartbeatTimeout -Value 5
#====================================================================#
#   SCRIPT FINISHED                                        #
#====================================================================#
Write-Host "Script finished..." -foregroundcolor yellow
#====================================================================#

More information / source: NetApp Whitepaper

More information / source: VMware KB , VMware KB, VMware KB

sanderdaems

Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.

More Posts - Website

Follow Me:
TwitterLinkedIn

VMware: Install Windows 8 in vSphere 5

March 22nd, 2012 2 comments

I tried to install Windows 8 at my vSphere 5 patch 1 environment, but after starting the VM I received a warning:

Your computer ran into a problem and needs to restart.

If you’d like to know more, you can search online later for this code: HAL_INITIALIZATION_FAILED

It’s collecting error info and will restart in: 0 seconds

image

 

Solution:

Only you have to do is add the new guest OS in you’re .vmx file, re-add the file to your vSphere inventory and start the VM. Guest OS you need to add:

guestOS = "windows8srv-32"
guestOS = "windows8srv-64"

image[2]

 

Note: if you’re running vSphere 5 without Update 1 you need to install Patch 02

Read more…

sanderdaems

Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.

More Posts - Website

Follow Me:
TwitterLinkedIn

Categories: Microsoft, VMware Tags: , , ,

VMware: Install vSphere 5 update 1 with PowerCLI

March 22nd, 2012 1 comment

Today I’ve updated my vSphere 5 hosts witch patch 1 released one week ago. Before I started the build number was VMware ESXi 5.0.0 469512:

image

To update the host I used PowerCLI, the code:

Get-VMHost esx02.vmpros.lan | Set-VMHost -State Maintenance
$DataStore = Get-VMHost esx02.vmpros.lan | Get-Datastore ESX02_VMFS01
Copy-DatastoreItem C:\vmpros\patch1\ $DataStore.DatastoreBrowserPath -Recurse
Get-VMHost esx02.vmpros.lan | Install-VMHostPatch -Hostpath "/vmfs/volumes/ESX02_VMFS01/patch1/metadata.zip"

The script will upload the content of the update-from-esxi5.0-5.0_update01.zip located at your local computer (which running  PowerCLI) to the selected datastore. Then the update installation will start.

Update installation process:

image

WARNING: The update completed successfully, but the system needs to be rebooted for the changes to be effective.

Read more…

sanderdaems

Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.

More Posts - Website

Follow Me:
TwitterLinkedIn

VMware: The operation is not allowed in the current connection state of the host

March 22nd, 2012 6 comments

Today I want to install Windows 8 in my test lab, after creating a new virtual machine and power-on the VM I received warning error message:

Failed to find a host for powering on the virtual machine. The following faults explain why the registered host is not compatible

The operation is not allowed in the current connection state of the host.

 

image

 

Weird, both ESXi 5.0 hosts are powered on, my vCenter VM is running on the same machine which I want to power on the new virtual machine.. also strange is.. there’s no CPU (0 MHz) and no Memory usage (0,00 MB) activity at this host, check the screenshot below

 

image

Double check..:

image

Jup.. there are two running servers at esx01.vmpros.lan

 

Solution:

After disconnecting the ESXi host from vCenter and reconnect the host I was able to power on virtual machines, also my CPU/Memory activity is back

 

image

sanderdaems

Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.

More Posts - Website

Follow Me:
TwitterLinkedIn

VMware: Migrate vSphere hosts to new ip subnet, new DNS servers, new gateway and rejoin vCenter server with PowerCLI

January 30th, 2012 12 comments

Last month I’ve wrote a script for a company that is merging with a new company in a different datacenter, that means new ip-addresses, new subnet, new gateway, new DNS servers and rejoin vCenter server.. my part was to migrate all (60) VMware vSphere hosts to the new subnet and rejoin the vSphere vCenter cluster… without downtime!

Function:

#Connect to vCenter server
— Specify host
— Enter Host Standby mode
— Move all VM’s to other hosts in cluster
— Re-balance with DRS
— Disconnect host
— Remove host from cluster

#Connect to ESXi Server
— Add new VMKernel Management Network with new range in vSwitch0
— Enable Management option for new VMkernel
— Configure NIC Teaming policy
— Configure new DNS servers
— Configure new VMkernel gateway
— Reboot host

#MANUAL ACTION: Update DNS records at configured DNS servers

#Connect to vCenter server
— Add new record in vCenter server host file with new host ipaddress Management VMkernel
— Add host with new VMkernel Management Network
— Delete old VMkernel from vSwitch0
— Exit Host Standby mode
— Rebalance cluster with DRS

#Script finished
— Next host…>


The script
:

#====================================================================#
#   SCRIPT:       VMware_vSphere_IP_Redesign_v.1.0.ps1               #
#   AUTHOR:       S.Daems - VMpros.nl                                #
#   CREATED:      22/01/2012                                         #
#   MODIFIED:     30/01/2012                                         #
#   VERSION:      v.1.0                                              #
#                                                                    #
#====================================================================#
#   CHANGELOG:                                                       #
#                                                                    #
#    v.1.0                                                           #
#     - Script created                                               #
#                                                                    #
#====================================================================#
#   FUNCTION:                                                        #
#                                                                    #
#   #Connect to vCenter server                                       #
#     Specify host                                                   #
#     Enter Host Standby mode                                        #
#     Move all VM's to other hosts in cluster                        #
#     Re-balance with DRS                                            #
#     Disconnect host                                                #
#     Remove host from cluster                                       #
#                                                                    #
#   #Connect to ESXi Server                                          #
#     Add new VMKernel Management Network with new range in vSwitch0 #
#     Enable Management option for new VMkernel                      #
#     Configure NIC Teaming policy                                   #
#     Configure new DNS servers                                      #
#     Configure new VMkernel gateway                                 #
#     Reboot host                                                    #
#                                                                    #
#   #MANUAL ACTION: Update DNS records at configured DNS servers     #
#                                                                    #
#   #Connect to vCenter server                                       #
#     Add new record in vCenter server host file with new host ip-   #
#     address Management VMkernel                                    #
#     Add host with new VMkernel Management Network                  #
#     Delete old VMkernel from vSwitch0                              #
#     Exit Host Standby mode                                         #
#     Rebalance cluster with DRS                                     #
#                                                                    #
#   #Script finished                                                 #
#     Next host...>                                                  #
#                                                                    #
#====================================================================#
#   NOTE:                                                            #
#                                                                    #
#     - Run this script first in a test environment                  #
#     - Make sure youre ESXi host - vSwitch0 have multiple pNIC's    #
#       and can access both networks/gateway's                       #
#     - Don't forgot to update vCenter Cluster das.isolationaddress2 #
#       if vCenter is configured in a new subnet                     #
#     - Don't forgot to update DNS (A) records at your DNS servers   #
#       with with new ESXi host Management ip-addresses              #
#     - Check if the correct pNIC's are configured for NIC Teaming   #
#     - Check if the correct VMkernel is selected for gateway config #
#     - This script is written with VMware vSphere PowerCLI 5.0.0    #
#                                                                    #
#====================================================================#
#   CUSTOM DEFINITIONS                                               #
#====================================================================#
$vCenterServer = "vCENTER SERVER NAME BY DNS"
$vCenterUsername = "vCENTER DOMAIN\USERNAME"
$vCenterPassword = "vCENTER PASSWORD"
$vCenterDatacenter = "vCENTER DATACENTER NAME"
$vCenterCluster = "vCENTER CLUSTERNAME"
$ESXiHost = "ESXi HOSTS BY DNS"
$RootUser = "ROOT USER ACCOUNT TO CONFIGURE/CONNECT HOST"
$RootPassword = "ROOT PASSWORD TO CONFIGURE/CONNECT HOST"
$Old_MGMT_Network = "ORIGINAL MANAGEMENT VMKERNEL NAME"
$New_MGMT_Network = "NEW MANAGEMENT VMKERNEL IPADDRESS"
$New_MGMT_Subnet = "NEW MANAGEMENT VMKERNEL SUBNET"
$New_VMK_Gateway = "NEW MANAGEMENT VMKERNEL GATEWAY"
$New_DNS01 = "NEW PRIMARY DNS SERVER TO CONFIGURE"
$New_DNS02 = "NEW SECUNDARY DNS SERVER TO CONFIGURE"
New-VICredentialStoreItem -Host "$vCenterServer" -User "$vCenterUsername" -Password "$vCenterPassword" | out-null
New-VICredentialStoreItem -Host "$ESXiHost" -User "$RootUser" -Password "$RootPassword" | out-null
Write-Host "Script will start..." -foregroundcolor yellow

#====================================================================#
#   FASE 1  - vCENTER: MAINTENANCE AND REMOVE HOST FROM vCENTER      #
#====================================================================#
Write-Host "Connect to vCenter Server" -foregroundcolor green
#====================================================================#
Connect-VIServer "$vCenterServer" | out-null
Sleep 10
#====================================================================#
Write-Host "Enter host in Maintenance mode" -foregroundcolor green
#====================================================================#
Set-VMHost "$ESXiHost" -State "Maintenance" -RunAsync | out-null
#====================================================================#
Write-Host "Disconnect host from vCenter Server" -foregroundcolor green
#====================================================================#
Set-VMHost "$ESXiHost" -State "Disconnected" -RunAsync | out-null
#====================================================================#
Write-Host "Tell DRS to re-balance VMs including the rejoined host" -foregroundcolor green
#====================================================================#
Get-DrsRecommendation -Cluster "$vCenterCluster" | where {$_.Reason -eq "Host is entering maintenance mode"} | Apply-DrsRecommendation | out-null
#====================================================================#
Write-Host "Remove host from vCenter Server" -foregroundcolor green
#====================================================================#
Remove-VMHost "$ESXiHost" -Confirm:$false | out-null
#====================================================================#
Write-Host "Disconnect from vCenter Server" -foregroundcolor green
#====================================================================#
Disconnect-VIServer -Confirm:$False | out-null

#====================================================================#
#   FASE 2 - HOST: RE-CONFIGURE MANAGEMENT NETWORK                   #
#====================================================================#
Write-Host "Connect directly to ESXi host" -foregroundcolor green
#====================================================================#
Connect-VIServer "$ESXiHost" | out-null
Sleep 10
#====================================================================#
Write-Host "Configure new management network" -foregroundcolor green
#====================================================================#
Get-VMHost "$ESXiHost" | New-VMHostNetworkAdapter -VirtualSwitch "vSwitch0" -PortGroup "MGMT Network" -IP "$New_MGMT_Network" -SubnetMask "$New_MGMT_Subnet" -ManagementTrafficEnabled:$true -Confirm:$false | out-null
#====================================================================#
Write-Host "Configure vSwitch0 - MGMT NIC Teaming Policy" -foregroundcolor green
#====================================================================#
Get-VMHost "$ESXiHost" | Get-VirtualPortGroup -name "MGMT Network" | Get-NicTeamingPolicy | Set-NicTeamingPolicy -MakeNicActive vmnic0 | out-null
Get-VMHost "$ESXiHost" | Get-VirtualPortGroup -name "MGMT Network" | Get-NicTeamingPolicy | Set-NicTeamingPolicy -MakeNicStandby vmnic2 | out-null
#====================================================================#
Write-Host "Configure new DNS servers" -foregroundcolor green
#====================================================================#
Get-VMHost "$ESXiHost" | Get-VMHostNetwork | Set-VMHostNetwork -DnsAddress "$New_DNS01","$New_DNS02" | out-null
#====================================================================#
Write-Host "Change VMkernel Gateway" -foregroundcolor green
#====================================================================#
$net = Get-VMHostNetwork
$net | Set-VMHostNetwork -VMKernelGateway "$New_VMK_Gateway" -VMKernelGatewayDevice "vmk2" | out-null
#====================================================================#
Write-Host "Reboot ESXi Host" -foregroundcolor green
#====================================================================#
Restart-VMHost -VMHost "$ESXiHost" -Confirm:$false | out-null
#====================================================================#
Write-Host "Disconnect from ESXi host" -foregroundcolor green
#====================================================================#
Disconnect-VIServer -Confirm:$False | out-null
Write-Host "Update DNS (A) records at you're Domain Controller with new ESXi ipaddress, otherwise the script will fail..!!" -foregroundcolor white
Write-Host "Update DNS (A) records at you're Domain Controller with new ESXi ipaddress, otherwise the script will fail..!!" -foregroundcolor white
Write-Host "Update DNS (A) records at you're Domain Controller with new ESXi ipaddress, otherwise the script will fail..!!" -foregroundcolor white
Sleep 360

#====================================================================#
#   FASE 3  - vCENTER: EXIT MAINTENANCE AND RE-ADD HOST TO vCENTER   #
#====================================================================#
Write-Host "Connect to vCenter Server" -foregroundcolor green
#====================================================================#
Connect-VIServer "$vCenterServer" | out-null
Sleep 10
#====================================================================#
Write-Host "New Management Network to vCenter Server host file" -foregroundcolor green
#====================================================================#
$hostsPath = “$env:windir\System32\drivers\etc\hosts”
$hosts = get-content $hostsPath
$string = “$New_MGMT_Network             $ESXiHost”
$hosts = $hosts + $string
$hosts | Out-File $hostsPath -enc ascii
#====================================================================#
Write-Host "Add ESXi host to vCenter Server" -foregroundcolor green
#====================================================================#
Add-VMHost "$ESXiHost" -location (Get-Datacenter -name "$vCenterDatacenter" | Get-Cluster -name "$vCenterCluster") -user root -password $RootPassword -force | out-null
#====================================================================#
Write-Host "Remove old Management Network from host" -foregroundcolor green
#====================================================================#
#$vNic = Get-VMHostNetworkAdapter -VMHost $ESXiHost | where {$_.PortgroupName -eq $Old_MGMT_Network} | out-null
#Remove-VMHostNetworkAdapter -Nic $vNic | out-null
#====================================================================#
Write-Host "Exit host from Maintenance mode" -foregroundcolor green
#====================================================================#
Set-VMHost "$ESXiHost" -State "Connected" -RunAsync | out-null
#====================================================================#
Write-Host "Tell DRS to re-balance VMs including the rejoined host" -foregroundcolor green
#====================================================================#
Get-DrsRecommendation -Cluster "$vCenterCluster" | where {$_.Reason -eq "Host is entering maintenance mode"} | Apply-DrsRecommendation | out-null
#====================================================================#
Write-Host "Disconnect from vCenter Server" -foregroundcolor green
#====================================================================#
Disconnect-VIServer -Confirm:$False | out-null

#====================================================================#
#   FASE 4  - SCRIPT FINISHED                                        #
#====================================================================#
Write-Host "Script finished, please check error log..." -foregroundcolor yellow
#====================================================================#

The script is finished:

image

Custom settings:

$vCenterServer = "vCENTER SERVER NAME BY DNS"
$vCenterUsername = "vCENTER DOMAIN\USERNAME"
$vCenterPassword = "vCENTER PASSWORD"
$vCenterDatacenter = "vCENTER DATACENTER NAME"
$vCenterCluster = "vCENTER CLUSTERNAME"
$ESXiHost = "ESXi HOSTS BY DNS"
$RootUser = "ROOT USER ACCOUNT TO CONFIGURE/CONNECT HOST"
$RootPassword = "ROOT PASSWORD TO CONFIGURE/CONNECT HOST"
$Old_MGMT_Network = "ORIGINAL MANAGEMENT VMKERNEL NAME"
$New_MGMT_Network = "NEW MANAGEMENT VMKERNEL IPADDRESS"
$New_MGMT_Subnet = "NEW MANAGEMENT VMKERNEL SUBNET"
$New_VMK_Gateway = "NEW MANAGEMENT VMKERNEL GATEWAY"
$New_DNS01 = "NEW PRIMARY DNS SERVER TO CONFIGURE"
$New_DNS02 = "NEW SECUNDARY DNS SERVER TO CONFIGURE"


sanderdaems

Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.

More Posts - Website

Follow Me:
TwitterLinkedIn

VMware: View–Error 1920. Service VMware View Composer (svid) failed to start

January 9th, 2012 16 comments

Today I was installing VMware View in my homelab, after trying to install VMware View Composer 2.7 I received this error message:

Error 1920. Service VMware View Composer (svid) failed to start. Verify that you have sufficient privileges to start system services.

 

image

 

Solution:

After creating a new ODBC connection to my SQL server I still can’t finish the installation, the installation want to start service: VMware View Composer (svid).. after changing the logon service with the credentials I used for the ODBC I was able to start the service and finish the setup

image

 

image

sanderdaems

Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.

More Posts - Website

Follow Me:
TwitterLinkedIn