New Year, New Blog Posts

It’s been a little longer than I would like between posts lately, but with the holidays..that’s life.  The good news is that I’ve been doing plenty of work, just nothing post-worthy.  So what are some of the accomplishments that didn’t merit a post but should result in a ton of content:

  • Added a new server to the lab to both add capacity and allow for some initial physical versus virtual performance testing and tuning (update to the lab page coming)
  • Began the process of upgrading to VMware ESXi 6.0
  • Began upgrading the processors on the main ESXi box to Xeon E5-2670’s (8-core/16-thread)
  • Upgraded VMware vSphere to 6.0.
  • Was notified that I will be speaking at Kscope16 (seven years in a row as a KScope presenter!)
  • Began preparing a ton of content for the new year

And on that note, I have a ton of interesting (at least to me) content coming up this year:

  • Continue the Planning Repository series
  • Continue the Powershell series
  • New series on Building Your Own Hyperion Lab (more hardware focused, less software focused)
  • New series on Performance Tuning Essbase (more software implementation of the hardware side)
  • Any other fun topics that pop up or any questions I get from colleagues and readers

That’s it for now.  Look for more updates hopefully on a more frequent basis now that we are past the holidays.  And finally…Happy Belated New Year!


Veeam Backup & Replication Free Edition Experience and Sample

This post is a bit outside of what I normally write about, but I had some trouble getting it working and all of the web searching didn’t really help.  So just in case someone else is having the same problems I was having, Google should provide this for you!

First a quick introduction.  I have a server in my house (I’d like to thank my wife for allowing this) and it runs VMWare ESXi 5.5.  I have a couple of dozen VM’s that I run 24/7 and I’ve given access to a variety of these VM’s to about a dozen colleagues and clients.  My problem has always been backing up the VM’s with this many people in the system.  There is no production data on this system, but I’d prefer that we have a good backup of everyone’s work in case a RAID array in the system fails or in case someone breaks something on accident.

My current environment consists of a single server with a variety of RAID arrays.  All of the VM’s live on SSD storage, most of which is in RAID 0.  So given that I’m running RAID 0, I have even more reason to make sure I have up to date backups.  In addition to the SSD’s, I also have a traditional platter-based RAID 6 array.  This is where my backups will be stored.  Up until now, I have done occasional manual backups using the Veeam Backup & Replication product.  They have a free version that has worked well for one-off backups.  But, until now, it did not support a way of doing automated backups.

That all changed recently with the release of Update 2 to the Version 8 product.  Once I heard this, I of course had to get it running.  So I went to Veeam’s very own blog post on the topic:

Veeam’s Blog Post

So what trouble did I run into?  First, with one VM getting it all setup went perfectly.  It worked just fine on the first attempt and I was pretty excited.  But when I decided to add VM’s to the list, I hit a snag.  On the blog post, it clearly says to separate the list of VM’s with commas, but the sample file they have available for download says to use semi-colons.  So I finally figured that problem out and I was off and running.

The other cool thing that the backup script supports is an e-mail notification at the end.  So not only do I get free backups on an automated schedule, but I don’t have to check in to verify that they ran.  But this is where I hit my second snag.  The provided samples did not take into account that many SMTP servers require authentication to actually send mail.  So, I finally figured out how to get it working with authentication and while I was at it, I went ahead and added a logging section.  Now Veeam has a log of all of the backups, so this may be extraneous, but I like having it.  Too many MaxL scripts over the years…

So here’s my code.  I hope it helps!

# Orignal Author: Vladimir Eremin
# Created Date: 3/24/2015
# http://forums.veeam.com/member31097.html
# Modified By: Brian Marshall
# Modified Date: 7/26/2015

##################################################################
#                   User Defined Variables
##################################################################

# Names of VMs to backup separated by commas (Mandatory)
$VMNames = "Hyperion SS","Hyperion ES","Hyperion PL","Hyperion FM","Hyperion SQL","Hyperion BI","Hyperion DR","Hyperion ET"

# Name of vCenter or standalone host VMs to backup reside on (Mandatory)
$HostName = "HyperionESXI"

# Directory that VM backups should go to (Mandatory; for instance, C:\Backup)
$Directory = "G:\Backup\ESXi"

