Updated flings for Horizon View

The last couple of weeks some of the flings applicable for Horizon View and that I had in my VMUG presentation have been updated. The Horizon Toolbox 2 has been updated so it now supports console access for vCenter 6.0u2 and 6.5 + it now supports horizon 7.1. The Horizon OS Optimization Tool got several bugfixes.

Recent change for the Horizon Toolbox 2:

2017-Mar-17 Horizon Toolbox 2.1.3

New Features

  • Support new Horizon version(7.1)
  • Support new VCenter version(VC6.5 and 6.0u2a) in Console Access feature

 

Recent changelog for the OSOT:

April 27, 2017 b1090b

  • Issue Fix: “the node to be removed is not a child of this node” when opitimize windows 10 template
  • Issue Fix: System.NullReferenceException occurs if the network can’t reach any of the public template repository.
  • Template Update (Windows 7/8/8.1): Correct the Menu Show Delay type to REG_SZ in item “Reduce Menu Show Delay”

April 18, 2017

Issue fixed

    • Some optimization items are skipped mistakenly. For example, Remote Apps in Windows 10 template. This is caused by a recent change in Conditional Check feature.

April 17, 2017 b1088

Feature

      • Conditional Check: you can specify on what condition an optimization should be run. For example, when a specific registry key match certain value.

Template

      • “Change Explorer Default View” has been changed to unselected by default, because of conflict to UEM. Details: it causes the locations in “user files” (desktop, downloads, favorites, music, videos , Documents, Pictures) folder is to the local drive c:\Users\Username, its Should be \\server\folder_redirection\%username% when use UEM folder redirection.

Enhancements

      • Public Templates tab: click template on the list is very slow, which should not be
      • Default public template repository URL updated
      • Loading public template repository takes too long

Issue Fix

    • Field validation: prevent user from creating template with blank name

VMworld EU here I come!

