Update README for new example

This commit is contained in:
Cheng Sun 2015-01-02 15:43:12 +00:00
parent 1cf49992fa
commit 72fb12ab28

View File

@ -63,42 +63,45 @@ cd packer-builder-xenserver
If the build is successful, you should now have a `packer-builder-xenserver` binary If the build is successful, you should now have a `packer-builder-xenserver` binary
in your `$GOPATH/bin` directory and you are ready to get going with packer. in your `$GOPATH/bin` directory and you are ready to get going with packer.
## Centos 6.4 Example ## Centos 6.6 Example
Once you've setup the above, you are good to go with an example. Once you've setup the above, you are good to go with an example.
To get you started, there is an example config file which you can use: [`examples/centos-6.4.conf`](https://github.com/rdobson/packer-builder-xenserver/blob/master/examples/centos-6.4.conf) To get you started, there is an example config file which you can use:
[`examples/centos-6.6.json`](https://github.com/rdobson/packer-builder-xenserver/blob/master/examples/centos-6.6.json)
Currently it is not (easily) possible to take care of the ISO download and upload, The example is functional, once suitable `remote_host`, `remote_username` and
so you will need to attach an ISO SR to the XenServer host (NFS/CIFS) with the `remote_password` configurations have been substituted.
ISO you want to use for installation. You will then need to specify the name
in the config file (this must be unique).
A brief explanation of what the config parameters mean:
An explanation of what these parameters are doing: * `type` - specifies the builder type. This is 'xenserver-iso', for installing
* `type` - this specifies the builder. This must be 'xenserver'. a VM from scratch, or 'xenserver-xva' to import existing XVA as a starting
* `username` - this is the username for the XenServer host being used. point.
* `password` - this is the password for the XenServer host being used. * `remote_username` - the username for the XenServer host being used.
* `host_ip` - this is the IP for the XenServer host being used. * `remote_password` - the password for the XenServer host being used.
* `instance_name` - this is the name that should be given to the created VM. * `remote_host` - the IP for the XenServer host being used.
* `instance_memory` - this is the static memory configuration for the VM. * `vm_name` - the name that should be given to the created VM.
* `root_disk_size` - this is the size of the disk the VM should be created with. * `vm_memory` - the static memory configuration for the VM, in MB.
* `iso_name` - this is the name of the ISO visible on a ISO SR connected to the XenServer host. * `disk_size` - the size of the disk the VM should be created with, in MB.
* `iso_name` - the name of the ISO visible on a ISO SR connected to the XenServer host.
* `http_directory` - the path to a local directory to serve up over http. * `http_directory` - the path to a local directory to serve up over http.
* `local_ip` - the IP on the machine you are running packer that your XenServer can connect too.
* `ssh_username` - the username set by the installer for the instance. * `ssh_username` - the username set by the installer for the instance.
* `ssh_password` - the password set by the installer for the instance. * `ssh_password` - the password set by the installer for the instance.
* `boot_command` - a set of commands to be sent to the instance over VNC. * `boot_command` - a list of commands to be sent to the instance over VNC.
Note, the `http_directory` parameter is only required if you
Note, the `http_directory` and `local_ip` parameters are only required if you want Packer to serve up files over HTTP. In this example, the templated variables
want packer to serve up files over HTTP. In this example, the templated variables `{{ .HTTPIP }}` and `{{ .HTTPPort }}` will be substituted for the local IP and
`{{ .HTTPIP }}` and `{{ .HTTPPort }}` will be substituted for the `local_ip` and the port that Packer starts its HTTP service on.
the port that packer starts it's HTTP service on.
Once you've updated the config file with your own parameters, you can use packer Once you've updated the config file with your own parameters, you can use packer
to build this VM with the following: to build this VM with the following command:
``` ```
packer build centos-6.4.conf packer build centos-6.6.json
``` ```
# Documentation
For complete documentation on configuration commands, see either [the
xenserver-iso docs](https://github.com/rdobson/packer-builder-xenserver/blob/master/docs/builders/xenserver-iso.html.markdown) or [the xenserver-xva docs](https://github.com/rdobson/packer-builder-xenserver/blob/master/docs/builders/xenserver-xva.html.markdown).