I also want to mention that this was my first time using Puppet and though there are some videos and guides, it still may not be trivial for new users on what is needed. I thought I walk you through the steps I took to quickly stand up several ESXi 5 hosts in minutes using Razor.
Step 1 - Install Ubuntu Precise (Ubuntu Server 12.04 LTS) which will be your Razor server
Step 2 - For a clean installation of Precise, you will need two additional packages: git and make as well as Puppet. Using the following command, it will pull down the latest updates as well as adding the apt.puppetlabs.com repot to install Puppet:
Note: Thanks to Nan Liu for this quick snippet!
Step 3 - You will need to change the ownership of puppet module directory by running the following command:
chown -R puppet:puppet /etc/puppet/modulesStep 4 - To verify that you have successfully installed Puppet 2.7.14, you can run the following command which should return you the version:
puppet --versionStep 5 - Now you will install the Razor module using puppet by running the following command:
puppet module install puppetlabs/razor
puppet apply /etc/puppet/modules/razor/tests/init.pp --verbose
Step 8 - Finally we also need to ensure that the Razor web services is running, this is currently a known issue which hopefully will be fixed very soon. By default, the web service should automatically start by itself, but currently you need to manually start it. You can run the following commands to verify the status and then start it:
razor image add mk ./rz_mk_dev-image.0.8.8.0.iso
Step 11 - To verify we have no nodes that have registered with Razor, we can run the following command:
razor image add esxi VMware-VMvisor-Installer-5.0.0.update01-623860.x86_64.iso
Step 13 - Next we will create a Model which describes an ESXi 5 install and it's configurations. You will need to make a note of the UUID of the ISO we just uploaded from the previous step. Run the following command to create the model:
razor model add template=vmware_esxi_5 label=install_esxi5 image_uuid=5JC9GT8GToMak0DD3Uivkehere.
Step 14 - Okay, we are almost done! Now we just need to create a policy which binds the model to some set of attributes, such as the tags on our ESXi hosts that we wish to build. In my lab, I created a few vESXi hosts using steps found here and then creating a few Linked Clones so I did not have to waste any storage space using this script here. If you are using a vESXi host, by default you will get the vmware_vm tag which is what our base our policy on. Run the following command to create the policy:
razor policy add template=vmware_hypervisor label=install_esxi5 model_uuid=2w1QEGbkoXDELc6ndXb13A broker_uuid=none tags=vmware_vm enabled=true
Step 15 - We can check our policy and confirm there are no nodes registered to Razor again, by running the following commands:
razor policy active
If you are interested in learning more about Razor, I highly recommend you check out Nick's blog here as well as the Razor project's Wiki on Github here and help provide feedback or even contribute code back to the project. Great job again Nick and team!