Tuesday, October 6, 2015

vPostgres Database Information

 vPostgres related commands to know

Disclaimer: Do not run these commands in a production environment.

Connect to the vCenter Appliance via putty. Type df -h to find the location of the database and how full it is.

 

Go to /etc/vmware-vpx and find the password of your database in the vcdb.properties file. This includes the username (vc) and password.


Use the psql command to connect to the database. Type \h to get help and \q to quit once you are done.


Google vacuumdb to free up some space.


Or ... here is the syntax.



Find the password for the user "vc" to perform the database backup.Stop vpx first by typing service vmware-vpxd stop first.


Back up the database with the pg_dump command. Type service vmware-vpxd start once you are done.


vSphere Web Client Timeout Configuration in 5.5

How to make the vSphere Web Client to never timeout in 5.5

vSphere 5.5 example using the Linux Appliance

Step 1: Log into the vcenter appliance and change directories to /var/lib/vmware/vsphere-client

Step 2: Edit the webclient.properties with the vi editor.


Step 3: Modify the session.timeout parameter to 0.


Step 4: Restart the vsphere-client script in /etc/init.d


Step 5: Launch the web client and verify behavior.

Note: If using the Windows vCenter, the information is here:

%ALLUSERSPROFILE%\VMware\vSphere Web Client

Wednesday, September 23, 2015

3 Cool New Features of Virtual SAN 6.1

Although there are lots of improvements to Virtual San 6.1, here are 3 that I truly like.

1. No more upgrading the VMFS-L to VsanFS via the RVC. 



2. New Flash technologies and choices supported. 


 3. Stretched Clusters and 2 Node Clusters.


Virtual Sans Stretched Clusters

Introduction to Stretched Clusters

Stretched clusters extend the Virtual SAN cluster from a single site to two sites for a higher level of availability and intersite load balancing. Stretched clusters are typically deployed in environments where the distance between data centers is limited, such as metropolitan or campus environments.

You can use stretched clusters to manage planned maintenance and avoid disaster scenarios, because maintenance or loss of one site does not affect the overall operation of the cluster. In a stretched cluster configuration, both sites are active sites. If either site fails, Virtual SAN uses the storage on the other site. vSphere HA restarts any VM that must be restarted on the remaining active site.

You must designate one site as the preferred site. The other site becomes a secondary or nonpreferred site. The system uses the preferred site only in cases where there is a loss of network connection between the two active sites, so the one designated as preferred is the one that remains operational.

A Virtual SAN stretched cluster can tolerate one link failure at a time without data becoming unavailable. A link failure is a loss of network connection between the two sites or between one site and the witness host. During a site failure or loss of network connection, Virtual SAN automatically switches to fully functional sites.

For more information about working with stretched clusters, see the Virtual SAN Stretched Cluster Guide.

Witness Host

Each stretched cluster consists of two sites and one witness host. The witness host resides at a third site and contains the witness components of virtual machine objects. It contains only metadata, and does not participate in storage operations.

The witness host serves as a tiebreaker when a decision must be made regarding availability of datastore components when the network connection between the two sites is lost. In this case, the witness host typically forms a Virtual SAN cluster with the preferred site. But if the preferred site becomes isolated from the secondary site and the witness, the witness host forms a cluster using the secondary site. When the preferred site is online again, data is resynchronized to ensure that both sites have the latest copies of all data.

If the witness host fails, all corresponding objects become noncompliant but are fully accessible.

The witness host has the following characteristics:
The witness host can use low bandwidth/high latency links.

The witness host cannot run VMs.

A single witness host can support only one Virtual SAN stretched cluster.

The witness host must have at least one VMkernel adapter with Virtual SAN traffic enabled, with connections to all hosts in the cluster.

The witness host must be a standalone host dedicated to the stretched cluster. It cannot be added to any other cluster or moved in inventory through vCenter Server.

The witness host can be a physical host or an ESXi host running inside a VM. The VM witness host does not provide other types of functionality, such as storing or running VMs. Multiple witness hosts can run as VMs on a single physical server. For patching and basic networking and monitoring configuration, the VM witness host works in the same way as a typicalESXi host. You can manage it with vCenter Server, patch it and update it by using esxcli or vSphere Update Manager, and monitor it with standard tools that interact with ESXi hosts.

You can use a witness virtual appliance as the witness host in a stretched cluster. The witness virtual appliance is an ESXihost in a VM, packaged as an OVF or OVA. The appliance is available in different options, based on the size of the deployment.

Friday, September 4, 2015

Useful VSAN Network Troubleshooting Tools

Virtual SANs are dependent on the correct configuration of the VSAN network. Incorrect ip settings, multicast address, MTU mistmatches will prevent the normal operations of your VSAN cluster.

What follows below is what you DON'T want to see...


VMware provides a set of utilities for troubleshooting, both within the esxi host and through the RVC. Here is a short list.

1. The vsan.reapply_vsan_vmknic_config RVC utility to refresh networking settings


2. The tcpdump-uw -i vmk? udp port 23451 -v utility to verify multicast settings


3. The tcpdump-uw -i vmk? igmp utility


4. The esxcli network vswitch standard list utility to verify the MTU of the switch

 
 5. The esxcli network ip interface list utility to verify the MTU settings of the vmk ports



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