• Infrastructure
    • terraform
    • packer
  • Networking
    • consul
  • Security
    • vault
    • boundary
  • Applications
    • nomad
    • waypoint
    • vagrant
  • HashiCorp Cloud Platform

    A fully managed platform to automate infrastructure on any cloud with HashiCorp products.

    • consul
    • terraform
    • vault
    • packerbeta
    Visit cloud.hashicorp.com
  • Overview
  • Tutorials
  • Docs
  • Plugins
  • Community
GitHubInstall PackerTry HCP Packer
  • About External Plugins

      • 1&1
      • Alicloud ECS
      • Alicloud Import
      • Anka Registry Push
      • VM Clone
      • VM Create
      • Ansible (Remote)
      • Ansible Local
      • Overview
      • Amazon AMI
      • Parameter Store
      • Secrets Manager
      • Overview
      • chroot
      • EBS
      • EBS Surrogate
      • EBS Volume
      • Instance
      • Amazon Import
      • Overview
      • ARM
      • chroot
      • DTL
      • Azure DTL Artifact
      • Chef Client
      • Chef Solo
      • CloudStack
      • Converge
      • digitalocean
      • digitalocean-import
      • Docker
      • Docker Import
      • Docker Push
      • Docker Save
      • Docker Tag
      • Overview
      • Commit
      • Repository
      • Tree
      • Google Cloud Platform
      • googlecompute-export
      • googlecompute-import
      • Overview
      • Receipt
      • Overview
      • Toppings
      • Overview
      • Coffees
      • Ingredients
      • Overview
      • Order
      • Hetzner Cloud
      • HuaweiCloud
      • HyperOne
      • Overview
      • ISO
      • VMCX
      • InSpec
      • JDCloud
      • Kamatera
      • Linode
      • Libvirt
      • LXC
      • LXD
      • Naver Cloud
      • OpenStack
      • Overview
      • Classic
      • OCI
      • Overview
      • BSU
      • BSU Surrogate
      • BSU Volume
      • chroot
      • Overview
      • ISO
      • PVM
      • ProfitBricks
      • Overview
      • Clone
      • ISO
      • Puppet Masterless
      • Puppet Server
      • QEMU
      • Salt Masterless
      • Scaleway
      • SSH Key
      • Tencent Cloud
      • Triton
      • UCloud
      • UCloud Import
      • upcloud
      • upcloud-import
      • Vagrant
      • Vagrant
      • Vagrant Cloud
      • Overview
      • ISO
      • OVF
      • VM
      • Overview
      • Clone
      • ISO
      • vSphere
      • vSphere Template
      • Overview
      • ISO
      • VMX
      • Vultr
      • Yandex
      • yandex-export
      • yandex-import
Type '/' to Search
Verified
v1.5.1

UpCloud Import Post-Processor

Type: upcloud-import
Artifact BuilderId: packer.post-processor.upcloud-import

The UpCloud importer can be used to import raw disk images as private templates to UpCloud.

Required

Username and password configuration arguments can be omitted if environment variables UPCLOUD_USERNAME and UPCLOUD_PASSWORD are set.

  • username (string) - The username to use when interfacing with the UpCloud API.

  • password (string) - The password to use when interfacing with the UpCloud API.

  • zones ([]string) - The list of zones in which the template should be imported

  • template_name (string) - The name of the template. Use replace_existing to replace existing template with same name or suffix template name with e.g. timestamp to avoid errors during import

Optional

  • replace_existing (bool) - Replace existing template if one exists with the same name. Defaults to false.

  • state_timeout_duration (duration string | ex: "1h5m2s") - The amount of time to wait for resource state changes. Defaults to 60m.

Example Usage

Import raw disk image from filesystem using compress post-processor to compress image before upload

variable "username" {
  type        = string
  description = "UpCloud API username"
  default     = env("UPCLOUD_USERNAME")
}

variable "password" {
  type        = string
  description = "UpCloud API password"
  default     = env("UPCLOUD_PASSWORD")
  sensitive   = true
}

variable "image_path" {
  type        = string
  description = "Image path"
  default     = env("UPCLOUD_IMAGE_PATH")
}

source "file" "import-example" {
  source = var.image_path
  target = "tmp/${basename(var.image_path)}"
}

build {
  sources = ["file.import-example"]

  post-processors {
    post-processor "compress" {
      output = "tmp/${basename(var.image_path)}.gz"
    }
    post-processor "upcloud-import" {
      template_name    = "import-demo"
      replace_existing = true
      username         = "${var.username}"
      password         = "${var.password}"
      zones            = ["pl-waw1", "fi-hel2"]
    }
  }
}
variable "username" {
  type        = string
  description = "UpCloud API username"
  default     = env("UPCLOUD_USERNAME")
}
 
variable "password" {
  type        = string
  description = "UpCloud API password"
  default     = env("UPCLOUD_PASSWORD")
  sensitive   = true
}
 
variable "image_path" {
  type        = string
  description = "Image path"
  default     = env("UPCLOUD_IMAGE_PATH")
}
 
source "file" "import-example" {
  source = var.image_path
  target = "tmp/${basename(var.image_path)}"
}
 
build {
  sources = ["file.import-example"]
 
  post-processors {
    post-processor "compress" {
      output = "tmp/${basename(var.image_path)}.gz"
    }
    post-processor "upcloud-import" {
      template_name    = "import-demo"
      replace_existing = true
      username         = "${var.username}"
      password         = "${var.password}"
      zones            = ["pl-waw1", "fi-hel2"]
    }
  }
}

Import image created by QEMU builder

source "qemu" "example" {
  format           = "raw"
  # .. rest of the parameters ..
}

build {
  sources = ["source.qemu.example"]
  post-processors {
    post-processor "upcloud-import" {
      template_name    = "${local.template_name}"
      replace_existing = true
      zones            = ["pl-waw1"]
    }
  }
}
source "qemu" "example" {
  format           = "raw"
  # .. rest of the parameters ..
}
 
build {
  sources = ["source.qemu.example"]
  post-processors {
    post-processor "upcloud-import" {
      template_name    = "${local.template_name}"
      replace_existing = true
      zones            = ["pl-waw1"]
    }
  }
}
github logoEdit this page
IntroGuidesDocsCommunityPrivacySecurityPress KitConsent Manager