Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. For an introduction to Packer, check out documentation at http://www.packer.io/intro/index.html.
This is an Azure plugin for Packer.io to enable Microsoft Azure users to build custom images given an Azure image.
You must have an Azure subscription to begin using Azure. http://azure.microsoft.com
You can build Linux and Windows Azure images (targets) with this plugin.
You can execute the plugin from both Windows and Linux dev-boxes (clients).
The bin directory contains binaries and example configurations for Packer-Azure.
- packer-azure for Windows implemented as a PowerShell Azure wrapper and consists of two plug-ins: packer-builder-azure.exe and packer-provisioner-powershell-azure.exe (for Windows targets);
- To build the builder use this command: go install -tags 'powershell' github.com\MSOpenTech\packer-azure\packer\plugin\packer-builder-azure;
- To build the provisioner (for Windows targets) use this command: go install github.com\MSOpenTech\packer-azure\packer\plugin\packer-provisioner-powershell-azure;
-
packer-azure for Linux utilizes Service Management REST API and Storage Services REST API and consists of two plug-ins: packer-builder-azure and packer-provisioner-azure-custom-script-extension (for Windows targets). For Linux targets use well known "shell" provisioner;
-
To build the builder use this command: go install -tags 'restapi' github.com\MSOpenTech\packer-azure\packer\plugin\packer-builder-azure;
-
To build the provisioner (for Windows targets) use this command: go install github.com\MSOpenTech\packer-azure\packer\plugin\packer-provisioner-azure-custom-script-extension.
Visit http://msdn.microsoft.com/en-us/library/dn781373.aspx to understand how the provisioner works; -
To manage certificates packer-azure uses openssl;
-
To start using the plugin you will need to get PublishSetting profile. Visit one of the links bellow to get the profile:
-
Easy steps to build the plugin on Ubunty
- install go 1.3, visit https://golang.org/doc/install for details. Possible steps to install go 1.3:
- wget -P $HOME/downloads https://storage.googleapis.com/golang/go1.3.1.linux-amd64.tar.gz
- sudo tar -C /usr/local -xzf $HOME/downloads/go1.3.1.linux-amd64.tar.gz
- mkdir $HOME/go
- export PATH=$PATH:/usr/local/go/bin
- export GOROOT=/usr/local/go
- export GOPATH=$HOME/go
- export PATH=$PATH:$GOPATH/bin
- sudo apt-get install git
- sudo apt-get install mercurial meld
- go get github.com/MSOpenTech/packer-azure/packer/builder/azure/driver_restapi
- go get github.com/hashicorp/yamux
- go get github.com/hashicorp/go-msgpack/codec
- go install -tags 'restapi' github.com/MSOpenTech/packer-azure/packer/plugin/packer-builder-azure
- go install github.com/MSOpenTech/packer-azure/packer/plugin/packer-provisioner-azure-custom-script-extension
- copy built plugins from $GOPATH/bin to you Packer folder
- install go 1.3, visit https://golang.org/doc/install for details. Possible steps to install go 1.3:
-
Quick Packer configuration examples:
Linux target | Windows target | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{
|