Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Table of Contents
Lab Overview .................................................................................................................... 2
HOL-PRT-1303 - EMC Lab - Using Puppet and the vSphere Web Client.................... 3
EMC and the vSphere Web Client...................................................................................... 5
EMC Virtual Storage Integrator (VSI) powered by ViPR Software Defined Storage .. 6
EMC Enterprise Backup and Recovery..................................................................... 9
Using Puppet to Deploy EMC Avamar and More .............................................................. 38
Setting up a Puppet Master................................................................................... 39
Facter and the Puppet Agent................................................................................. 41
Your First Puppet Class - hellovmworld.................................................................. 44
Create a Puppet Class - avamar ............................................................................ 55
Create a Puppet Class - avamar-win...................................................................... 61
Optional Puppet Classes - avamar-vm, apache2, mssql, avamar-sql, hyperic,
hyperic-win ........................................................................................................... 68
Puppet and VMware Guest Integration ........................................................................... 70
Using an External Node Classifier to Integrate Puppet and vSphere ..................... 71
VM Guest Facts...................................................................................................... 73
vCenter Hiera Lookup for Classes ......................................................................... 81
VM Image Backup Puppet Module ......................................................................... 87
Deploying PaaS with Puppet and vCO ............................................................................. 94
vCenter Orchestrator Workflows and Puppet ........................................................ 95
Review Provisioning Workflow ............................................................................... 96
Assign Workflows to VM Context Menu ............................................................... 103
Provisioning VMs and PaaS.................................................................................. 108
Review PaaS Deployment.................................................................................... 115
Monitoring PaaS and EMC Avamar with Hyperic ........................................................... 120
Configuring and Reviewing Hyperic Monitoring................................................... 121
vCOps and Conclusion ........................................................................................ 126
HOL-PRT-1303
Page 1
HOL-PRT-1303
Lab Overview
HOL-PRT-1303
Page 2
HOL-PRT-1303
HOL-PRT-1303
Page 3
HOL-PRT-1303
NOTE: Would you like to be entered into a raffle for a chance to win an
unlocked iPhone? Following the lab please click on the Help button to get a
contest card from an EMC proctor. The proctors managing the raffle will have
Puppet Labs or EMC shirts on.
HOL-PRT-1303
Page 4
HOL-PRT-1303
HOL-PRT-1303
Page 5
HOL-PRT-1303
HOL-PRT-1303
Page 6
HOL-PRT-1303
methods. ViPR transforms existing file data into cloud data and cloud data into file data
without the need to move, copy or modify the data.
HOL-PRT-1303
Page 7
HOL-PRT-1303
HOL-PRT-1303
Page 8
HOL-PRT-1303
HOL-PRT-1303
Page 9
HOL-PRT-1303
HOL-PRT-1303
Page 10
HOL-PRT-1303
Connect to avamar01
The plugin welcomes you to EMC Backup and Recovery. If you had multiple Avamar
servers in the environment, they would all be accessible from this page. In the case of
the lab, the only choice we've got is an Avamar Virtual Edition server called avamar01.
Go ahead and click the Connect button to get started.
HOL-PRT-1303
Page 11
HOL-PRT-1303
HOL-PRT-1303
Page 12
HOL-PRT-1303
Once you have the Virtual Machine highlighted, additional details for that machines
protection status are available at the bottom of the window.
HOL-PRT-1303
Page 13
HOL-PRT-1303
Also notice that you've got the ability to configure email alerting by clicking on the
Email button.
And you can view the backup server log by clicking on the Log button.
HOL-PRT-1303
Page 14
HOL-PRT-1303
HOL-PRT-1303
Page 15
HOL-PRT-1303
HOL-PRT-1303
Page 16
HOL-PRT-1303
HOL-PRT-1303
Page 17
HOL-PRT-1303
HOL-PRT-1303
Page 18
HOL-PRT-1303
# reboot
HOL-PRT-1303
Page 19
HOL-PRT-1303
Power-Off linux01
Click back to your vSphere Web Client which should be the first tab in the browser (you
may need to press Ctrl-Alt to get out of the console window). Note that there is no need
to close the linux01 console tab as this will be used later in the lab.
In order to do an "in-place" restore, the VM that is going to be replaced needs to be in a
powered off state. Shutdown linux01 by right-clicking linux01 and selecting "Shut Down
Guest OS". Answer yes to powering the system down.
HOL-PRT-1303
Page 20
HOL-PRT-1303
Recover linux01
Right click on linux01 and choose "All EBR Actions" -> "Restore from Last Backup" (you
may need to wait a few seconds for the "All EBR Actions" choice to appear).
HOL-PRT-1303
Page 21
HOL-PRT-1303
HOL-PRT-1303
Page 22
HOL-PRT-1303
HOL-PRT-1303
Page 23
HOL-PRT-1303
HOL-PRT-1303
Page 24
HOL-PRT-1303
In very little time, you should see task events corresponding to the above workflow.
After the snapshot has been removed, you will see the parent task (EBR: Restore Job)
complete indicating that the entire restore has been completed.
The VM will then be powered on and connected to the network to boot.
HOL-PRT-1303
Page 25
HOL-PRT-1303
HOL-PRT-1303
Page 26
HOL-PRT-1303
Before we get started, let's see what it would take to get a quick backup of windows01 after all, you can never be too careful and with CBT, backups are fast and easy.
If you're not already back in the vSphere Web Client, go ahead and navigate there (it
should be an open tab in your web browser). In the search bar (upper right corner), type
"windows01" and select Virtual Machine: windows01 when it appears.
HOL-PRT-1303
Page 27
HOL-PRT-1303
HOL-PRT-1303
Page 28
HOL-PRT-1303
HOL-PRT-1303
Page 29
HOL-PRT-1303
Login to windows01
Open a remote desktop session to windows01. Click Start - Remote Desktop Connection
and choose windows01. Use "corp\administrator" for the username and "VMware1!"
as the password.
HOL-PRT-1303
Page 30
HOL-PRT-1303
Next, enter the local backup administrator credentials into the "Local Credentials"
section:
Username: .\backup-admin
Password: VMware1!
And for the "vCenter Credentials", use any account with administrative rights:
Username: root
Password: VMware1!
Click the Login button to proceed.
* Note that the ".\backup-admin" is a local account on windows01 and you could have
used any account that has backup rights on that local machine (including domain
accounts). If we were restoring files using a backup set created from the host
windows01, no "Advanced Login" or vCenter administrative privileges are required.
HOL-PRT-1303
Page 31
HOL-PRT-1303
HOL-PRT-1303
Page 32
HOL-PRT-1303
HOL-PRT-1303
Page 33
HOL-PRT-1303
HOL-PRT-1303
Page 34
HOL-PRT-1303
HOL-PRT-1303
Page 35
HOL-PRT-1303
HOL-PRT-1303
Page 36
HOL-PRT-1303
Logoff windows01
Click Start -> Log off to disconnect from windows01. This concludes the EMC Enterprise
Backup and Recovery module.
HOL-PRT-1303
Page 37
HOL-PRT-1303
HOL-PRT-1303
Page 38
HOL-PRT-1303
HOL-PRT-1303
Page 39
HOL-PRT-1303
HOL-PRT-1303
Page 40
HOL-PRT-1303
HOL-PRT-1303
Page 41
HOL-PRT-1303
Connect to linux01
At this point, you may already have a PuTTY session open with linux01 - you can either
restart the session, or open a new session by clicking the PuTTY icon on the desktop and
selecting the linux01 configuration option.
Login using the following credentials:
Username: root
Password: VMware1!
HOL-PRT-1303
Page 42
HOL-PRT-1303
HOL-PRT-1303
Page 43
HOL-PRT-1303
HOL-PRT-1303
Page 44
HOL-PRT-1303
class hellovmworld {
case $operatingsystem {
'windows': {
file { 'c:\\temp\\HelloVMworld.txt':
ensure => file,
content => "My First Puppet Class with Facters!"
}
}
default: {
file { '/tmp/HelloVMworld.txt':
ensure => file,
content => "My First Puppet Class with Facters!"
}
}
}
}
To exit vi, press the "Esc" key and then type ":wq" (without the quotes) to write the file
to disk and quit the editor.
If you aren't comfortable in vi, or don't want to compose the text feel free to copy the
template example using the following syntax:
# cp init.template init.pp
HOL-PRT-1303
Page 45
HOL-PRT-1303
The first line "class hellovmworld {" is used to declare the class that you just built. You
can also use this section to tell this class to include other modules and/or classes that
are present in the environment.
The next line "case $operatingsystem {" checks the facter output and determines if the
host is or isn't running a Windows based operating system.
If the host is running Windows, then Puppet looks for a file in the temp directory of the
C:\ drive called HelloVMworld.txt. If the file isn't there, then it will create the file and
insert the content that you see above (My First Puppet Class with Facters!). Notice that
the backslash character is escaped with another backslash character (\\).
If the host is running anything other than Windows, then Puppet looks for a file in /tmp
called HelloVMworld.txt and creates the file with the appropriate content as necessary.
Let's go ahead and see if it works.
HOL-PRT-1303
Page 46
HOL-PRT-1303
HOL-PRT-1303
Page 47
HOL-PRT-1303
HOL-PRT-1303
Page 48
HOL-PRT-1303
HOL-PRT-1303
Page 49
HOL-PRT-1303
Connect to windows01
When we created the hellovmworld class, we included a case statement to help
determine if the host checking into puppet was running a Windows operating system
and we need to verify that it's working.
Click Start -> Remote Desktop Connection and connect to windows01.
Login using corp\administrator with the VMware1! password.
HOL-PRT-1303
Page 50
HOL-PRT-1303
HOL-PRT-1303
Page 51
HOL-PRT-1303
HOL-PRT-1303
Page 52
HOL-PRT-1303
HOL-PRT-1303
Page 53
HOL-PRT-1303
Congratulations
You've just completed writing your first puppet class, congratulations!
HOL-PRT-1303
Page 54
HOL-PRT-1303
HOL-PRT-1303
Page 55
HOL-PRT-1303
}
-> notify {'AVAMAR client installed':}
The package that puppet is addressing is named AvamarClient-7.0.100-379.x86_64 and
we're indicating that this package is managed using the Linux RPM package
management facility. We're setting the "ensure" directive to installed to tell Puppet that
the avamar software should be present - if it's missing, puppet will manage the
installation using the rpm file that is specified in the source directive. The - notify
statement at the end of this section is called chaining and will create an event indicating
that the Avamar package was installed in the even that it was missing.
We're going to use the next section of the file to make sure that the agent service is
running. Continue entering the following text into the init.pp file:
service { 'avagent':
ensure => running,
enable => true,
subscribe => Package['AvamarClient-7.0.100-379.x86_64'],
require => Exec['register'],
}
This section describes the agent name (avagent) and tells Puppet to makes sure that
the agent is running and if it's not, start it up. And the subscribe directive tells Puppet to
wait until the activity that's subscribed to has completed (in this case, it's the software
installation that you just added moments ago). But before Puppet will try to take action
here, it needs to check in with something called register (hence the require directive).
At this point, you probably realize that register section that we're requiring is still
missing. Add this text as your final section:
exec { 'register':
command =>"/usr/local/avamar/etc/avagent.d register avamar01.rainpole.com
clients",
onlyif =>"test `/usr/local/avamar/etc/avagent.d status | grep -c avamar01` -ne
1",
provider => shell,
}
-> notify {'AVAMAR client registered':}
}
This last section handles the logic to ensure that the client we're installing the agent
onto has been registered with the Avamar backup server. In this case, we're telling
Puppet to run a "status" command and verify the agent has been registered. If no
registration is present, Puppet will ask the client run the command specified by the
command directive and create a logging event (notify directive). Otherwise, puppet will
go back to the service section and ensure that our backup agent is running.
HOL-PRT-1303
Page 56
HOL-PRT-1303
Go ahead and save the init.pp file by pressing the "Esc" key followed by a ":wq" (without
the quotes) to write the file and quit the editor.
Alternatively, you can use the following command to populate your init.pp file:
# cp init.template init.pp
HOL-PRT-1303
Page 57
HOL-PRT-1303
HOL-PRT-1303
Page 58
HOL-PRT-1303
HOL-PRT-1303
Page 59
HOL-PRT-1303
Congratulations!
Now that you see how easy it is to install the Avamar agent using puppet, we can go
back and make the module more dynamic using variables instead of hard coded values.
We can also leverage NFS or HTTPS to transfer package files rather than having them
stored locally in a base operating system image.
HOL-PRT-1303
Page 60
HOL-PRT-1303
HOL-PRT-1303
Page 61
HOL-PRT-1303
action (installing the package) is executed before the next action is called. This is called
chaining.
We're going to use the next section of the file to make sure that the agent service is
running. Continue entering the following text into the init.pp file:
service { 'avbackup':
ensure = 'running',
} ->
notify {'AVAMAR running':}
->
In the above section, we refer to the Windows service called avbackup and declare that
puppet needs to "ensure" that it's running. After that task is complete, we chain the
next event which is the AVAMAR running notification, at which point our final section can
then execute.
Add the following text to complete the init.pp file:
exec { 'register':
command => 'cmd.exe /c "c:\\program files\\avs\bin\avregister.bat"
avamar01.rainpole.com client',
unless =>"cmd.exe /c findstr.exe -i avamar c:\\program
files\\avs\\var\\avagent.cfg",
path => $::path
}
-> notify {'AVAMAR client registered':}
}
This final section called register is the logic behind performing the initial client
registration with the Avamar server. The declarative nature is pretty straightforward;
execute the "command" option "unless" Puppet finds that it's already registered (by
executing a command). And then create a notification event.
Go ahead and save the init.pp file by pressing the "Esc" key followed by a ":wq" (without
the quotes) to write the file and quit the editor.
If you didn't use vi to create your file, copy the init.template file to init.pp:
# cp init.template init.pp
HOL-PRT-1303
Page 62
HOL-PRT-1303
HOL-PRT-1303
Page 63
HOL-PRT-1303
Connect to windows01
Click the remote desktop icon for windows01. If you aren't still connected to windows01,
click Start -> Remote Desktop Connection and connect to windows01. Use corp\
administrator and VMware1! to login.
HOL-PRT-1303
Page 64
HOL-PRT-1303
Once you are convinced that the agent is not installed, proceed to the next step.
HOL-PRT-1303
Page 65
HOL-PRT-1303
HOL-PRT-1303
Page 66
HOL-PRT-1303
HOL-PRT-1303
Page 67
HOL-PRT-1303
apache2
The apache2 module will go out and use zypper to ensure that the necessary apache2
webserver packages are present on a linux host, start the web server, and transfer a
few files to establish an initial home page.
The module can be found in /etc/puppet/modules/apache2
mssql
The mssql module was downloaded from the Puppet Forge and MS-SQL software staged
into our base Windows image to demonstrate ease of database installation on the
windows platform.
The module can be found in /etc/puppet/modules/mssql
avamar-sql
The avamar-sql module was written to demonstrate how easy it can be to deploy the
different Avamar plug-in's to provide application consistent backups for almost any use
case.
The module can be found in /etc/puppet/modules/avamar-sql
HOL-PRT-1303
Page 68
HOL-PRT-1303
hyperic
The hyperic puppet module will install and configure the hyperic agent, auto discover
any supported monitoring components, and register the platform with Hyperic. This
agent is used in another module later in this lab.
The module can be found in /etc/puppet/modules/hyperic
hyperic-win
This module is the same as the hyperic module, except that it was written to support
installation and configuration on Windows clients. The hyperic and hyperic-win modules
could be combined with some additional work to have a common puppet module.
The module can be found in /etc/puppet/modules/hyperic-win
HOL-PRT-1303
Page 69
HOL-PRT-1303
HOL-PRT-1303
Page 70
HOL-PRT-1303
HOL-PRT-1303
Page 71
HOL-PRT-1303
HOL-PRT-1303
Page 72
HOL-PRT-1303
VM Guest Facts
VM guest facts
In this lab the ENC returns the classes to be installed from based on information stored
per Virtual Machine in vCenter. However, in order to know which VM to lookup we need
to know something unique about the VM. In most cases, a VM can be addressed
uniquely by something unique or a combination of many things. Some these being but
not limited to: DNS FQDN, MAC Address, IP, or BIOS UUID.
This lab introduces a new VMware integration for Puppet which makes use of a specific
Virtual Machine guest fact that ensures uniqueness per vCenter instance. We are going
to leverage an identifier (instanceUuid) which is what vCenter tracks VMs by internally
and ensures uniqueness for Puppet! We are also going to leverage this instanceUuid for
a new Avamar-VM puppet module to manage image based backups.
Is it completely necessary to leverage the instanceUuid? No, Puppet to this point has
basically only been concerned with FQDN. But in order to future-proof and make Puppet
more consistent the instanceUuid may be a better long term approach to classifying
nodes.
The tricky part here is that the Puppet agent needs to have a fact that reports the
instanceUuid which then gets passed to the Puppet server. So how do we let a VM Guest
Operating Systems know a fact that is held at the VMware or Hypervisor level?
VM advanced settings
There are specific settings that a Virtual Machine guest can retrieve about itself from the
vCenter through VM Tools. This information can be custom if the name of the Advanced
Setting begins with "guestinfo." These advanced settings are persistently held with the
VM .vmx file.
In our case we are going to leverage a custom Advanced Setting called
"guestinfo.vminstanceuuid" which the guest can see.
HOL-PRT-1303
Page 73
HOL-PRT-1303
Notice first that we have added some complexity here based on leveraging already
known facts of whether a guest is Linux or Windows (if Facter.value('operatingsystem')
== 'windows') to change the command.
HOL-PRT-1303
Page 74
HOL-PRT-1303
HOL-PRT-1303
Page 75
HOL-PRT-1303
HOL-PRT-1303
Page 76
HOL-PRT-1303
HOL-PRT-1303
Page 77
HOL-PRT-1303
HOL-PRT-1303
Page 78
HOL-PRT-1303
Workflow Success
You should then see a green arrow below the workflow indicating a successful run.
HOL-PRT-1303
Page 79
HOL-PRT-1303
# facter --puppet
Notice how the vminstanceuuid is now populated at the end. We also follow the
command up with a command including "grep" to only include the vminstanceuuid.
HOL-PRT-1303
Page 80
HOL-PRT-1303
HOL-PRT-1303
Page 81
HOL-PRT-1303
HOL-PRT-1303
Page 82
HOL-PRT-1303
HOL-PRT-1303
Page 83
HOL-PRT-1303
Navigate to linux01
Select linux01 so that it's highlighted.
Notice the "puppet.classes" field that is listed under Annotations. This is considered a
custom value and is associated per virtual machine as a result of the Puppet integration
that we're demonstrating.
HOL-PRT-1303
Page 84
HOL-PRT-1303
HOL-PRT-1303
Page 85
HOL-PRT-1303
you can see now that we are looking to the Custom Value in vCenter the Puppet agent
now applies the "avamar" class as it is set in vCenter!
HOL-PRT-1303
Page 86
HOL-PRT-1303
HOL-PRT-1303
Page 87
HOL-PRT-1303
serves as an important role for Puppet. Some of this information is also available from
the guest by leveraging the File Level Restore (FLR) GUI as shown in a previous module.
HOL-PRT-1303
Page 88
HOL-PRT-1303
HOL-PRT-1303
Page 89
HOL-PRT-1303
HOL-PRT-1303
Page 90
HOL-PRT-1303
HOL-PRT-1303
Page 91
HOL-PRT-1303
HOL-PRT-1303
Page 92
HOL-PRT-1303
HOL-PRT-1303
Page 93
HOL-PRT-1303
HOL-PRT-1303
Page 94
HOL-PRT-1303
HOL-PRT-1303
Page 95
HOL-PRT-1303
HOL-PRT-1303
Page 96
HOL-PRT-1303
HOL-PRT-1303
Page 97
HOL-PRT-1303
HOL-PRT-1303
Page 98
HOL-PRT-1303
HOL-PRT-1303
Page 99
HOL-PRT-1303
HOL-PRT-1303
Page 100
HOL-PRT-1303
This is where we add the different applications or modules that we have for puppet. By
populating parameters here we are effectively adding classes that are set in the VM
Custom Values.
VMware Information - Puppet PaaS - Backups
Here we select guest, application, and VMware oriented backups.
HOL-PRT-1303
Page 101
HOL-PRT-1303
Close workflow
In the bottom of the workflow press the Cancel button followed by the Close Anyway
button that appears.
HOL-PRT-1303
Page 102
HOL-PRT-1303
HOL-PRT-1303
Page 103
HOL-PRT-1303
HOL-PRT-1303
Page 104
HOL-PRT-1303
HOL-PRT-1303
Page 105
HOL-PRT-1303
HOL-PRT-1303
Page 106
HOL-PRT-1303
HOL-PRT-1303
Page 107
HOL-PRT-1303
Go to template folder
From the vSphere web client, in the top right let's use the Search functionality to find
the Template folder with the appropriate VMs for provisioning. Enter templates, and wait
for the results to populate and press Templates. Select Templates.
HOL-PRT-1303
Page 108
HOL-PRT-1303
HOL-PRT-1303
Page 109
HOL-PRT-1303
Installs Menu
1. Select the check box next to Microsoft SQL 2008 R2.
2. Select Hyperic Platform/Application Performance Monitoring.
Press Next
HOL-PRT-1303
Page 110
HOL-PRT-1303
Backups Menu
1. Select Avamar Backups for Microsoft SQL.
2. Select Virtual Machine Image Backups.
Press Finish
HOL-PRT-1303
Page 111
HOL-PRT-1303
HOL-PRT-1303
Page 112
HOL-PRT-1303
Installs Menu
1. Select Apache2 Web Services
2. Select Hyperic Platform/Application Performance Monitoring
Press Next
Backups Menu
1. Select Virtual Machine Image Backups
Press Finish
HOL-PRT-1303
Page 113
HOL-PRT-1303
The expected time for the Linux VM is around 2 minutes. Once you see the workflow
complete, you should be able to open a PuTTY session to the name as entered (linsles-221) or Remote Desktop to the windows system (windows02). The windows system
will take a few more minutes since it needs to go through an Active Directory join and
sysprep process. As well the SQL server installation takes a few more minutes to
complete.
HOL-PRT-1303
Page 114
HOL-PRT-1303
HOL-PRT-1303
Page 115
HOL-PRT-1303
HOL-PRT-1303
Page 116
HOL-PRT-1303
You should see the default web page that we distribute with Apache2 installed!
HOL-PRT-1303
Page 117
HOL-PRT-1303
HOL-PRT-1303
Page 118
HOL-PRT-1303
HOL-PRT-1303
Page 119
HOL-PRT-1303
HOL-PRT-1303
Page 120
HOL-PRT-1303
Login to Hyperic
Open a new tab in Internet Explorer.
Use the shortcut within the favorites bar in Internet Explorer and enter hqadmin/
hqadmin for username and password.
Press the Sign in button.
HOL-PRT-1303
Page 121
HOL-PRT-1303
HOL-PRT-1303
Page 122
HOL-PRT-1303
HOL-PRT-1303
Page 123
HOL-PRT-1303
Review indicators
Initially you will be looking at the Indicators tab which is a method that Hyperic
leverages to graph metrics over time. Since we are pulling real information for this lab,
the graphs will not have much information.
Press the Metric Data tab to review that raw metrics values.
HOL-PRT-1303
Page 124
HOL-PRT-1303
HOL-PRT-1303
Page 125
HOL-PRT-1303
Summary
The Rainpole CTO is pleased with the work you've highlighted and is really excited to be
able to offer Platform as a Service that includes Data Protection to his biggest customer.
There's a new puppetmaster role that he's posting shortly and wants you to consider
applying for it...
In all seriousness, we hope you enjoyed the time you spent working in this lab and
found it both fun and educational. We realize that the lab wasn't 100% EMC product
focused and that was by design. As we continue to evolve into the next generation of
software defined everything, you should expect to see products like ViPR that work with
both EMC and other vendor's technologies, and EMC taking a more active role in helping
our customers use Open Source tools like Puppet to make the deployment of EMC
technologies even easier.
We welcome any and all feedback and once again encourage you to use the "raise your
hand" option in the lab if you have want to speak with us directly. Thanks again for
taking the time to complete this lab and we hope you enjoy the rest of the conference.
- the EMC Lab Team (Clint, Jeff, and Joel)
NOTE: Would you like to be entered into a raffle for a chance to win an
unlocked iPhone? Following the lab please click on the Help button to get a
contest card from an EMC proctor. The proctors managing the raffle will have
Puppet Labs or EMC shirts on.
HOL-PRT-1303
Page 126
HOL-PRT-1303
Conclusion
Thank you for participating in the VMware Hands-on Labs. Be sure to visit
http://hol.vmware.com/ to continue your lab experience online.
Lab SKU: HOL-PRT-1303
Version: 20140321-162110
HOL-PRT-1303
Page 127