Wednesday, August 26, 2015

The Host Client Fling --Awesome non-supported tool

What is a Fling:

A fling is a pet project from VMware engineers. The URL is labs.vmware.com. There is a great collection of tools that I have used in the past such as the autodeploy gui for example.

What is the Host Client Fling:

The host client fling is a piece of software (a .vib) that is installed on the esxi host. It allows the administrator to connect with a browser to the esxi host (along the lines of the web client connecting to the vcenter server) and perform some of the same tasks that you typically perform with the vSphere Client. It is written in HTML5 and Javascript.

Step 1: Download the .vib from labs.vmware.com.



Step 2: Upload the vib (package) to your esxi host. Once you do that, install it with the esxcli command.


Step 3:  Launch your favorite browser and connect to your esxi host via https://ip_of_server/ui. The fully qualified named of the esxi host can be used as well. DON'T forget /ui at the end of the url.


What follows is a few captures to show you some of the capabilities of this fling.






Saturday, August 1, 2015

How to Build a Virtual San 6 Cluster with Powercli



Connect to the vcenter server

Connect-viserver vcenter_server_name –user administrator@vsphere.local –password Password_here

Create a datacenter

New-datacenter –Location (get-folder –norecursion) –name Datacenter_Name_Here

Add the three hosts (or more) to the datacenter

Add-vmhost first_esxi -location Datacenter_Name –user root –password password_here
Add-vmhost second_esxi –location Datacenter_Name –user root –password password_here
Add-vmhost third_esxi –location Datacenter_Name –user root –password password_here

Create the vmotion distributed switch for the three hosts

New-vdswitch –name vmotionswitch –location Datacenter_Name_Here
Get-vdswitch –name vmotionswitch | new-vdportgroup –name vmotionpg
Get-vdswitch –name vmotionswitch | add-vdswitchvmhost –vmhost first_esxi_host, second_esxi_host, third_esxi_host
$nic1=get-vmhost first_esxi_host | get-vmhostnetworkadapter –physical –name vmnic2
$nic2=get-vmhost second_esxi_host | get-vmhostnetworkadapter –physical –name vmnic2
$nic3=get-vmhost third_esxi_host | get-vmhostnetworkadapter –physical –name vmnic2
Get-vdswitch vmotionswitch | add-vdswitchphysicalnetworkadapter –vmhostphysicalnic $nic1
Get-vdswitch vmotionswitch | add-vdswitchphysicalnetworkadapter –vmhostphysicalnic $nic2
Get-vdswitch vmotionswitch | add-vdswitchphysicalnetworkadapter –vmhostphysicalnic $nic3
New-vmhostnetworkadapter –vmhost first_esxi_host –portgroup vmotionpg –virtualswitch vmotionswitch –IP ip_here –subnetmask netmask_here   –vmotionenabled $true
New-vmhostnetworkadapter –vmhost second_esxi_host –portgroup vsanpg –virtualswitch vmotionswitch –IP ip_here  –subnetmask netmask_here  –vmotionenabled $true
New-vmhostnetworkadapter –vmhost third_esxi_host –portgroup vsanpg –virtualswitch vmotionswitch –IP ip_here –subnetmask netmask_here   –vmotionenabled $true

Create the vsan distributed switch for the three hosts

New-vdswitch –name vsanswitch –location Datacenter_Name
Get-vdswitch –name vsanswitch | new-vdportgroup –name vsanpg
Get-vdswitch –name vsanswitch | add-vdswitchvmhost –vmhost first_esxi_host, second_esxi_host, third_esxi_host
$nic4=get-vmhost first_esxi_host | get-vmhostnetworkadapter –physical –name vmnic1
$nic5=get-vmhost second_esxi_host | get-vmhostnetworkadapter –physical –name vmnic1
$nic6=get-vmhost third_esxi_host | get-vmhostnetworkadapter –physical –name vmnic1
Get-vdswitch vsanswitch | add-vdswitchphysicalnetworkadapter –vmhostphysicalnic $nic4
Get-vdswitch vsanswitch | add-vdswitchphysicalnetworkadapter –vmhostphysicalnic $nic5
Get-vdswitch vsanswitch | add-vdswitchphysicalnetworkadapter –vmhostphysicalnic $nic6
New-vmhostnetworkadapter –vmhost first_esxi_host –portgroup vsanpg –virtualswitch vsanswitch –IP ip_here –subnetmask netmask_here  –vsantrafficenabled $true
New-vmhostnetworkadapter –vmhost second_esxi_host –portgroup vsanpg –virtualswitch vsanswitch –IP ip_here –subnetmask netmask_here  –vsantrafficenabled $true
New-vmhostnetworkadapter –vmhost third_esxi_host –portgroup vsanpg –virtualswitch vsanswitch –IP ip_here –subnetmask netmask_here  –vsantrafficenabled $true

Create the vsan cluster

New-cluster Cluster_Name –DRSEnabled -VsanEnabled–Location Datacenter_Name

Add the three hosts to the vsan cluster

Get-vmhost first_esxi_host | move-vmhost –Destination Cluster_Name
Get-vmhost second_esxi_host | move-vmhost –Destination Cluster_Name
Get-vmhost third_esxi_host | move-vmhost –Destination Cluster_Name

Create the disk groups:


new-vsandiskgroup -vmhost hostname -ssdcanonicalname disk_name -datadiskcanonicalname  disk_name,disk_name

View the results:

get-vsandiskgroup




Disconnect from the vcenter and verify the results

Disconnect-viserver vcenter_server_name