In this post I will go through enabling and configuring VMware Virtual SAN (VSAN) 6 cluster within vSphere. Virtual SAN is embedded directly in the hypervisor and does not require any additional software to be installed.
VMware
Add Virtual Machine Templates (.VMTX) to Inventory using PowerShell
Here is a script that will scan a datastore for VM templates (.VMTX) and add them to inventory. This is a modified version of the Add Virtual Machines (.VMX) to Inventory script.
You must have VMware PowerCLI installed in order to have the cmdlets required for PowerShell to run the script.
Add VMTX (Virtual Machine Templates) to Inventory from a Datastore:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
##################################################################### # Load VMware Plugins and vCenter Connect # ##################################################################### Add-PSSnapin vmware.vimautomation.core connect-viserver -server ENTER VCENTER FQDN HERE ##################################################################### # Add .VMTX (VM Templates) to Inventory from Datastore # ##################################################################### # Variables: Update these to the match the environment $Cluster = "ENTER CLUSTER NAME HERE" $Datastore = "ENTER DATASTORE NAME HERE" $VMFolder = "ENTER FOLDER NAME HERE" $ESXHost = Get-Cluster $Cluster | Get-VMHost | select -First 1 foreach($Datastore in get-datastore $Datastore) { # Collect .vmtx paths of registered VMs on the datastore $registered = @{} Get-Template -Datastore $Datastore | ForEach-Object -Process { $registered.Add($_.Name+'.vmtx',$true) } # Set up Search for .VMTX Files in Datastore(s) $null = New-PSDrive -Name TgtDS -Location $Datastore -PSProvider VimDatastore -Root '\' $unregistered = @(Get-ChildItem -Path TgtDS: -Recurse | ` Where-Object -FilterScript { $_.FolderPath -notmatch '.snapshot' -and $_.Name -like '*.vmtx' -and !$registered.ContainsKey($_.Name) } ) Remove-PSDrive -Name TgtDS #Register all .vmtx Files as VMs on the datastore foreach($vmtxFile in $unregistered) { New-Template -Name $vmtxFile.Name -TemplateFilePath $vmtxFile.DatastoreFullPath -VMHost $ESXHost -Location $VMFolder -RunAsync } } |
Let’s see it in action!
Add Virtual Machines (.VMX) to Inventory using PowerShell
There are quite a few clicks to add a virtual machine from a datastore to inventory. If you were to consolidate an environment and had to add multiple virtual machines this would be quite a manual task. Easier solution? Script it! The below script makes scanning a datastore and registering all virtual machines with vCenter a breeze.
You must have VMware PowerCLI installed in order to have the cmdlets required for PowerShell to run the script.
Add VMX (Virtual Machines) to Inventory from a Datastore:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
##################################################################### # Load VMware Plugins and vCenter Connect # ##################################################################### Add-PSSnapin vmware.vimautomation.core connect-viserver -server ENTER VCENTER FQDN HERE ##################################################################### # Add .VMX (Virtual Machines) to Inventory from Datastore # ##################################################################### # Variables: Update these to the match the environment $Cluster = "ENTER CLUSTER NAME HERE" $Datastore = "ENTER DATASTORE NAME HERE" $VMFolder = "ENTER FOLDER NAME HERE" $ESXHost = Get-Cluster $Cluster | Get-VMHost | select -First 1 foreach($Datastore in $Datastore) { # Searches for .VMX Files in datastore variable $ds = Get-Datastore -Name $Datastore | %{Get-View $_.Id} $SearchSpec = New-Object VMware.Vim.HostDatastoreBrowserSearchSpec $SearchSpec.matchpattern = "*.vmx" $dsBrowser = Get-View $ds.browser $DatastorePath = "[" + $ds.Summary.Name + "]" # Find all .VMX file paths in Datastore variable and filters out .snapshot $SearchResult = $dsBrowser.SearchDatastoreSubFolders($DatastorePath, $SearchSpec) | where {$_.FolderPath -notmatch ".snapshot"} | %{$_.FolderPath + ($_.File | select Path).Path} # Register all .VMX files with vCenter foreach($VMXFile in $SearchResult) { New-VM -VMFilePath $VMXFile -VMHost $ESXHost -Location $VMFolder -RunAsync } } |
Let’s see it in action!
Deployment of VMware vRealize Operations Manager
vRealize Operations Manager (vROM/vROPS) gives you visibility into the performance and health of your virtual infrastructure. The bad thing about virtualization is how easy it is to accumulate over-provisioned virtual machines. When your environment grows the numbers can really be staggering. With vROM you can find these VMs and really tweak your environment making it more lean and resource efficient. vROM also has the ability to ensure compliance with IT policies, regulatory requirements, and smart alerting. Basically vRealize Operations Manager will take your structure data like performance metrics and give you a unified interface of analytics. Here is my documented deployment of vRealize Operations Manager 6.0.1 in my lab environment.
Planning and Reading:
- VMware vRealize Operations Manager – This is all the documentation in one place!
- vRealize Operations Manager Sizing Guidelines – VMware KB2093783
- vRealize Operations Manager vApp Deployment and Configuration Guide
- Exploring New vRealize Operations Capabilities – VMware Blog, David Davis
- If you are deploying vROM in your lab and need a license I highly recommend you check out the VMUG Advantage subscription.
Lost connectivity to the device backing the boot filesystem
One of our HP Gen 9 blades had the following … Read more…
Deprecated VMFS volume(s) found on the host
One of my ESXi 6 hosts had the configuration issue message stating: “Deprecated … Read more…
Upgrading Windows based vCenter 5.x to 6
For this post I will go through upgrading my Windows based vCenter from 5.5 to vCenter 6. VMware has really made the installer process lean. I would even go out on a limb and say “easy”! vCenter 6 introduces the Platform Services Controller which changes the architecture of vCenter down to two components. The graphic below shows my environment before the upgrade and after:
My setup is very simple as I have all vCenter 5.5 components on a single Server 2012 virtual machine. I have ran through the upgrade multiple times and have yet to run into anything major. To find what your environment will look like check out the VMware vCenter Server 6.0 Deployment Guide.
vCenter Server Appliance Upgrade from 5.x to 6.0
The upgrade process of vCenter Server Appliance (vCSA) version 5.x to 6.0 isn’t truly a upgrade but more of a migration. You are basically deploying a second vCSA that will migrate the hosts/inventory/IP address from the old to the new. You can only upgrade vCSA versions 5.1U3 and 5.5. The 6.0 vCSA is still based on SUSE Linux Enterprise 11 and now has the the same mins/max as the Windows installed version.
Before You Start:
There is some prep work you need to perform before doing the migration:
- Pick a host and ensure it has a standard switch with a vmnic uplink. Because Distributed Switches is a vCenter function it wants to perform the upgrade on a standard switch.
- Rename your current vCenter VM in the inventory so the new VM can be created as the same name. Otherwise the vCSA folders on the LUNs will not match.
- Have at least two available LUNs, one for your current vCSA and one for the new vCSA. Since you will want to deploy the new one with the same name they have to be on different LUNs
- The installation media is a .ISO instead of a .OVA. You will need to burn it to a disc, extract it, or mount it.
vCenter Server Appliance 6.0 – A Fresh Install
The VMware vCenter Server Appliance (vCSA) is a security hardened … Read more…
Unable to kill DCUI – ESXi 5.1
One of our ESXi 5.1 hosts entered a disconnected state with … Read more…