Whenever i am creating OVA file, I am unable to do so using following packer template:
packer file:
packer {
required_plugins {
azure = {
source = “github.com/hashicorp/azure”
version = “~> 2”
}
}
}
source “azure-arm” “autogenerated_2” {
azure_tags = {
dept = “Engineering”
task = “Image deployment”
}
client_id = “id”
client_secret = “secret”
image_offer = “0001-com-ubuntu-server-jammy”
image_publisher = “canonical”
headless = true
image_sku = “22_04-lts”
managed_image_name = “myPackerImage_serverBuild”
managed_image_resource_group_name = “PAYG”
build_resource_group_name = “PAYG”
os_type = “Linux”
subscription_id = “id”
tenant_id = “id”
vm_size = “Standard_B2ms”
}
provisioner “shell” {
inline = [
“sudo apt update”,
“sudo apt upgrade -y”,
“sudo apt install -y virtualbox”,
“sudo apt-get install --reinstall virtualbox virtualbox-dkms”,
“sudo modprobe vboxdrv”,
]
}
post-processor “shell-local” {
inline = [
“LATEST_VM=$(VBoxManage list vms --sorted | tail -n 1 | awk ‘{print $1}’ | tr -d ‘"’)”,
“echo "Latest VM: $LATEST_VM"”,
“VBoxManage export "$LATEST_VM" --output ubuntu-22.04.ova”
]
}
}