-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
390ad16
commit f933e90
Showing
2 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
description: > | ||
The Nutanix packer plugin overview | ||
page_title: Nutanix plugin Overview | ||
nav_title: Overview | ||
--- | ||
# Nutanix Plugin Overview | ||
|
||
<!-- | ||
Include a short overview about the plugin. | ||
|
||
This document is a great location for creating a table of contents for each | ||
of the components the plugin may provide. This document should load automatically | ||
when navigating to the docs directory for a plugin. | ||
|
||
--> | ||
The `Nutanix` multi-component plugin can be used with HashiCorp [Packer](https://www.packer.io) | ||
to create custom images. | ||
|
||
## Installation | ||
|
||
### Using pre-built releases | ||
|
||
#### Using the `packer init` command | ||
|
||
Starting from version 1.7, Packer supports a new `packer init` command allowing | ||
automatic installation of Packer plugins. Read the | ||
[Packer documentation](https://www.packer.io/docs/commands/init) for more information. | ||
|
||
To install this plugin, copy and paste this code into your Packer configuration . | ||
Then, run [`packer init`](https://www.packer.io/docs/commands/init). | ||
|
||
```hcl | ||
packer { | ||
required_plugins { | ||
nutanix = { | ||
version = ">= 0.2.0" | ||
source = "github.com/nutanix-cloud-native/nutanix" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
#### Manual installation | ||
|
||
You can find pre-built binary releases of the plugin [here](https://github.com/nutanix-cloud-native/packer-plugin-nutanix/releases). | ||
Once you have downloaded the latest archive corresponding to your target OS, | ||
uncompress it to retrieve the plugin binary file corresponding to your platform. | ||
To install the plugin, please follow the official Packer documentation on [installing a plugin](https://www.packer.io/docs/extending/plugins/#installing-plugins). | ||
|
||
|
||
#### From Source | ||
|
||
If you prefer to build the plugin from its source code, clone the GitHub repository locally and run the command `make build` from the root directory. | ||
Upon successful compilation, a `packer-plugin-nutanix` plugin binary file can be found in the root directory. | ||
To install the compiled plugin, please follow the official Packer documentation on [installing a plugin](https://www.packer.io/docs/extending/plugins/#installing-plugins). | ||
|
||
### Configuration | ||
|
||
For more information on how to configure the plugin, please find some examples in the [`example/`](https://github.com/nutanix-cloud-native/packer-plugin-nutanix/example) directory. | ||
|
||
|
||
## Builder | ||
|
||
- The builder of the plugin is detailed [here](plugin). | ||
|
||
## Limitations | ||
### Building temporary ISOs on MacOS | ||
If you want to use the cd_files Option to create an additional iso-image for kickstart-files or similiar be aware that MacOS won´t create a suitable file. | ||
Please install xorriso for support on MacOS. | ||
``` | ||
brew install xorriso | ||
``` | ||
### Image Creation | ||
Right now the plugin cannot upload source-images directly, but Terraform can be used to create a source image before running packer itself. | ||
Create a Terraform Manifest using the Nutanix Provider to create your Image and define an output with your image uuid. You can pass this uuid into a Packer Variable. In that case the centos_iso_image_name Variable in the example settings file must be commented. | ||
``` | ||
export PKR_VAR_centos_iso_image_name=$(terraform output -raw centos_uuid) | ||
``` | ||
## Contributing | ||
See the [contributing docs](CONTRIBUTING.md). | ||
|
||
## Support | ||
### Community Plus | ||
|
||
This code is developed in the open with input from the community through issues and PRs. A Nutanix engineering team serves as the maintainer. Documentation is available in the project repository. | ||
|
||
Issues and enhancement requests can be submitted in the [Issues tab of this repository](../../issues). Please search for and review the existing open issues before submitting a new issue. | ||
|
||
## License | ||
The project is released under version 2.0 of the [Apache license](http://www.apache.org/licenses/LICENSE-2.0). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
--- | ||
description: > | ||
The Nutanix packer plugin allow to use Packer on Nutanix AHV platform. | ||
page_title: Nutanix plugin | ||
nav_title: Nutanix | ||
--- | ||
|
||
# Nutanix Builder | ||
|
||
This document is going to detail all Nutanix plugin source parameters. | ||
|
||
## Principle | ||
The Nutanix plugin will create a temporary VM as foundation of your Packer image, apply all providers your want to customize your image, then clone the VM disk image as your final Packer image. | ||
|
||
## Environment configuration | ||
These parameters allow to define information about platform and temporary VM used to create the image. | ||
|
||
### Required | ||
- `nutanix_username` (string) - User used for Prism Central login | ||
- `nutanix_password` (string) - Password of this user for Prism Central login | ||
- `nutanix_endpoint` (string) - Prism Central FQDN or IP | ||
- `cluster_name` or `cluster_uuid` (string) - Nutanix cluster name or uuid used to create and store image | ||
- `os_type` (string) - OS Type ("Linux" or "Windows") | ||
|
||
### Optional | ||
- `nutanix_port` (integer) - Port configured on Prism Central to connect on | ||
- `nutanix_insecure` (boolean) - Authorize connection on Prism Central without valid certificate | ||
- `cpu` (integer) - Number of vCPU for temporary VM | ||
- `memory_mb` (integer) - Size of vRAM for temporary VM (in megabytes) | ||
- `cd_files` (array of strings) - A list of files to place onto a CD that is attached when the VM is booted. This can include either files or directories; any directories will be copied onto the CD recursively, preserving directory structure hierarchy | ||
- `cd_label` (string) - Label of this CD Drive | ||
- `boot_type` (string) - Type of boot used on the temporary VM ("legacy" or "UEFI") | ||
|
||
## Output configuration | ||
These parameters allow to configure everything around image creation, from the temporary VM connection to the final image definition. | ||
|
||
### All OS | ||
- `image_name` (string) - Name of the output image | ||
- `shutdown_command` (string) - Command line to shutdown your temporary VM | ||
- `shutdown_timeout` (string) - Timeout for VM shutdown (format : 2m) | ||
- `communicator` (string) - Protocol used for Packer connection (ex "winrm" or "ssh"). Default is : "ssh" | ||
|
||
### Dedicated to Linux | ||
- `user_data` (string) - cloud-init (Linux) content base64 coded. | ||
- `ssh_username` (string) - user for ssh connection initiated by Packer. | ||
- `ssh_password` (string) - password for the this ssh user. | ||
|
||
### Dedicated to Windows | ||
- `winrm_port` (integer) - Port for WinRM communication (Default is 5986) | ||
- `winrm_insecure` (boolean) - Allow insecure connection on WinRM | ||
- `winrm_use_ssl` (boolean) - Request SSL connection with WinRM | ||
- `winrm_timeout` (string) - Timeout for WinRM (format 45m) | ||
- `winrm_username` (string) - User login for WinRM connection | ||
- `winrm_password` (string) - Password this User | ||
|
||
## Disk configuration | ||
Use `vm_disks{}` entry to configure disk to your VM image. If you want to configure several disks, use this entry multiple times. | ||
|
||
All parameters of this `vm_disks` section are described below. | ||
|
||
3 types of disk configurations can by used | ||
- disk (create an empty disk) | ||
- disk image (create disk from image) | ||
- ISO image (create disk from image). | ||
|
||
### Disk | ||
- `image_type` (string) - "DISK" | ||
- `disk_size_gb` (integer) - size of th disk (in gigabytes) | ||
|
||
Sample: | ||
```hcl | ||
vm_disks { | ||
image_type = "DISK" | ||
disk_size_gb = 30 | ||
} | ||
``` | ||
|
||
### Disk image | ||
- `image_type` (string) - "DISK_IMAGE" | ||
- `source_image_name` (string) - Name of the image used as disk source (If you want an empty disk, do not specify source) | ||
- `source_image_uuid` (string) - UUID of the image used as disk source (If you want an empty disk, do not specify source) | ||
- `disk_size_gb` (integer) - size of th disk (in gigabytes) | ||
|
||
Sample: | ||
```hcl | ||
vm_disks { | ||
image_type = "DISK_IMAGE" | ||
source_image_name = "<myDiskImage>" | ||
disk_size_gb = 40 | ||
} | ||
``` | ||
### ISO Image | ||
- `image_type` (string) - "ISO_IMAGE" | ||
- `source_image_name` (string) - Name of the ISO image to mount | ||
- `source_image_uuid` (string) - UUID of the ISO image to mount | ||
|
||
Sample: | ||
```hcl | ||
vm_disks { | ||
image_type = "ISO_IMAGE" | ||
source_image_name = "<myISOimage>" | ||
} | ||
``` | ||
|
||
## Network Configuration | ||
Use `vm_nics{}` entry to configure NICs in your image | ||
|
||
In this section, you have to define network you will connect on with this keyword : | ||
|
||
- `subnet_name` (string) - Name of the cluster subnet to use | ||
- `subnet_uuid` (string) - UUID of the cluster subnet to use | ||
|
||
Sample | ||
```hcl | ||
vm_nics { | ||
subnet_name = "<mySubnet>" | ||
} | ||
``` | ||
|
||
## Samples | ||
You can find samples [here](https://github.com/nutanix-cloud-native/packer-plugin-nutanix/example) for these instructions usage. |