Wow just wow, it just got announced that I will be going to VMworld for a second time. Last year my boss let me choose what edition to go to so I ended up in Vegas for the first time. This year I have won a ticket in the Dutch VMUG Usercon lottery by VMware Netherlands (for DUtch readers: https://t.co/1L1YAq7PiX ). After the event three potential winners were announced and we had to write a motivation piece why we needed to win the ticket.

I decided to write my piece about how vExperts just belong at VMworld but also what the VMworld experience is about for me: networking with peers, customers and suppliers and gaining knowledge. Another thing I promised is blogging about the event, last year I did daily blogs about what happened the afternoon and night before and the morning of the current day. I am not sure yet how I will do it this year but it might be the same principle because writing a blog after a party late in the evenings might prove to be difficult.

Another thing I mentioned is doing a vBrownbag again. For this I have absolutely no idea yet on the content but there’s quite a few months left so something will pop up in my mind.

So in short: I’ll see you all in Barcelona this year!

Using PowerCLI to get Horizon view status & events

Update: There is a new way to pull the event information without having to enter the sql password please see this post about it.

So two weeks ago I had a nice little post about talking to Horizon View using PowerCLI. I also promised to be digging a bit more into PowerCLI by grabbing the script posted on the VMware blog and editing it a little to my taste. It’s a very useful script they have on there but still I prefer to know what might have caused the issues. I decided I needed to know who the last user was that used the desktop and the last entry into the eventlog and the time of that log. So actually most code used talks to the eventlog database, something already available pre PowerCLI 6.5 but what I hardly ever used.

The basics for connecting I won’t post but we do need an extra connection and that is to the event database:

$eventdb=connect-hvevent -dbpassword $hvedbpassword

As with the Horizon View connection it’s best to put this into a variable so it can be used later on. The $hvedbpassword should be the password for the user that View uses to connect to the database server in plain text! Earlier in the script I read the password from hashed contents in a text file.The request has been dropped to be able to pass encrypted credentials and/or creta a credentialstore for this.

Next up is grabbing the events for a certain Desktop

$lastevent=get-hvevent -hvdbserver $eventdb -timeperiod 'day' -messagefilter $problemvm.base.name

This could use some rework since I would prefer the time period to be a variable based on the current date but if the event is older then a day it will be hard to find anything on it anyway.

if ($lastevent.events){
$lasteventtime=$lastevent.events | select -expandproperty eventtime -first 1
$lasteventmessage=$lastevent.events | select -expandproperty message -first 1 
$lasteventusername=$lastevent.events | select -expandproperty Username -first 1 
}

This grabs the latest event, the time it happened and the user it happened to. This can be anything including a logoff. It might be able to help you why a lot of desktops are ending up in a rotten state.

The rest of the script is basic building of arrays, filling them, mailing it etc etc. So still not a lot of complicated code that some people build but it’s a bit of the basics in talking to the View Api and the event database.

This is the output you will get (this is from an html file and heavily edited to anonimize it)

The complete script, please do use and abuse it to your own taste as I have done with the original:

#########################################################################################
#																						#
# Get List of Desktops that are not available or connected		 						#
# This is based on the script posted here:												#
# https://blogs.vmware.com/euc/2017/01/vmware-horizon-7-powercli-6-5.html				#
# Required:																				#
# Powercli 6.5 Release 1																#
# The VMware.Hv.Helper Module from https://github.com/vmware/PowerCLI-Example-Scripts	#
#																						#
#########################################################################################

#region variables
#########################################################################################
#								Variables												#
#	Password files need to be filled firs using:										#
#	Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File 'filename.txt'		#
#	Enter password and press enter														#
#	vCenter things have been marked out but I left them in here 						#
#	because they might be usefull for when someone else uses this script				#
#########################################################################################
$cs = "connectionbroker"														# Horizon Connection Server
$hvcsUser= "Service_Account"													# User account to connect to Connection Server
$hvcsPassword = get-content .\hvcs_Credentials.txt | convertto-securestring		# Password for user to connect to Connection Server
$csDomain = "domain"															# Domain for user to connect to Connection Server
$hvedbpassword=get-content .\hvedb_Credentials.txt | convertto-securestring   	# password to access event database
$mailto="[email protected]"														# Address to send the status mail to
$mailfrom="[email protected]"											# Address to send the mail from
$mailsubject="Overview bad VDI desktops"										# Mail subject
$smtpserver="mailserver.domain.com"												# Mail server			
#$vcuser="vcuser"																# User account to access the vCenter server
#$vcpassword=get-content .\vCenter_Credentials.txt | convertto-securestring		# password to access the vCenter server
#vc = "Enter vCenter name"														# vCenter Server



$baseStates = @('PROVISIONING_ERROR',
                'ERROR',
                'MAINTENANCE',
                'DISCONNECTED',
                'AGENT_UNREACHABLE',
                'AGENT_ERR_STARTUP_IN_PROGRESS',
                'AGENT_ERR_DISABLED',
                'AGENT_ERR_INVALID_IP',
                'AGENT_ERR_NEED_REBOOT',
                'AGENT_ERR_PROTOCOL_FAILURE',
                'AGENT_ERR_DOMAIN_FAILURE',
                'AGENT_CONFIG_ERROR',
                'UNKNOWN')
				

#endregion variables

#region initialize
###################################################################
#                    Initialize                                  #
###################################################################
# --- Import the PowerCLI Modules required ---
Import-Module VMware.VimAutomation.HorizonView
Import-Module VMware.VimAutomation.Core

# --- Connect to Horizon Connection Server API Service ---
$hvServer1 = Connect-HVServer -Server $cs -User $hvcsUser -Password $hvcsPassword -Domain $csDomain

# --- Get Services for interacting with the View API Service ---
$Services1= $hvServer1.ExtensionData

# --- Connect to the vCenter Server ---
#Connect-VIServer -Server $vc -User $vcUser -Password $vcPassword

# --- Connect to the view events database ---
$eventdb=connect-hvevent -dbpassword $hvedbpassword

#endregion initialize

#region html
###################################################################
#                    HTML                                         #
###################################################################

$style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
$style = $style + "TD{border: 1px solid black; padding: 5px; }"
$style = $style + "</style>"

#endregion

#region main
###################################################################
#                    Main                                        #
###################################################################
[email protected]()
#Write-Output ""
if ($Services1) 
	{
     foreach ($baseState in $baseStates) 
		{
           # --- Get a list of VMs in this state ---
           $ProblemVMs = Get-HVMachineSummary -State $baseState

           foreach ($ProblemVM in $ProblemVMs) 
		   {
		   			$lastevent=get-hvevent -hvdbserver $eventdb -timeperiod 'day' -messagefilter $problemvm.base.name
			
				if ($lastevent.events){
					$lasteventtime=$lastevent.events | select -expandproperty eventtime -first 1
					$lasteventmessage=$lastevent.events | select -expandproperty message -first 1 
					$lasteventusername=$lastevent.events | select -expandproperty Username -first 1 
					}
				else{
				$lasteventtime="Last event is longer then 1 day ago"
				$lasteventmessage="Not Available"
				}
			$lastmaintenancedate=(Get-HVMachine -machinename $problemvm.base.name)
		   	$item = New-Object PSObject
			$item | Add-Member -type NoteProperty -Name Name -Value $problemvm.base.name 
			$item | Add-Member -type NoteProperty -Name State -Value $problemvm.base.basicstate 
			$item | Add-Member -type NoteProperty -Name Pool -Value $problemvm.namesdata.desktopname
			$item | Add-Member -type NoteProperty -Name Last_event_time -Value $lasteventtime
			$item | Add-Member -type NoteProperty -Name Last_event_user -Value $lasteventusername
			$item | Add-Member -type NoteProperty -Name Last_event_message -Value $lasteventmessage
			$Problemarray+= $item
           }
		}
	
		if ($problemarray)	
			{
			$mailbody=$Problemarray | sort state,name | convertto-html -head $style -property  name,state,Pool,Last_event_time,Last_event_user,Last_event_message | out-string
			send-mailmessage -smtpserver $smtpserver -to $mailto -from $mailfrom -subject $mailsubject -body $mailbody -bodyashtml 
			}
		else
			{
			send-mailmessage -smtpserver $smtpserver -to $mailto -from $mailfrom -subject $mailsubject -body "No problems found in the Horizon View Environment" 
			}

     Write-Output "Disconnect from Connection Server."
     Disconnect-HVServer -Server $cs -confirm:$false
		} 

else 
	{
     Write-Output "Failed to login in to Connection Server."
     
     }
# --- Disconnect from the vCenter Server ---
#Write-Output "Disconnect from vCenter Server."
#Disconnect-VIServer -Server $vc
#endregion main

 

 

Talking PowerCLI against Horizon view (basics)

You know that VMware product that really lacked on the PowerCLI front called Horizon View? Well from PowerCLI 6.5 R1 it finally (try to imagine saying this like The Rock : Finally Powercli has come to Horizon View!) has its own module that you can use to talk to Horizon View and the View API’s.

Offcourse i am not the first to write about it and lots can already be found at the above link to the VMware blog by Graeme Gordon but I did want to share a couple of easy commands with you. I will not bore you with how to set it up because that’s already perfectly explained in Graeme’s post.

First we need to connect, looks like the connect-viserver right?:

connect-hvserver SERVERNAME

you will get a popup box for credentials, I haven’t found an option yet to do something like new-vicredentialstoreitem yet but you can use a hashed password in a text file.

Now for example to retrieve all disconnected desktops

Get-HVMachineSummary -State DISCONNECTED

This can be changed to whatever states are available for desktops.

One of the things Horizon View always lacked was proper reporting for desktop counts i.e. how many desktops are in what state. Lots of people had to use things like scripts that counted them from the adam database (sloooooow) or used tools like the VMware Horizon toolbox 2. To get a count is now really easy with powercli, just repeat the above command and do a count on it.

(Get-HVMachineSummary -State DISCONNECTED).count

For me this was a matter of a second with over 900 desktops available.

Want some information about a single desktop?

get-hvmachinesummary -machinename "machinename" | fl

In short you can find anything you want with the command or by using the View API’s. Since I am not an APi expert myself I would recommend heading over to the API browser and see what you want to use.  In my next post I will dig into the command a bit more by grabbing the script from the VMware blog post and editing it more to my taste.

Can you smellllllll what The Rock is cooking?

Altaro VM backup 7: the restores (part 2)

So a couple of weeks ago I managed to get my homelab backups running with Altaro.  Backups off course are nice but are worthless if you can’t recover them. This is  why this 2nd and last part of mini serie is about restoring the backups. Altaro has several options available: Restore clone, to a different host, File level restore and Exchange Item level restore plus the option to do a sandbox restore or simulation for testing those backups.

Table of Contents

Disk Usage
VM Restore
File level restore
Sandbox and verification
Boot from backup
Reports
Conclusion

Disk usage

Before restoring anything I was curious how much disk space is in use

Not that much, disk E is in use for the domain controller, file server, pfsense and server 2012 template while disk F is in use for the vCenter server, Platform Service controller and windows 7 template.

And this is how Altaro shows everything int he dashboard (can’t find any other reporting option on storage, yes that’s a hint Altaro I want that stuff in the mail!)

A very small growth rate but then I haven’t done a while lot with the homelab in this time. But the compression and dedupe are nice while the cpu doesn’t even spike that much each day.


VM restore

Ok, enough text about disk usage, let’s actually restore something! First up is VM restore.

To start select the datastore where the VM is saved. I would have preferred to select the VM first because at this point I don’t care where it is saved I want it back asap. And yes I can select all datastores but that shouldn’t be needed.

Click next and select the VM to be restored

Here I can select the point in time to restore from, the name of the restored VM (why does the default name contain clone while it’s a restore?), where to restore to and to disabled the NIC or not.

In vCenter you’ll see a new VM created, renamed and snapshotted

Now Altaro will fill it up and after 23 minutes of waiting (on my slow server) I had a fully functional VM that thought it had crashed 😉


File Level restore

File level restore isn’t that different from a VM level restore. I won’t bore you with the screenshots but first select the datastore and vm to restore from. Then select the point in time you want to get something back from. I don’t really get the order in which this is presented either.

Select the disk, partition, folder and eventually file to restore

Select the place to restore it to (why isn’t the original VM an option over here?)

And the file is restored


Sandbox and verification

Sandbox testing the VM’s is rather easy as well. First choose what you actually want to test. At first I’ll try the option to verify folders. For some steps I will only show the image because I am afraid that you’ve already fallen asleep by now.

Very weird but I can’t select any folders to test? My guess is that all folders will be tested, why do you name it verify folders then?

The full Test Restore is exactly the same but it mounts the VM so you can see it booting. To me this sounds exactly like restoring a VM with its NIC disabled. There seems to be no notification of a successful test and I needed to go to the dashboard to see if it succeeded. And there only the result is visible and no logs or anything. Also the option to remove the sandbox VM is missing.

The option to remove the test VM that seems to be missing is available in the Schedule test drills option. First refresh your infrastructure and select the VMware schedule type

Add a new Sandbox restore schedule, again there are 2 major options, file test and full test restore

So for the full test restore you can select after how much time the VM will be deleted. Besides the schedule not a whole lot of options.

After the schedule has been created you need to drag a VM to the schedule. I guess this will test the last version of the VM backup but for me it would be nice to also test two versions earlier or something.


Boot from backup

The storage I use won’t be able to handle this properly but Altaro also has the option to boot a VM directly from the storage it is saved on. First select if you want to do a verification or recovery mode boot. To show the screens I will take the first option.

It has the same screens to select storage,VM and date so I won’t bother you again with those. At the version tab you can again select the host, datastore to restore to and if you want to have the NIC’s disabled or not.


Reports

The reporting doesn’t really contain a whole lot except a list of succeeded or failed tasks. The detail button doesn’t add a whole lot of information either.

The error history shows a bit more information but still not a lot.


Conclusion

Altaro is a reasonable well done product that lack’s a bit in options for the professional in me. Getting it running is easy and for smaller environments (up to 50 VM’s) where there is no dedicated admin it should get the job done. If they make the move to a Linux based appliance that might be better because for these smaller environments every penny and thus license counts. What I do like are the build in options to actually test the backups.

Getting Started with Altaro VM backup 7 (part 1)

One of the perks of being a VMware vExpert is that you now and then get licenses for and a chance to play with new software. Since I needed a backup solution for my lab I remembered a couple of Backup software builders int he list of companies that support the community. From this list I decided to give Altaro a go and requested the vExpert NFR License. Within a day I received the license and it turned out they just released a brand new version of their software: Version 7!

You can go to Altaro’s website to see what’s new in this version.

The mail contained a download link to the software and after a while I had a new (backup) vm rolled out (someone who wants to sponsor a NUC with 32GB RAM for me? ML150G6’s are slooooooow). Installing the software is next next finish so I won’t bore with that. One thing I noticed is no requirement for a database server. Let’s hope my disks are fast enough for what Altaro does.

This post is in no means a deep dive in what Altaro can give you. It’s a step by step guide to set it up and get started with the product. Also I show some features that are present in the console. Except for the NFR license Altaro has had no influence on this post itself.

Getting Started

The first thing you see after the installation is the Welcome screen that let’s you choose to connect to a local or remote server. Just select this machine (I like it that they mention the required port for the remote server though!)

Next up is the Quick Setup screen, select add Hyper-V / VMware Host (duh)

So here you can select between loose ESXi hosts and vCenter, I selected vCenter.

Enter the vCenter’s dns name/ip address and proper credentials (yes I am lazy in my lab) and next (it wil test the connection itself anyway. Under port settings you can set alternate ports if required.

Altaro will now recognize and add the ESXi hosts that are added to the vCenter server. It had no problems with my LABESX01 that is powered down. Hit finish to end this.

You are taken to the hosts screen where they show running on a trial license.

You can hit the 30 days remaining to add licenses, the licensing options will be shown.

The license can be added with the appropriate button. Enter the license key and select assign license.

You need to repeat this for all hosts!

After this I went back to the quick setup screen to add storage. Altaro has several options to write to but I added a couple of cmdk’s to the backup server that run on local slow as **** sata drives on this server.

Select physical disk

Select the disk (yes these screenshots are mixed up), create a new folder if you want and choose select .

When the storage is added you can link vm’s to the storage by drag & drop.

back to the quick setup i went and choose to create the first backup. this will take you to the take backup screen, select the vm to backup and hit take backup.

Schedules

I decided to remove the original schedules and add a new one. The time might look strange but during the daytime no-one is home and I ain’t playing with it unlike in the evening and sometimes nights. After deleting the old ones click Add Backup Schedule

Select the time and days you want to run the backup at.

When the schedule is created drag and drop the vm’s to the schedule to link them. Don’t forget to save these settings at the bottom.

Retention

Setting retentions is fairly easy, by default vm’s are linked to the 2 week retention policy. If you remove them by clicking the X they wil get moved to the Never delete policy! Please be aware that after adding a retention time I wasn’t able to remove it so this might get cluttered easily.

Notifications

Fairly basic stuff in here, you can get notified by email or events int he event log.

Advanced Settings

Not that extremely advanced but under advanced settings you can select deduplication, encryption, iso’s to be backupped and if Change Block tracking needs to be used. The last option is exclude drives where you actually select the vmdk to exclude so make sure what vmdk is what drive or mapping.

VSS Settings

Under VSS Settings you have the option to select application consistent  backups and to truncate logs.

The Master encryption Key

.The name says enough about what this does.

The End of part 1

In this part one we got started using Altaro Vm Backup 7 and viewed some of the options In the management console. In the next part we’re going to see if we can actually restore files, maybe start a vm from backup and see what the sandboxing does.

 

 

 

 

 

 

VMworld 2016 US Part 4 – the last one!

So right now it’s thursday evening and here I am in my hotel room too damn tired to even go outside. VMworld is a wrap and wow it was awesome. Yesterday I had 2 more sessions. First a quick vExpert session at the Docker booth where we got a nice vExpert embroided hat.Then it was time to get the vExpert Raspberry Pi 3 at the Datrium booth. Men they had big issues on getting them in but succeeded at last so thank you very much for that! I ended with a Rubrik session with Chris Wahl that was pretty good. In the evening it was time for the biggest party of them all at the Las Vegas Motor Speedway. To be honest I think the sound of the bands sucked and the music of the dj’s wasn’t good either but I had an awesome time playing all the games, talking to people ad even made a lap in 1 of the 50! Rental cars that wil probably be going back to budget with hardly any tires left.

So today was the last day and I did only 1 session and that was about troubleshooting Horizon and killed the time by doing some labs and hanging at the vBrownbag area where I learned a lot by listening to the sessions. This space just seemed to be vExpert HQ the whole week.

All in all I think this was the best way ever to experience your first VMworld. I really want to thank all vExperts for welcoming me in the community because I don’t think I would have had such an awesome experience without you guys!

VMworld 2016 US report part 3

Wow it’s wednesday already, time flies at VMworld! Yesterday again was an awesome day, first the 2nd keynote and after I had to head out to the Luxor for the Inner Circle fireside chat.

The Inner Circle is a group of about a 1000 people that is engaged by the VMware Customer Advocacy program. We have our own forum, weekly polls on the site and surveys by mail. Our feedback gets handled by VMware on a high level and personally I really have the idea that they listen to us. The fireside chat they had an idea of how to do it but it ended as an organized free for all where VMware received honest, harsh but really good feedback. In short they got slaughtered on several topics. They did not expect this so it was good to see that they seemed to handle it pretty wel. Later in the day I went to stop by at their boot hand asked them to get more vExperts involved because I think we are exactly the kind of people that can give this feedback.

Because of the Inner Circle session running way over time and me getting hungry pretty bad I missed the uem 9 sessions so I hope that one is recorded. My final session of the day was the vSphere 6.x Host Resource Deep Dive by my fellow Dutchies Frank Denneman and Niels Hagoort. This session was soo deep the entire Mount Everest might fit into it. Really good stuf and very useful.

After the sessions it was partytime! First a quick beer and a snack at the Inner Circle reception and after I hopped on the bus to The Mob Museum for my first vExpert party. First we had our mugshots taken. We got a print but also digitally by mail so please check mine on Twitter. We had great fun over there and had Pat Gelsinger over doing a Q&A for over an hour! Best quote? Hyper-V is free as a puppy!

Today I had a hard time waking up, not getting out of bed but during my first session at 8 am I was not paying enough attention at all. But still it was a good session on how to architect a HA resilient scalable mobility & desktop environment. After that I had a session about troubleshooting avSphere 6 environment by a couple of GSS guys and picked up a lot of good stuff!

VMworld 2016 US report part 2

Òk so in part 1 I stopped after the Partner General Session. After lunch I wanted to do some labs but the queue was really awfull so I decided to attend a group discussion about vCloud air or mobile management in general. I got some good info on the view about this from the us people while I managed to spice it up now and then with things we dutchies like or don’t like.

Monday was the first real day of VMworld. During the keynote VMware cloud foundation was announced but I don’t think I will use this multi cloud management platform in the near future. After this it was time to prepare for my vBrownbag session. I was really nervous and went over my stuf way to fast so I was done in 6 minutes or something. If you want you can find it here.

The afternoon I had 2 awesome sessions: enforcing a vSphere cluster design  with powercli by Duncan Epping and Chris Wahl and after that a ask the experts session about VDI wich where both just awesome. I finished the day at the CXI Party on the 59th floor of the cosmopolitan with a great view.

14102460_10202128465930216_419183725346827878_n

VMworld 2016 US report part 1

RIght now I am setting in the Partner Exchange lounge and since I have some time at hand it might be time for a short message from the US. Since this is my first VMworld, first time in the USA I have to admin I am really in awe of everything over here. Everything is just soo big.

Now about VMworld itself, yesterday I was in a vRealize Automation bootcamp for the whole day and really liked it. It seems to be very complicated but after you create the blueprints everything will be easy (Really?) I do see the advantages that are to be gained so it was nice. In the end we went over all exam questions as a group before most of us did the exams. I managed to pass the first but with the 2nd one I really started to get tired so I’ll gues I need to do that again. We do have 99 times to try it so it’ll be good.

Now to the sunday morning. I had 2 deepdive sessions. One about EUC & NSX and the other one about app volumes. Both where not as deep as I expected but a lot of knowledge was gained in those 2 hours. After that we had the Partner General session were wounded warrior Pat Gelsinger had a nice chat with Michael Dell and we had some information on stuff that is coming in the near future.

If I made some typos in this: they where on purpose or I blame the fact that I am still getting used to the time difference 😀