# Directory that log files should go to
$LogDirectory = "G:\Backup\ESXi\Logs"

# Description of what is being backed up
$BackupDescription = "Hyperion11123500"

# Desired compression level (Optional; Possible values: 0 - None, 4 - Dedupe-friendly, 5 - Optimal, 6 - High, 9 - Extreme) 
$CompressionLevel = "0"

# Quiesce VM when taking snapshot (Optional; VMware Tools are required; Possible values: $True/$False)
$EnableQuiescence = $True

# Protect resulting backup with encryption key (Optional; $True/$False)
$EnableEncryption = $False

# Encryption Key (Optional; path to a secure string)
$EncryptionKey = ""

# Retention settings (Optional; By default, VeeamZIP files are not removed and kept in the specified location for an indefinite period of time. 
# Possible values: Never , Tonight, TomorrowNight, In3days, In1Week, In2Weeks, In1Month)
$Retention = "In2Weeks"

##################################################################
#                   Notification Settings
##################################################################

# Enable notification (Optional)
$EnableNotification = $True

# Email SMTP server
$SMTPServer = "smtp.gmail.com"

# Email SMTP server port
$SMTPPort = "587"

# Email SMTP username
$SMTPUser="yourgmailaccount@gmail.com"

# Email SMTP password
$SMTPPass="youcanthavemypassword"

# Email FROM
$EmailFrom = "Brian Marshall " 

# Email TO
$EmailTo = "yourgmailaccount@gmail.com"

# Email subject
$EmailSubject = "ESXi 11.1.2.3.500 Backup Complete"

##################################################################
#                   Email formatting 
##################################################################

$style = ""

##################################################################
#                   End User Defined Variables
##################################################################

#################### DO NOT MODIFY PAST THIS LINE ################
Asnp VeeamPSSnapin

$Server = Get-VBRServer -name $HostName
$MesssagyBody = @()

foreach ($VMName in $VMNames)
{
  $VM = Find-VBRViEntity -Name $VMName -Server $Server
  
  If ($EnableEncryption)
  {
    $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | ConvertTo-SecureString)
    $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention -EncryptionKey $EncryptionKey
  }
  
  Else 
  {
    $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention
  }
  
  If ($EnableNotification) 
  {
    $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
    $FailedSessions =  $TaskSessions | where {$_.status -eq "EWarning" -or $_.Status -eq "EFailed"}
  
  if ($FailedSessions -ne $Null)
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={$FailedSessions.Title}})
  }
   
  Else
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={($TaskSessions | sort creationtime -Descending | select -first 1).Title}})
  }
  
  }   
}

If ($EnableNotification)
{
$Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo
$Message.Subject = $EmailSubject
$Message.IsBodyHTML = $True
$message.Body = $MesssagyBody | ConvertTo-Html -head $style | Out-String
$SMTP = New-Object Net.Mail.SmtpClient($SMTPServer, $SMTPPort)
$SMTP.EnableSsl = $true 
$SMTP.Credentials = New-Object System.Net.NetworkCredential($SMTPUser, $SMTPPass); 
$SMTP.Send($Message)
}

$LogMessage = $MesssagyBody | ConvertTo-Html -head $style | Out-String
$LogMessage | Out-File "$LogDirectory\$BackupDescription-$(get-date -f yyyy-MM-dd-hh-mm).html"

You can find the rest of the setup information at the official blog post by Veeam, so I won’t try to re-invent the wheel here.  I’m no PowerShell expert, but the modifications served my purpose!


It’s a Boy!

Our son was born this past Friday, July 31, 2015 at 12:06 PM.  He weighed 8 pounds and 6 ounces and was 20 inches long.

And now for some pictures:

image

His sister Hillary pushes him around:

image


Kscope15 Presentations and Queries

I’m back in Texas after my quick in-and-out trip to present.  As promised, I’m posting both my presentations and more importantly, the queries that we reviewed during my Planning repository presentation.  Have a look at the files here:

Cash Forecasting Kscope15

Planning Repository Kscope15

Planning Repository Kscope15 Queries for SQL Server

I’d love to hear any questions, comments, or suggestions anyone around any of this content.