From eeb66603ebb319e598294de749554852df39a8e1 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Tue, 22 Dec 2020 14:57:16 -0800 Subject: [PATCH] Update docs to reflect current state of the project --- README.md | 108 +++++----------------- docs/builders/xenserver-iso.html.markdown | 3 +- 2 files changed, 26 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 7629fca..9fe8ca8 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,34 @@ -[![Build Status](https://travis-ci.org/xenserver/packer-builder-xenserver.svg?branch=master)](https://travis-ci.org/xenserver/packer-builder-xenserver) - # XenServer packer.io builder This builder plugin extends packer.io to support building images for XenServer. -You can check out packer [here](https://packer.io). +This is a fork of the original builder since the original project was abandoned and no longer compilied with recent versions of Go or worked with Xenserver 7.6 and later. +It improves the original project in the following ways: +2. Developed alongside the [Xenorchestra terraform provider](https://github.com/ddelnano/terraform-provider-xenorchestra) to ensure the hashicorp ecosystem is interoperable. +3. Reimplements how the boot commands are sent over VNC to be compatible with later versions of Xenserver (Citrix hypervisor) and XCP -## Dependencies -* Packer >= 0.7.2 (https://packer.io) -* XenServer > 6.2 (http://xenserver.org) -* Golang (tested with 1.2.1) +## Status +At the time of this writing the packer builder has been verified to work with Xenserver 7.6 and can launch VMs with the packer output through the xenorchestra terraform provider. -## Install Go +The following list contains things that are incomplete but will be worked on soon: +- Official binaries have not been released yet +- The documentation is still in an inconsistent state with upstream +- Examples that are easier for new users to get up and running quickly +- XVA builder is untested +- Lots of dead code to remove from upstream -Follow these instructions and install golang on your system: -* https://golang.org/doc/install +## Using the builder -## Install Packer +Official release binaries will be attached to the project's GitHub releases. Download the relevant release and copy the binary to `~/.packer.d/plugin/packer-builder-xenserver-iso`. -Clone the Packer repository: +## Developing the builder -```shell -git clone https://github.com/mitchellh/packer.git -``` - -Then follow the [instructions to build and install a development version of Packer](https://github.com/mitchellh/packer#developing-packer). +### Dependencies +* Packer >= v0.10.2 (https://packer.io) +* XenServer / Citrix Hypervisor > 7.6 +* Golang 1.14 ## Compile the plugin @@ -34,74 +36,14 @@ Once you have installed Packer, you must compile this plugin and install the resulting binary. ```shell -cd $GOROOT -mkdir -p src/github.com/xenserver/ -cd src/github.com/xenserver -git clone https://github.com/xenserver/packer-builder-xenserver.git -cd packer-builder-xenserver -./build.sh -``` +$ go build github.com/xenserver/packer-builder-xenserver/plugin/builder-xenserver-iso -If the build is successful, you should now have `packer-builder-xenserver-iso` and -`packer-builder-xenserver-xva` binaries in your `$GOPATH/bin` directory and you are -ready to get going with packer; skip to the CentOS 6.6 example below. - -In order to do a cross-compile, run instead: -```shell -XC_OS="windows linux" XC_ARCH="386 amd64" ./build.sh -``` -This builds 32 and 64 bit binaries for both Windows and Linux. Native binaries will -be installed in `$GOPATH/bin` as above, and cross-compiled ones in the `pkg/` directory. - -Don't forget to also cross compile Packer, by running -```shell -XC_OS="windows linux" XC_ARCH="386 amd64" make bin -``` -(instead of `make dev`) in the directory where you checked out Packer. - -## CentOS 6.6 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.6.json`](https://github.com/xenserver/packer-builder-xenserver/blob/master/examples/centos-6.6.json) - -The example is functional, once suitable `remote_host`, `remote_username` and -`remote_password` configurations have been substituted. - -A brief explanation of what the config parameters mean: - * `type` - specifies the builder type. This is 'xenserver-iso', for installing - a VM from scratch, or 'xenserver-xva' to import existing XVA as a starting - point. - * `remote_username` - the username for the XenServer host being used. - * `remote_password` - the password for the XenServer host being used. - * `remote_host` - the IP for the XenServer host being used. - * `vm_name` - the name that should be given to the created VM. - * `vcpus_max` - the maximum number of VCPUs for the VM. - * `vcpus_atstartup` - the number of startup VCPUs for the VM. - * `vm_memory` - the static memory configuration for the VM, in MB. - * `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. - * `ssh_username` - the username set by the installer for the instance. - * `ssh_password` - the password set by the installer for the instance. - * `boot_command` - a list of commands to be sent to the instance over VNC. - * `vm_other_config` - a map of string to string for setting vm's other-config. - * `network_names` - a list of network name for the VIFs to connect with. - -Note, the `http_directory` parameter is only required if you -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 -the port that Packer starts its HTTP service on. - -Once you've updated the config file with your own parameters, you can use packer -to build this VM with the following command: - -``` -packer build centos-6.6.json +# Add the builder to the location packer expects it to be installed in +$ mkdir -p ~/.packer.d/plugins/ +$ cp builder-xenserver-iso ~/.packer.d/plugins/packer-builder-xenserver-iso ``` # 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). +For complete documentation on configuration commands, see [the +xenserver-iso docs](docs/builders/xenserver-iso.html.markdown) diff --git a/docs/builders/xenserver-iso.html.markdown b/docs/builders/xenserver-iso.html.markdown index 8afe06b..0108a14 100644 --- a/docs/builders/xenserver-iso.html.markdown +++ b/docs/builders/xenserver-iso.html.markdown @@ -10,8 +10,7 @@ description: |- Type: `xenserver-iso` The XenServer Packer builder is able to create [XenServer](https://www.xenserver.org/) -virtual machines and export them either as an XVA or a VDI, starting from an -ISO image. +virtual machines and export them either as an XVA or a VDI and create VM templates starting from an ISO image. The builder builds a virtual machine by creating a new virtual machine from scratch, booting it, installing an OS, provisioning software within