Good afternoon,
I am pretty sure this is a simple task. We have an existing ova file ( 20 Gbyte /dev/sda ) we are converting to a vmx and then trying to add an extra Hard Disk too ( 120 Gbyte /dev/sdb )
Using this packer.hcl file it never creates the /dev/sdb ( and pretty sure its missing more parameters )
variable "hostname" {
type = string
}
variable "ssh_username" {
type = string
}
variable "ssh_password" {
type = string
sensitive = true
}
variable "vmware_source_path" {
type = string
}
variable "disk_additional_size_mb" {
type = list(number)
default = [102400]
}
locals {
vm_name = "vmware-${formatdate("YYYY-MM-DD-hh-mm-ss", timestamp())}"
output_directory = "./builds/vmx"
}
source "vmware-vmx" "ubuntu1804" {
headless = true
output_directory = local.output_directory
shutdown_command = "sudo -S shutdown -P now"
source_path = var.vmware_source_path
ssh_password = var.ssh_password
ssh_port = 22
ssh_username = var.ssh_username
vm_name = local.vm_name
format = "ova"
ovftool_options = [ "--shaAlgorithm=SHA1" ]
disk_additional_size = var.disk_additional_size_mb
vmx_data_post = {
"memsize": "8192"
"numvcpus": "4"
}
}
build {
sources = ["sources.vmware-vmx.ubuntu1804"]
provisioner "ansible" {
playbook_file = "../ansible/playbook.yml"
inventory_directory = "../ansible/inventory/"
ansible_env_vars = ["ANSIBLE_CONFIG=./ansible.cfg"]
galaxy_file = "../ansible/ansible-requirements.yml"
galaxy_force_install = true
use_proxy = true
groups = ["hosts"]
host_alias = var.hostname
user = var.ssh_username
}
post-processor "shell-local" {
environment_vars = [
"OVA=${local.output_directory}/${local.vm_name}.ova",
]
script = "./set_empty_ova_properties.sh"
}
}