Saturday, November 14, 2015

Version 2 VM disk space detail send via email Powercli

1 year back I had written this script, and it became very much popular, Collect disk space detail and send it in email Powercli since then I started receiving emails for some more additions in the existing script. I am not a HTML guy but still tried to create one, Many of the people found they don't have to login each server to collect disk information, They just need to login vCenter (Powercli) which saves lots of time. Also to work this script correctly make sure all your VMs has VMWare Tools installed and running. Also my earlier script was pulling reports only for Windows and C drive.
I have improvised it little bit and added below information.
  • Information for all vmware vm disk usage,
  • Any disk has below 20% will be in Red.

This is the screenshot how collected information will looks like in the email.

Once you execute script you will see below results on the screen which can tell you from what vm and disk it is collecting information. I am running this one Windows server 2012 R2, Powercli version 5.5, vsphere 5.5.
Below is the code information
  #####################################    
  ## http://kunaludapi.blogspot.com    
  ## Version: 2    
  ## Tested this script on    
  ## 1) Powershell v4    
  ## 2) Powercli v5.5    
  ## 3) Vsphere 5.x    
  ##   Find and input your information in below lines in the script  
      ############################################################  
  ##   $vCenterServer = "vCenterserver"   
  ##   $vcenteruser = "domain\user"   
  ##   $vcenterpasswd = "Password"   
  ##       
  ##   From = "SpaceAlert@email.com"   
  ##   To = "Employee@email.com"   
  ##   SmtpServer = "smtp.exchange.com"   
  #####################################   
 begin {  
 Add-PSSnapin vmware.vimautomation.core   
 #vCenter username password   
 $vCenterServer = "vCenterserver"   
 $vcenteruser = "domain\user"   
 $vcenterpasswd = "Password"   
 #connect vcneter server    
 Connect-VIServer -Server $vCenterServer -User $vcenteruser -Password $vcenterpasswd   
  $FinalResult = @()   
  $Allvms = Get-View -ViewType “VirtualMachine” -filter @{”Guest.GuestState”=”running”}   
 } #begin  
 Process {  
 foreach ($vm in $Allvms) {   
     $Drives = $vm.Guest.Disk    
     Write-host "Collecting Information from $($vm.name)" -ForegroundColor Green  
     Foreach ($DriveC in $drives) {    
     #Calculations   
     $Freespace = [math]::Round($DriveC.FreeSpace / 1MB)   
     $Capacity = [math]::Round($DriveC.Capacity / 1MB)   
     $SpaceOverview = "$Freespace" + "/" + "$capacity"   
     $PercentFree = [math]::Round(($FreeSpace)/ ($Capacity) * 100)  
     $Disk = $DriveC.DiskPath.Substring(0,2)  
     #Report for all vms   
     if ($PercentFree -lt 20) {  
       $vmnameRD = "<tr><td bgcolor='#ff704d'>{0}</td>" -f $vm.name  
       $DiskRD = "<td bgcolor='#ff704d'>{0}</td>" -f $Disk  
       $FreesspaceRD = "<td bgcolor='#ff704d'>{0}</td>" -f $Freespace  
       $capacityRD= "<td bgcolor='#ff704d'>{0}</td>" -f $capacity  
       #$SpaceOverviewRD = "<td bgcolor='#ff704d'>{0}</td>" -f $SpaceOverview  
       $PercentFreeRD = "<td bgcolor='#ff704d'>{0}</td></tr>" -f $PercentFree  
       $finalResult += $vmnameRD  
       $finalResult += $DiskRD  
       $finalResult += $FreesspaceRD  
       $finalResult += $capacityRD        
       #$finalResult += $SpaceOverviewRD  
       $finalResult += $PercentFreeRD  
       Write-Host "`t `tCollected from $($DriveC.DiskPath) on $($vm.name)" -ForegroundColor Yellow  
     }#if  
     else {  
       $vmnameNL = "<tr><td>{0}</td>" -f $vm.name  
       $DiskNL = "<td>{0}</td>" -f $Disk  
       $FreesspaceNL = "<td>{0}</td>" -f $Freespace  
       $capacityNL= "<td>{0}</td>" -f $capacity  
       #$SpaceOverviewNL = "<td>{0}</td>" -f $SpaceOverview  
       $PercentFreeNL = "<td>{0}</td></tr>" -f $PercentFree  
       $finalResult += $vmnameNL  
       $finalResult += $DiskNL  
       $finalResult += $FreesspaceNL  
       $finalResult += $capacityNL  
       #$finalResult += $SpaceOverviewNL  
       $finalResult += $PercentFreeNL  
       Write-Host "`t `tCollected from $($DriveC.DiskPath) on $($vm.name)" -ForegroundColor Yellow  
     }#else  
   } #foreach drive  
 } #foreach vm  
 #region body  
 $Body = @"  
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
 <html xmlns="http://www.w3.org/1999/xhtml">  
 <head>  
 <style>BODY{background-color:#ffffff;}  
 TABLE{border-width: 1px;border-style: solid;border-color: #808080;border-collapse: collapse;}  
 TH{border-width: 1px;padding: 0px;border-style: solid;border-color: #808080;background-color:#808080;color: white;}  
 TD{border-width: 1px;padding: 0px;border-style: solid;border-color: #808080;}</style>  
 </head><body>  
 <H2>VMs DiskSpace usage report</H2>  
 <table><colgroup><col/><col/><col/><col/><col/></colgroup>  
 <tr><th>VMName</th>  
 <th>Disk</th>  
 <th>Free(MB)</th>  
 <th>Total(MB)</th>  
 <th>%Free</th></tr>  
 $finalResult   
 </table>  
 </body></html>  
 "@  
 #endregion body  
 }#process   
 end {    
  #Send Email   
  $messageParameters = @{   
  Subject = "Alert! VMs with less than 20% on diskspace marked Red"  
  Body = $Body  
  From = "SpaceAlert@email.com"   
  To = "Employee@email.com"   
  SmtpServer = "smtp.exchange.com"   
  }  
 Send-MailMessage @MessageParameters -BodyAsHtml
 }  

Check earlier blog:
Collect disk space detail and send it in email Powercli

vSphere Datastores inventory report powercli - Volume 2

Thursday, November 12, 2015

Powershell add A resource records in DNS Domain oneliner


This is a small article on how add A resource record in DNS server. Also in the last I am going to show how to add Resource record inside domain using powershell. Here I will be demostrating below 3 cmdlets. 
Add-DnsServerResourceRecordA
Add-DnsServerResourceRecord
Get-DnsServerResourceRecord

My DNS server is running on windows server 2012 R2. In this tutorial I have downloaded and  installed RSAT remote server administration tools on my Windows 8.1 desktop, so I can configure dnsserver remotely, once RSAT is installed go to Control Panel >> Programs >> Turn windows Features On and off  >> Remote Server administration tools,  install DNS administration tools,  now I can manage my DNS server remotely, specifically I have installed DNSSERVER powershell module. (Whenever first time I run any DNS related command to DNSServer module it loads it automatically, I dont need to import it explicitly on windows 2012 and 8)

Checkout my another Article: Powershell find missing associated PTR resource records in DNS Server
 
As above screenshot I have added DNS record entry for TestMachine01 - 192.168.33.150. Open  Powershell, and fire up below command 
Add-DnsServerResourceRecordA -Name TestMachine01 -IPv4Address 192.168.33.150 -ZoneName vcloud.lab -ComputerName Ad001 -CreatePtr

Note: To view the changes in DNS manager you will need to right click and refresh the zone, if you have already opened DNS manager.

I have break down command in as below .
Add-DnsserverResourceRecordA = This is the CMDLET used to add A resource record only.
-Name TestMachine01 = -Name is parameter and TestMachine01 is computer name of A resource record name.
-IPv4Address 192.168.33.150 = This self explanatory.
-ZoneName vCloud.lab = vCloud.lab is my zonename.
-ComputerName AD001 = -ComputerName is parameter for Dnsserver, AD001 is my DNSserver.
-CreatePtr = This is optional, if you want to create ptr (Reverse lookup record entry).

This part is to add only single DNS host entry, what if you want to add multiple resource record from excel file, Here is below step by step tutorial. I have saved excel file as csv. (and it is saved in c:\temp location).

When I open CSV in notepad, data looks like this
Now in the powershell fire below command 
Import-Csv C:\Temp\DnsEntries.csv | ForEach-Object { Add-DnsServerResourceRecordA -Name $_.Name -IPv4Address $_.IPv4Address -ZoneName vcloud.lab -ComputerName Ad001 -CreatePtr}

This will import csv file and it will piped into foreach-object loop, then foreach row record is added (value of $_ is always get changed row changes)
Now we have added these records how do I verify it. use Get-DnsServerResourceRecord command
For single computer:
Get-DnsServerResourceRecord -Name TestMachine01 -ZoneName vCloud.lab -ComputerName Ad001 

For mulitple computer we will use the same CSV file format. (IPv4Address column is not required)
Import-csv C:\temp\DnsEntries.csv | ForEach-Object {Get-DnsServerResourceRecord -Name $_.Name -ZoneName vCloud.lab -ComputerName Ad001}

This tutorial ends here, and now I want to show how to add resource record entry in Domain created under DNS Zone. I have one Dns zone name local and under it there are mulitple Domains. and I will be using Mylab domain as a demo.
Earlier I used command Add-DnsServerResourceRecordA as a demo in this I am showing another Powershell command Add-DnsServerResourceRecord. differance between both is there A missing in the last of Add-DnsServerResourceRecordand only capable of creating any record, in contrary Add-DnsServerResourceRecordA shown earlier can only create A resource record. Command can create all type of record but the resource type need to be mentioned, as i done below -A

Add-DnsServerResourceRecord -Name Lab002.MyLab -IPv4Address 192.168.32.152 -ZoneName Local -ComputerName Ad001 -A
 
To breakdown above command I have suffixed .Mylab domainName in the -Name and additional parameter is -A to declare it is host A record.

For adding multiple host A record entries use below one-liner.
Import-Csv C:\temp\DnsEntries.csv | ForEach-Object {Add-DnsServerResourceRecord -Name $_.Name -IPv4Address $_.IPv4Address -ZoneName Local -ComputerName Ad001 -A}

And in the last to collect and verify added records by using below oneliners
For single computer
Get-DnsServerResourceRecord -Name Lab002.MyLab -ZoneName Local -ComputerName Ad001

For multiple computer
Import-Csv C:\temp\DnsEntries.csv | ForEach-Object {Get-DnsServerResourceRecord -Name $_.Name -ZoneName Local -ComputerName Ad001}

Sunday, November 1, 2015

Poor man's inventory website using Powershell

I am always fascinated by HTML Inventory webpages scripts written by Don Jones's EnhancedHtml module and Alan Renouf's vCheck report. And always wanted to write same kind of my own script which will generate information data in the Web pages and they are linked to each other, Now I would like to proudly present my own version of script which creates complete website for given computer. 
It took me around 3-4 days to write this script, For all the Powershell writing it took me 1 hour, But combining and calibrating HTML and CSS coding with PowerShell took me all those 3-4 days, As this was my first time to write WebPage was great experience for me. (I don't have any knowledge on HTML, I written all these stuff by reading tutorial on http://www.w3schools.com, They have some great serious tutorials on HTML, JavaScript, CSS, Angular and so on... I went through almost all the tutorial on the site) You can download Web site creation script below. File name is ComInvScript.zip. All my testing done is on Windows 2012 R2, Windows 7, they are working fine, and collecting all required reports. This is just for demo purpose and I am still working on this script to make it compact and understandable.
Download Script
Download Script files

Here is this cool video how to run this script and how the collected and generated wesite looks like. Work is in still progress.

As of now this is just a demo script I have downloaded to get feedback from you which pulls some good information using WMI., Computer information pages are all I have designed and thinking what information I can put and thinking more on web pages designing, I tried to make Computer Information pages as fancy as possible and tried to add more data, now looking feedback from you.

This is a step by step demo how you can use the given script to build your own website hosted on either IIS or Apache.

Download the zip file, (I downloaded it on c:\scripts). and extracted it in same folder with same zip file name.
Once you extract zip file you will find there are 3 contents (1 folder and 2 files).
1) Images - Folder contains all the images required for your website
2) Get-ComputerInventory.ps1 - This script file will be executed to collect information from serverslist.txt. and create linked webpages for each server.
3) Serverlist.txt - You will have to put your server names in This text file.

Note: Do not to rename or change any file of folder names, and keep them in same folder.
Once you are all set with server list names. Open powershell (make sure you have script execution policy set to remotesigned at list. checkout my earlier blog to set-executepolicy), Next change (cd) the directory where my script and other supported files are located and execute that ps1 file.

make sure you are prefixing ./ the ps1 file.
./Get-ComputerInventory.ps1
and hit enter.


When the ps1 is executed completely, It will open inventory.html file, and also you can check the all the generated web pages under C:\Temp\WebSiteData. Here I am attaching those HTML files here to view how this website looks like. extract it anywhere you want and open InventoryList.html in browser. First page InventoryList.html is not well designed and I am still working on it.
WebSiteDataDemo
WebSiteDataDemo.Zip

Stay tune for more updates.
I have put this project on GitHub.

Saturday, October 24, 2015

Powershell Add or Remove members from Remote Group Module

To show this demo I am using 2 computers, one is Windows 2012 R2 (192.168.33.11) and another is windows 7 (192.168.33.16), From Windows 2012 R2 I will be executing all the commands remotely on 192.168.33.16. Both the commands use ADSI API to do the Addition or removal task., To know more example use Get-Help CMDLET -full to know more information. 



Why I wrote this article or script?
Earlier I written article on how to add users to group using Group Policy, It is not easy if you want to add users or group certain computers, you can do that through creating OU. But again inventory thing is not possible using it.

Remove-GroupMember
In earlier article I showed how to get information remotely using Get-GroupMembers cmdlet. I showed some cool csv file containing the data.
Lets say now we have data, Next what you want to Remove them Remotely. This Remove-GroupMember cmdlet is handy. To show the demo I will be removing vcloud\Devil user from "Remote Desktop Users" Group.
Simply in the powershell run below command. (To check how loaded module check my previous article Get-GroupMembers ).

Get-GroupMembers -ComputerName 192.168.33.16 -RemoteGroups "Remote Desktop Users"

vKunal is the user in vCloud Domain. (vcloud\vkunal)
Remove-GroupMember -ComputerName 192.168.33.16 -RemoteGroup "Remote Desktop Users" -Domain vcloud -User vkunal

(Tip: You can run Get-Help Remove-GroupMember,  To know on additian help.)

It detect if machine is not reachable, and will not go checking the server, even if some parameters are incorrect it will show message. you can verify Group members using Get-GroupMembers again.



https://drive.google.com/folderview?id=0B9eArMQqZh_wYkY0cGliTkZ3MVE&usp=sharing

Add-GroupMember
As Remove-GroupMember is handy command to Remove member remotely, Add-GroupMember has its own magic. Many times we get request to add users or groups to multiple server's group. Earlier I removed vcloud\vkunal from remote Desktop users, Now I will be using vCloud\Devil user and Group vCloud\DemoGroup.

Here is the Demo.

Add-GroupMember -ComputerName 192.168.33.16 -RemoteGroup "Remote Desktop Users" -Domain vCloud -User Devil

Add-GroupMember -ComputerName 192.168.33.16 -RemoteGroup "Remote Desktop Users" -Domain vCloud -User DemoGroup



It may be possible that both 192.168.33.11 and 192.168.33.16 may not be in same domain, at that time you can use -Credential (Get-Crendential) parameter, These parameters can be used in all the cmdlet Add-GroupMember, Remove-GroupMember or Get-GroupMembers.

Next is verification using Get-GroupMembers. 2 Members are listed.
https://drive.google.com/folderview?id=0B9eArMQqZh_wYkY0cGliTkZ3MVE&usp=sharing
Other usefull Scripts
Get members from Remote Groups
List account configured on logon of Windows Service - Powershell

Powershell Module Get members from Remote Groups

Keeping servers compliant is very challenging task when it comes to maintaining Administrators group or other privileges on the servers, Many times we apply changes on the servers, assign admin rights by adding User accounts in local server Administrators group or any other Groups example Remote Desktop Group which we are not suppose to do, and forget. When auditing days comes we do repetitive manual task, log onto each server pull reports, validate, and goes on...

Many times user account groups are added through some change management process or ticketing tool, some time those tools doesn't help to track or list what those users permissions are on the servers, or when we can revoke them, Specially when you want to go for some company ISO certification this is one of the condition to comply with. (I might be talking some high level stuff regarding compliance but I have seen people struggling with these small stuffs, and spent long time to nailed it but still end of the day some servers are still missing or due to human mistake)

Here PowerShell comes to rescue. I have written a simple module which can collect information whats members (users or Groups) are in Administrators Group on Remote Server, or any other group, Under the hood it uses WMI to get information. for addition and removal it uses ADSI., You can keep complete lifecycle of Group membership with this module.
https://drive.google.com/folderview?id=0B9eArMQqZh_wYkY0cGliTkZ3MVE&usp=sharing
This module can be downloaded from here. I am using Windows 2012 R2 and windows 7 and 8.1 in my production, and written these scripts using Powershell version 4. To use commands Add-GroupMember and Remove-GroupMember this is the Article Powershell add or remove-members from Remote Group.


There are two files in the zip file, unzip them and keep it under your %Userprofile%\documents\WindowsPowerShell\Modules\GroupMembers as shown in the screenshot.
Open Powershell with Run as administrator, By default I was not able to execute any script, so to change the behavior I set my script execution mode to bypass using below command (You can ignore if you can already execute script)

Set-ExecutionPolicy Bypass

Next is Import-Module GroupMembers, it will load 3 commands in the powershell memory.
3 Cmdlets are
  1. Get-GroupMembers
  2. Add-GroupMember
  3. Remove-GroupMember
(Tip: Even if you don't import module, when you execute any of above command, it will automatically, load module in Powershell 4 and above version.)

First demo I will be showing for command Get-GroupMember, it uses WMI to get all the information.

Get-GroupMembers -ComputerName 192.168.33.16, 192.168.33.17 -RemoteGroups Administrators, "Remote Desktop Users", Below is the results how they look.
Now in the below demo I will get information from AD computers and export it to CSV/Excel file. Also I have created log file for failed computers.

Get-ADComputer -Filter * | Get-GroupMembers -RemoteGroups Administrators -Logfile c:\temp\failed.txt | export-csv c:\temp\Mylist.csv

There are 2 files created under c:\temp, failed.exe contains, unable to get results, and mylist.csv file has the data.


https://drive.google.com/folderview?id=0B9eArMQqZh_wYkY0cGliTkZ3MVE&usp=sharing
In the next article I will be writing how to use Add-GroupMember and Remove-GroupMember commands.

Other useful Scripts

List account configuredon logon of Windows Service - Powershell


Wednesday, September 16, 2015

Powercli Get-Esxcli install VIB files

In my earlier blog Using Powercli to copy files from your computer to Esxi server I successfully able to install vib file using plink.exe tool but not through Powercli Get-Esxcli command. after lots of trial and error I have came to conclusion to install plain VIB you will have to use offline bundle only (If anyone knows the solution suggestions are welcome). I have downloaded offline bundle for Esxi web as a zip file and copied it on datastore.

Read my earlier blog for Using Powercli to copy files from your computer to Esxi server
Next is uninstalled the already installed software, I will be removing it using SSH again, my command is kept under c:\temp\command.txt and it contains line
esxcli software vib remove -n esx-ui

Next on the powershell console using plink tool i have executed command.txt on esxi server.
Write-Output "yes" |  plink.exe -ssh root@192.168.33.21 -P 22 -pw Computer@1 -m 'c:\temp\command.txt'

It has given me message operation finished successfully and VIB is removed.
Now we will need to create a esxcli connection to server over powercli.  
$esx =  Get-VMHost 192.168.33.21 | Get-EsxCli
all the session details will be saved in $esx. which can be used later against the connected esxi server.
$esxcli.software.vib.install("/vmfs/volumes/datastore1/esxui-offline-bundle-3023372.zip",$false,$true,$true,$true,$false,$null,$null, $null)

Above command is to install the offline bundle. make sure you are maintaining character caps and small letter while providing offline bundle path. You will get successful message on the server and it will require reboot.
Once i reboot the server and create I connected to esxi server again running connect-viserver, and Created connection to vmhost using esxcli and session is stored in $esx (to verify software is in the list and correctly installed).
$esx.software.vib.list() | ft
Although there is another command to install esxi offline bundle using Install-VMHostPatch, its fairly easy.

Using Powercli to copy files from your computer to Esxi server

My next article: Powercli Get-Esxcli install VIB files
 
This step by step guide on coping files using Powercli, for this you will have to install powercli on you computer. Open powercli.
Next fire up command connect-viserver to connect your esxi or vCenter, think it as, you are connecting through vsphere client GUI, It will ask for credentials (I am connected here to my esxi directly.)
Then next you will see powercli is connected to esxi server. Now we will be coping file on the datastore, All the datastores are listed under vmstore: or vmstores: drive (This is a drive letter for esxi datastores, think it as your c: or any other drive), to go to datastore directory type

cd vmstore:\ha-datacenter\datastore1


I have only one local datastore on my esxi server and name is Datastore1, To view the list of all datastores you can run command Get-Datastore. I have created new directory, as you can see that is visible on GUI as well.
I have downloaded vib file and kept it on my computer under c:\temp (this is my favorite location to keep my testing stuffs)
Next command I am mounting datastore1 as a mapped drive on powercli, it will be visible on the same only., and my mapped datastore drive volume is vDATA. (also this step is not require but i am showing you it as an extra one, always good to have multiple tricks in your memory, to copy files you will need to use special command which I will be showing next, you can also use vmware drive vmstore: as it is already mapped incase if you want to skip below command)
Get-Datastore datastore1 | New-DatastoreDrive -Name vDATA
I am into datastore now by running command cd vDATA:\VIb, it will change the location of current drive.
Below is the special command to copy files to datastore and vice versa, your powershell native command copy-item will not work as windows and vmware both are different drive providers.
Copy-DatastoreItem -Item c:\Temp\esxui-3015331.vib -Destination vDATA:\VIB
and run dir to verify file has been copied, you can verify the same in GUI client also.
Now we have copied file we will be installing it, for the installation i will be using plink.exe tool, (I tried using Get-EsxCli to install this plain VIB file, tried all the possible parameters but every time it failed, if anyone know the correct parameters or if anyone is successful, suggestions are welcome, Just to add I am able to successfully install offline bundles through Get-Esxcli command Powercli Get-Esxcli install VIB files). Plink.exe is putty tool and I will ssh into esxi, but it will be completely automated.
To use plink we will need to be enable SSH on the server. To enable run below command.
Get-VMHost 192.168.33.21 | Get-VMHostService | Where-Object {$_.Lable -eq 'SSH'} | Start-VMHostService
it will start ssh service on esxi.

 Next i created one text file on c:\temp and written one command. That command is actually going to be executed on esxi server, it will be completely automated. (If you check my earlier blogs, I have used plink tool heavily for the internal configuration which is not possible through GUI or Powercli example: Changing Motd banner and Download logs from esxi server where everything is completely automated through plink.exe) 

As below command is going to be run on esxi, make sure your folder name are proper in caps or small letters as esxi is case sensetive. File name is command.txt containing below command.
esxcli software vib install -v /vmfs/volumes/datastore1/VIb/esxu1-3015331.vib 

I have kept my plink file under c:\windows, this way I don't have to do extra configuration on environment variable, On my powercli console: 
Write-Output "yes" | plink.exe -ssh root@192.168.33.21 -P 22 -pw Computer@1 -m 'c:\temp\command.txt'

Once you execute command you will see message operation finished successfully, not reboot required no need to put server into maintenance mode for this software, and the name of vib which has been installed.
below step you can do earlier as well when you finished coping file, but I prefer in the last what if copied file is corrupted. Remove-PSDrive vDATA will unmap mapped datastore drive.
Vib file i installed was vmware host web client. you can find more on information on about this cool fling from vmware. https://blogs.vmware.com/vsphere/2015/08/introducing-vsphere-host-client-fling.html

Below is the summary from fling website for the ESXi Embedded host client.

Summary

This version of the ESXi Embedded Host Client is written purely in HTML and JavaScript, and is served directly from your ESXi host and should perform much better than any of the existing solutions. Please note that the Host Client cannot be used to manage vCenter. Currently, the client is in its development phase, but we are releasing this Fling to elicit early feedback from our users to help guide the development and user experience that we are creating. As such, the client is not fully featured and only implements a hand full of the most important features. Some of these include:

  • VM operations (Power on, off, reset, suspend, etc).
  • Creating a new VM, from scratch or from OVF/OVA (limited OVA support)
  • Configuring NTP on a host
  • Displaying summaries, events, tasks and notifications/alerts
  • Providing a console to VMs
  • Configuring host networking
  • Configuring host advanced settings
  • Configuring host services
We welcome any feedback and bug reports at this early stage. However, rather than reporting on missing features, we are very much interested in your thoughts on the layout, user experience, and performance of the host client.

Known Issues


  • On ESXi hosts which are assigned a VMware vSphere Hypervisor license, all modification operations will fail silently. We are working on a solution to this issue.
  • On ESXi hosts which have a sub-domain name with large, shared cookies a web console session may fail to initialize. A workaround is to clear cookies or run the host client in an incognito-type window.
  • For ESXi 5.5U2 and prior, and ESXi 6.0 hosts upgraded from any 5.5U2 or prior version, you will get a 503 error returned after visiting https://<esxhost>/ui/. To resolve this issue, please remove the line starting with /ui from /etc/vmware/rhttpproxy/endpoints.conf and restart rhttpproxy with /etc/init.d/rhttpproxy restart
  • For ESXi 5.5 hosts, in-browser consoles are not supported. Please use VMRC to access guest VM consoles.
  • For ESXi 5.5U2 and prior hosts, you must ensure to append a trailing / (forward slash) to the URL after /ui. The URL must be https://<esxhost>/ui/
  • For some Windows guests, send Ctrl-Alt-Del does not work.
Other
If you need an offline bundle of the VIB for use with VUM, you can download it here.




Monday, September 14, 2015

Configuring Microsoft iSCSI Target datastore on Esxi server and multipathing Step by Step

In Microsoft Windows 2012 and above there is cool role is introduced by Microsoft. Name of the role is iSCSI Target Server under File and Storage services. (Although there is same software provided by Microsoft earlier now they have given the same as role inbuilt in Server 2012, Earlier version iSCSI Target configuration), I used it to configure my Microsoft Clustering LAB, as it required shared storage. You can use Microsoft windows 2012 iSCSI Target is better substitute to freeNas or Openfiler.

Userful Script on reporting

vSphere Datastores inventory report powercli - Volume 2


What is iSCSI Target Server? 
This server provides Block level storage. iSCSI Target (Server) shares LUNs with initiators (Clients) using iSCSI protocol over TCP-IP Network. Shared block storage act as local disk to the OS.

In this article I will be using iscsi target to present Datastores to ESXi Servers with Multipathing. Here I have Esxi Servers with two dedicated network cards carrying only Storage traffic IP series 172.16.1.0/25. Both NIC cards are connected to separate switches and my iSCSI storage server has two Ethernet cards are connected to same Switch1 and switch2 respectively. This way I get redundancy if any one of my network card or any one of my switch fails still my traffic is flowing through another Path. In this Article I am going simulate the same thing.
As a start i want you to show how my Ethernet card IP address settings looks like. I have this configuration on my Windows iSCSI Target Server. There are 2 Ethernet cards and each terminated to its own switch. On the same switches my esxi server is connected.

On my esxi server I have completely separate virtual standard switch for Storage traffic. (Select esxi server from vcenter inventory, Select configuration tab, to Networking under hardware at left panel)
And this is my configuration for iSCSI-Storage 01 and 02 port group.  iSCSI-Storage01 has Active adapter  vmnic3  and others in unused (they will not be utilised) and vise versa setting on iSCSI-Storage02 portgroup. This is required to configure vmware multipathing.
Above was how my configuration on both iscsi target and esxi server looks, next I will be configuring iSCSI Target server from scratch. Open Server Manager, Click Manage at the right click top menu. And select Add roles and Features.
 Next 3 windows nothing to configure much click next trice
 Select checkmark iSCSI Target Server under File and storage Services, next is Feature nothing to configuration and click install after confirming the summary.
Once role is installed we will configure it.
On the server manager click File and storage Service on the right panel to configure further installed role.
 Select iSCSI and under task click New iSCSI Virtual Disk or click To create an iSCSI virtual disk, start the new iSCSI Virtual Disk Wizard.
Next provide the path where all the iSCSI virtual disks (vhdx) will be kept on servers local disk, Name the disk, it will suffix required extension vhdx automatically.
Next screen is what would be Lun size.  for size format I will be using vmware terminology.
Fixed Size -- Thick Provisioning
Dynamic Expanding -- Thin provisioning.
Differencing - Linked clone
Next Screen create a new iSCSI Target instance.
Name the target instance,  This is step where we will be adding esxi server IQN's I have added both esxi server's IQNs.
Where do you find those IQN's and what is IQN?
IQN is iSCSI qualified name it is same as something MAC address to NIC card, whenever Data is exchanged between iSCSI target and iSCSI initiator this IQN number is used as the identifier.

To find IQN on esxi server, go to Configuration tab of esxi server, select Storage Adapter from Hardware left panel, select iSCSI Software Adapter and you can copy past iSCSI name
 
Incase if are unable to fine iSCSI Software Adapter you will need to add it as show above and below screen will be pop up.
 Back to previous screen on windows. if you have found IQN number. Next screen has all the summary, start next.
It will take some time to fully create fixed virtual disk. an you will the result as one iSCSI target and attached disks, you can now add more disk you want. to the same target.
Here we are done with Windows server configuration and other all configuration is on Esxi server.
Go to iSCSI software adapter click Properties.
 On the Dynamic Discovery tab click and provide iSCSI server any of one IP, don't type all the IPs.
 Esxi will detect all the Target ports and they will be visible in the Static Discovery Port.
Next we need to configure Port binding in the Network Configuration tab click add and add both the iSCSI vmkernal and associated Physical adapter for both adapter do add bindings. (Above I had already make only one vmnic active to vmkernel port and others are in unused, without that step you will not see iscsi adapters in the binding or they will not be complient)
You should see something like this once you add both VMKernel port groups. Click close to rescan (refresh and discover luns presented for iSCSI target server)
Once rescan is completed you will see one LUN is visible right click it go to Managed Paths.
On the Managed Paths you will see there are 4 paths redundancy available. And path's status is active. 
Here I will simulate some real production scenario, what will happen if one of the physical switch is done. Lets pull the network cable from one of the ESXi Storage dedicated network card.
I pulled cable from vmnic3 and my 2 paths are dead and 2 paths are still available, Pretty cool haa....