Provisioning in the Cloud with Puppet Enterprise 2.0

With the release of Puppet Enterprise 2.0, Puppet Labs has added cloud provisioning capabilities with support for some of the most popular public and private cloud offerings including Amazon EC2 and VMware. PE 2.0 allows you to quickly provision virtual machines and start managing them with Puppet right away.

Getting Started

The following set of “micro” tutorials will show you how to leverage Puppet Enterprise 2.0 cloud provisioning capabilities on a public cloud (Amazon EC2). In order to get up and running you will need access to an Amazon’s EC2 account. Please note that while this tutorials will focus on Amazon EC2, the Puppet Enterprise 2.0 provisioning capabilities are designed to support a wide range of cloud providers. Initially there is support for Amazon EC2 which is covered in this tutorial and VMware, which is covered here; with support for additional providers being added over time.

Setup EC2 for use with Cloud Provisioner

  1. Download and install PE 2.0
  2. Gather Amazon AWS details into the fog configuration file

Before launching instances with the Cloud Provisioner module, you'll need to register with Amazon AWS and obtain your access credentials.

Once you have completed the registration process, follow the AWS configuration sections here.

Now that you are all set up, we are ready to create our first virtual server in the cloud.

Provisioning in the Cloud

Provisioning machines on public or private clouds offers a huge benefit over traditional methods used on bare metal machines. Gone are the delays caused by hardware procurement and network setup; new machines are just a few clicks away. But to take full advantage of these new possibilities, you’ll need the right tools for the job.

Create virtual machines on EC2

  1. Gather Amazon Instance details
    • image -- AMI to use when creating the instance
    • keyname -- The AWS SSH key name as shown in the AWS console
    • type -- Type of instance
  2. Run the puppet node_aws create command

Create a Debian 6.0 micro instance on EC2:

# puppet node_aws create --image='ami-0ce41865' --keyname='kelsey_rsa' --type='t1.micro'
notice: Creating new instance ...
notice: Creating new instance ... Done
notice: Creating tags for instance ...
notice: Creating tags for instance ... Done
notice: Launching server i-2a38eb48 ...
#############
notice: Server i-2a38eb48 is now launched
notice: Server i-2a38eb48 public dns name: ec2-174-129-158-192.compute-1.amazonaws.com
ec2-174-129-158-192.compute-1.amazonaws.com

At this point you should be able to ssh into your EC2 instance:

# ssh -i .ssh/puppetlabs_id_rsa root@ec2-174-129-158-192.compute-1.amazonaws.com
Enter passphrase for key '.ssh/puppetlabs_id_rsa':
Linux ip-10-212-169-9 2.6.32-5-xen-686 #1 SMP Wed Mar 9 01:27:54 UTC 2011 i686

The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. root@ip-10-212-169-9:~#

That’s all there is too it, and doing the same for VMware is equally as easy: http://docs.puppetlabs.com/pe/2.0/cloudprovisioner_vmware.html

Cloud Maintenance

The ability to provision an unlimited number of virtual machines has its downsides, like virtual machine sprawl, it’s easy to lose track of how many machines you have and how they are configured. In short, virtual machines require real maintenance.

PE 2.0 greatly reduces this overhead by providing tools such as the Puppet Enterprise Console—built on top of the Puppet we all know and love—which enables you to visualize and manage your entire infrastructure, virtual or physical, right out of the box. When you provision your virtual machines using the new cloud provisioning capabilities, you get access to these features immediately.

Classify, and managing machines via the PE 2.0 Console (GUI)

# export PUPPET_ENC_AUTH_PASSWD=’XXXXXXXX’
# puppet node classify ec2-174-129-158-192.compute-1.amazonaws.com  --node-group='default' --enc-ssl --enc-server dashboard.puppetlabs.com 
--enc-port 443 --enc-auth-user console
notice: Contacting https://master.hightower.puppetlabs.com:443/ to classify ec2-174-129-158-192.compute-1.amazonaws.com 
complete

At this point you should be able to access your node via the Puppet Enterprise Console:

Conclusion

Whether you have an existing cloud infrastructure or just getting started, PE 2.0 can streamline the complete life cycle of running machines in the cloud while incorporating “cloud” best practices and world class configuration management.

Look for support for additional Cloud vendors in the near future.

Related Content:
Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.