Set NTP on all host in vCenter

Here is a Powershell script that will set NTP on all the ESX host connected to your vCenter.

First connect to the vCenter using Connect-VIserver then run the following code.

 

#Get Host
write-host “Gathering ESX Host”
$esx = get-vmhost

#Configure NTP server
write-host “configuring NTP”
Add-VmHostNtpServer -VMHost $esx -NtpServer 10.10.16.220

#Allow NTP queries outbound through the firewall
wrtie-host “Setting Firewall Permissions”
Get-VMHostFirewallException -VMHost $esx | where {$_.Name -eq “NTP client”} | Set-VMHostFirewallException -Enabled:$true

#Start NTP client service and set to automatic
write-host “Starting NTP service”
Get-VmHostService -VMHost $esx | Where-Object {$_.key -eq “ntpd”} | Start-VMHostService
Get-VmHostService -VMHost $esx | Where-Object {$_.key -eq “ntpd”} | Set-VMHostService -policy “automatic”

 

Configuring ESXi 6 (vSphere Setup Part 2)

This is part 2 of a series on setting up vSphere.  If you missed the first part you can find it here.

Now that you have installed ESXi 6 it is time to start configuring.

  1. Once the host reboots you will be greeted with this screen.  Press F2 to go to the setup screen where you will login with root and the password you provided earlier.2016-06-03 14_17_49-OFFICE - TeamViewer - Free license (non-commercial use only)2016-06-03 14_19_16-OFFICE - TeamViewer - Free license (non-commercial use only)

 

2. Now its time to configure the management network. Go to Configure Management Network and then to Network Adapters.

2016-06-03 14_21_00-OFFICE - TeamViewer - Free license (non-commercial use only)2016-06-03 14_21_17-OFFICE - TeamViewer - Free license (non-commercial use only)

3. Make sure all the NIC’s you want to use for management are selected.  Since this is in an nested lab I only have one to use.

2016-06-03 14_23_11-OFFICE - TeamViewer - Free license (non-commercial use only).png

4. Now for a test lab this option is not really needed, but here is where you can configure the VLAN for the management network.

2016-06-03 14_24_53-OFFICE - TeamViewer - Free license (non-commercial use only)

5. Set the IP to static and fill in the appropriate IP information for your environment.  Unless you want to you use it is best to disable IP6.

Capture.PNG

2016-06-03 14_42_05-OFFICE - TeamViewer - Free license (non-commercial use only)

6. Set the appropriate DNS  and hostname information.

2016-06-03 14_41_36-OFFICE - TeamViewer - Free license (non-commercial use only)

7. Setup the custon DNS suffix which would be your domain name.

2016-06-03 14_43_42-OFFICE - TeamViewer - Free license (non-commercial use only)

8.  Now its time to reboot the host so all of the configuration can take affect.

2016-06-03 14_44_36-OFFICE - TeamViewer - Free license (non-commercial use only)

In part three of setting up ESXi I will go over the deployment of the VCSA.

 

Default Isolation Address

If a host thinks it is isolated by default it will ping its gateway.  It is best practice to have more than one isolation address, and you can have up to 10 of these.  Duncan Epping has a good article on it here.  Here is a simple script I found somewhere on the web.

$cluster = Get-Cluster -Name ITN

New-AdvancedSetting -Entity $cluster -Type ClusterHA -Name ‘das.isolationaddress1’ -Value 1.2.3.4

New-AdvancedSetting -Entity $cluster -Type ClusterHA -Name ‘das.usedefaultisolationaddress’ -Value false

#Disable and reenable HA

Set-Cluster -Cluster $cluster -HAEnabled:$false

Set-Cluster -Cluster $cluster -HAEnabled:$true

Analyzing vSphere with Free Tools “Syslog”

Virtualization is a great technology, but sometimes it can be hard getting a closer look into your environment.  Over the next few post I am going talk about a few free tools that I use in my environment.  They have given me a lot of support in managing my environment, and I would like to think the people who made them.

Syslog can be a very useful tool.  The problem with it is that it can be very painful to use.  Luckly VMware has a great tool for that and that tool is LogInsight. It makes a great syslog server and has a lot of other features that you may find invaluable.  It is a paid product so what is a great alternative?  Sexilog is that great alternative.  With it you point all your esx host to it and watch the magic happen. Very quickly you get a better insight what is happening inside your environment. It may not have as many features as LogInsight, but nothing beats it on feature compared to price.

VM Fails to Power On

Recently I had a strange problem.  Power off VM’s would not power on, and would give this generic error.

power on error

I found KB 1006232 and was able to power on the VM by command line, but I was still not able to power them on by directly connecting to the host through the C client.  Or using vCenter through the web and C client.  I tried a lot of things, but in the end restarting the vCenter server fixed everything.

New Port Group not showing up under Host

I was recently built up a new Cluster of 3 host with a Distributed Switch.  I had created my Management and vMotion groups with no issues, but when I created the server port group it did not show up under hosts.  The VM’s were already built and working on the network, and  I only noticed this issue when I tried to vMotion one of the VM’s to another host.

To fix the issue I had to create a new port group for that vlan and migrate the VM’s over to it.  I then deleted the old port group, and renamed the new one to the old ones name.  I have no idea why this happened my only guess is that I hit some really weird bug.

Where is ESX installed?

Under vCenter go to the Host > Configuration > Storage > Devices

1

Then look for a datastore that has a few partitions such as Legacy MBR and VMware Diagnostic.  That should be where you ESX is booting from.

2

 

Blog at WordPress.com.

Up ↑