Git Product home page Git Product logo

packer-post-processor-vsphere-template's Introduction

VSphere Template Post Processor

This post-processor creates VSphere templates from Virtualbox packer builders. It expects the VBoxManage output step to create OVF files.

Compatibility

So far this has been tested with Virtualbox 5.1.6, VSphere running ESXI 5.5, and packer 0.10.1. I see no reason why other combinations won't work as well.

Installing

Download your platform-specific binary from the latest releases page. Either put your binary somewhere accessible on your path or reference the absolute path to the binary in your $HOME/.packerconfig file, like this:

{
  "post-processors": {
    "vsphere-template": "/path/to/packer-post-processor-vsphere-template"
  }
}

Use the post-processor as follows in your packer manifest:

"post-processors": [
  {
    "type":            "vsphere-template",
    "host":            "{{user `vsphere_host`}}",
    "username":        "{{user `vsphere_username`}}",
    "password":        "{{user `vsphere_password`}}",
    "datacenter":      "{{user `vsphere_datacenter`}}",
    "resource_pool":   "{{user `vsphere_resource_pool`}}",
    "folder":          "{{user `vsphere_folder`}}",
    "datastore":       "{{user `vsphere_datastore`}}"
  }
]

The following attributes are available:

Attribute Description Required/Optional
host VCenter host for API calls required
username Username to use for auth required
password Password to use for auth required
datacenter The datacenter where the template will be deployed required
resource_pool The resource pool for the template required
folder The vm folder to place the template in required
datastore The datastore to back the template disk required
os_type The VMWare os type to inject into the OVF (defaults to centos64Guest) optional
os_id The VMWare os id to inject into the OVF template (defaults to 107) optional
os_version The VMWare os version to inject into the OVF template (defaults to "") optional
vm_name The name of the OVF template to upload (defaults to the builder name) optional
hardware_version The VMWare hardware version to inject into the OVF (defaults to vmx-10) optional

packer-post-processor-vsphere-template's People

Stargazers

 avatar

Watchers

 avatar  avatar

packer-post-processor-vsphere-template's Issues

No Resource Pool

Hi,

I haven't any Resource Pool defined in my vCenter.
I think this parameter must not be required.

Can you change this to optional ?

Regards,

Support capability to provide a custom OVF template

I want to provide a custom OVF template in this workflow. Would that be possible with this plugin. I am a bit confused by the internals as when I run the virtualbox-iso with format: ovf, I only get one file, but in the source code of this plugin, I see both a vmdk as well as ovf being iterated upon.

I am generating a coreos OVF from the ISO using the following packer manifest:

{
  "variables": {
    "name": "coreos-baseimage",
    "release": "stable",
    "iso_checksum": "",
    "iso_checksum_type": "none",
    "disk_size": "40000",
    "memory": "2048",
    "boot_wait": "15s",
    "ignition": "ignition.json"
  },
  "builders": [{
    "name": "{{user `name`}}",
    "guest_os_type": "Linux_64",
    "type": "virtualbox-iso",
    "iso_url": "coreos_production_iso_image.iso",
    "iso_checksum": "d97ed6c250f2037b6fd92471c2890176",
    "iso_checksum_type": "md5",
    "ssh_username": "core",
    "ssh_password": "packer",
    "shutdown_command": "shutdown -h now",
    "format": "ovf",
    "boot_wait": "{{user `boot_wait`}}",
    "boot_command": [
      "sudo passwd core<enter><wait>",
      "packer<enter>",
      "packer<enter>",
      "sudo systemctl start sshd.service<enter>"
    ],
    "vboxmanage": [
      ["modifyvm", "{{.Name}}", "--memory",  "{{user `memory`}}"]
    ]
  }],
  "provisioners": [
    {
      "type": "file",
      "source": "{{ user `ignition` }}",
      "destination": "/tmp/ignition.json"
    },
    {
        "type": "shell",
        "inline": [
            "sudo coreos-install -d /dev/sda -C {{ user `release` }} -i /tmp/ignition.json -o vmware_raw"
        ]
    }
  ],
  "post-processors": []
}

The custom OVF I wanna use with that is here.

I was wondering if I could somehow provide the custom OVF through artifice. But before I do that, I need a solid understanding of the process, which I feel you have as the author of this plugin.

Any help would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.