vmware-samples / packer-examples-for-vsphere Goto Github PK
View Code? Open in Web Editor NEWPacker Examples for vSphere
Home Page: https://vmware-samples.github.io/packer-examples-for-vsphere/
License: Other
Packer Examples for vSphere
Home Page: https://vmware-samples.github.io/packer-examples-for-vsphere/
License: Other
7.0 Update 2
1.7.6
1.0.1
Ubuntu 20.04
Used ISO is rhel-8.4-x86_64-dvd.iso
When building Red Hat Enerprise Linux 8 Server for VMware vSphere
, an error occurs during the Installing additional packages
step.
Successfully finish build
Error occurs because epel-release
not found.
rhel-8.4-x86_64-dvd.iso
redhat-linux-8
==> vsphere-iso.linux-redhat-linux: + echo '> Installing additional packages ...'
vsphere-iso.linux-redhat-linux: > Installing additional packages ...
==> vsphere-iso.linux-redhat-linux: + sudo dnf install -y epel-release curl wget git vim net-tools unzip ca-certificates
vsphere-iso.linux-redhat-linux: Updating Subscription Management repositories.
vsphere-iso.linux-redhat-linux: Last metadata expiration check: 0:03:22 ago on Sun 03 Oct 2021 07:45:10 PM UTC.
vsphere-iso.linux-redhat-linux: No match for argument: epel-release
vsphere-iso.linux-redhat-linux: Package curl-7.61.1-18.el8_4.1.x86_64 is already installed.
vsphere-iso.linux-redhat-linux: Package ca-certificates-2021.2.50-80.0.el8_4.noarch is already installed.
==> vsphere-iso.linux-redhat-linux: Error: Unable to find a match: epel-release
==> vsphere-iso.linux-redhat-linux: Provisioning step had errors: Running the cleanup provisioner, if present...
==> vsphere-iso.linux-redhat-linux: Power off VM...
==> vsphere-iso.linux-redhat-linux: Destroying VM...
Build 'vsphere-iso.linux-redhat-linux' errored after 11 minutes 28 seconds: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
No response
No response
22.03 (Default)
7.0 U2
1.8.0
1.0.3
Ubuntu Server 20.04 LTS
I am running Packer in a VM which is attached to the same network as the network I want to use when building images.
There is a DHCP server running in that VM network.
When running ./build.sh
and I select option 2 (Ubuntu 20.04 LTS), the VM gets created, I see in the logs that the USB device is typing, however it is not progressing past the "Boot Manager"
It should continue building (was looking at this repo via https://www.youtube.com/watch?v=0IvLnwqXFtM).
It hangs at "Boot Manager"
I ran the commands from the README.md. The ISO is being mounted properly by the way.
CONFIRM: Build a Ubuntu Server 20.04 LTS Template for VMware vSphere?
Continue? (y/n)
y
Building a Ubuntu Server 20.04 LTS Template for VMware vSphere...
Initializing HashiCorp Packer and required plugins...
Starting the build....
vsphere-iso.linux-ubuntu: output will be in this color.
==> vsphere-iso.linux-ubuntu: Creating VM...
==> vsphere-iso.linux-ubuntu: Customizing hardware...
==> vsphere-iso.linux-ubuntu: Adding SATA controller...
==> vsphere-iso.linux-ubuntu: Mounting ISO images...
==> vsphere-iso.linux-ubuntu: Adding configuration parameters...
==> vsphere-iso.linux-ubuntu: Starting HTTP server on port 8072
==> vsphere-iso.linux-ubuntu: Set boot order...
==> vsphere-iso.linux-ubuntu: Power on VM...
==> vsphere-iso.linux-ubuntu: Waiting 5s for boot...
==> vsphere-iso.linux-ubuntu: HTTP server is working at http://10.13.37.225:8072/
==> vsphere-iso.linux-ubuntu: Typing boot command...
==> vsphere-iso.linux-ubuntu: Waiting for IP...
Selecting "EFI Virtual Disk" will refresh the Boot Manager
Selecting "EFI VMware Virtual SATA CDRom Drive" will refresh the Boot Manager
Selecting "Boot normally" will show the following:
Use ansible
provisioner for Linux configuration and packages.
Cleaner management of configuration and packages for Linux machine images
No response
How to use it on one ESXI without a data center and a cluster? if you leave the values of the variables empty, then an error.
CONFIRM: Build a Ubuntu Server 20.04 LTS Template for VMware vSphere.
Continue? (y/n)
y
Building a Ubuntu Server 20.04 LTS Template for VMware vSphere ...
Initializing Hashicorp Packer and required plugins ...
Applying the HashiCorp Packer Build ...
Error: 1 error(s) occurred:
* 'host' or 'cluster' is required
on ubuntu-server-20-04-lts.pkr.hcl line 345:
(source code not available)
==> Wait completed after 6 microseconds
==> Builds finished but no artifacts were created.
Done.
Description
Add enhancement to support builds of AlmaLinux.
Use Case(s)
With the change of CentOS Linux from an enterprise-stable operating system to an upstream development branch of RHEL, new projects have rushed to fill the gap left in its wake.
AlmaLinux is built and maintained by the developers at CloudLinux, a company that provides server hosting and Linux software. It's a company experienced with RHEL forks, having built and maintained their in-house distro called CloudLinux OS, a fork itself, for more than a decade. Going forward, CloudLinux promises to involve the community as much as possible when it comes to the direction of the distro.
Rocky Linux (recently added to this repo as a build) is headed up by Gregory Kurtzer, the original founder of CentOS. Rocky Linux is community-driven, and doesn't have the commercial developers on payroll the way AlmaLinux does. Depending on your point of view, this could be either a good or bad thing. One could also argue that if Kurtzer would have had CentOS' interests in mind in the first place, it wouldn't have been swallowed up by Red Hat and undergone the change in direction.
AlmaLinux and Rocky Linux naturally have a lot of similarities, but have some big differences in how they're maintained. Both distros are expected to be viable replacements for CentOS, and it probably won't make a huge difference which one you use. Being that they're both binary compatible with RHEL, you could theoretically switch between Alma and Rocky if it ever became necessary.
Potential References
The build should be very similar to RHEL and Rocky.
Add SLES 15 machone image.
Any company that has standardized on SUSE Linux Enterprise Server 15.
Add SLES with the same options as other *nix distro's.
No response
main
7.0 Update 2
1.7.6
1.0.1
Ubuntu 20.04
Used ISO is photon-4.0-ca7c9e933.iso
When building VMware Photon OS 4 Template for VMware vSphere
, SSH timeout occurs.
Successfully finish build
Build timeout
photon-4.0-ca7c9e933.iso
from https://packages.vmware.com/photon/4.0/Rev1/iso/photon-4.0-ca7c9e933.iso./build.sh
and select photon-4
vsphere-iso.linux-photon: output will be in this color.
==> vsphere-iso.linux-photon: Creating VM...
==> vsphere-iso.linux-photon: Customizing hardware...
==> vsphere-iso.linux-photon: Adding SATA controller...
==> vsphere-iso.linux-photon: Mounting ISO images...
==> vsphere-iso.linux-photon: Adding configuration parameters...
==> vsphere-iso.linux-photon: Starting HTTP server on port 8041
==> vsphere-iso.linux-photon: Set boot order...
==> vsphere-iso.linux-photon: Power on VM...
==> vsphere-iso.linux-photon: Waiting 2s for boot...
==> vsphere-iso.linux-photon: HTTP server is working at http://172.19.36.72:8041/
==> vsphere-iso.linux-photon: Typing boot command...
==> vsphere-iso.linux-photon: Waiting for IP...
==> vsphere-iso.linux-photon: IP address: 172.19.36.43
==> vsphere-iso.linux-photon: Using SSH communicator to connect: 172.19.36.43
==> vsphere-iso.linux-photon: Waiting for SSH to become available...
No response
No SSH service is running in the installed OS.
ps -aef | grep ssh
returns nothing.
Packer 1.7.4
Vsphere: 7.0.2
Build successfully, but at the end of the build, there were two errors, just wondering what the messages mean?
`==> vsphere-iso.linux--server: Importing VM OVF template linux--server-20-04-lts to Content Library...
==> vsphere-iso.linux--server: Destroying VM...
==> vsphere-iso.linux--server: Running post-processor: (type manifest)
Build 'vsphere-iso.linux--server' errored after 8 minutes 12 seconds: 2 error(s) occurred:
==> Wait completed after 8 minutes 12 seconds
==> Some builds didn't complete successfully and had errors:
--> vsphere-iso.linux--server: 2 error(s) occurred:
==> Builds finished but no artifacts were created.
Done.
`
Currently, when the build starts, the boot command references the {{ .HTTPIP }} variable, which Packers sets as what ever the IP of the first interface is.
Adding this variable allows you to specify which IP address the build will use to get it's kickstart file from.
Packer build servers that service multiple separate networks or just have multiple interfaces.
Create a new variable in โbuilds > linux > centos-linux-8 > variables.pkr.hcl file:
variable "common_http_bind_address" {
type = string
description = "Force build to use this IP to download the kickstart file."
}
Define the variable in โbuilds > common.pkvars.hclโ file under the โBoot and Provisioning Settingsโ '
common_http_bind_address = "192.2.0.201"
Modify the "boot_command" in the 'builds > linux > centos-linux-8 > linux-centos-linux.pkr.hclโ to use the new variable
boot_command = ["up", "e", "<down><down><end><wait>", "text inst.ks=http://${var.common_http_bind_address}:{{ .HTTPPort }}/ks.cfg", "<enter><wait><leftCtrlOn>x<leftCtrlOff>"]
This could be used for all builds that require the ks file to be retrieved from the http server.
Use the flexibiliy of path.cwd
and path.root
when using build.sh to allow Packer to be launched from any directory
See https://www.packer.io/docs/templates/hcl_templates/path-variables for definition of these variables.
Launch packer
command from whatever directory that contains custom certificates
, scripts
and output manifests
.
No response
When filing a bug, please include the following information.
Description
The description for the vsphere_folder variable should be updated to reflect folder vs cluster.
Current:
variable "vsphere_folder" {
type = string
description = "The name of the target vSphere cluster. (e.g. 'sfo-w01-fd-templates')"
}
Expected Behavior
variable "vsphere_folder" {
type = string
description = "The name of the target vSphere folder. (e.g. 'sfo-w01-fd-templates')"
}
Actual Behavior
N/A
Steps to Reproduce
N/A
VMware vSphere Version
7.0.2
HashiCorp Packer Version
1.0.6
Simplified Packer Build or Variables File(s)
N/A
Guest Operating System and Environment Details
Guest Operating System
Log Fragments and crash.log Files
Additional Context
Add support for RHEL9 + derivatives:
Add support for RHEL9 + derivative machine images.
Starting with existing structures.
https://www.redhat.com/en/blog/hot-presses-red-hat-enterprise-linux-9
Rename the directory used for guest operating configuration data for multi-use.
build/data/
build/config/
source_content = {
"/meta-data" = file("data/meta-data")
"/user-data" = templatefile("data/user-data.pkrtpl.hcl", { build_username = var.build_username, build_password_encrypted = var.build_password_encrypted, vm_guest_os_language = var.vm_guest_os_language, vm_guest_os_keyboard = var.vm_guest_os_keyboard, vm_guest_os_timezone = var.vm_guest_os_timezone })
}
No response
New Ubuntu LTS will be released soon.
Use Ubuntu LTS 22.04.
Add builds/linux/ubuntu/22.04
build folder.
No response
Description
The future of the CentOS Project is CentOS Stream, and over the next year weโll be shifting focus from CentOS Linux, the rebuild of Red Hat Enterprise Linux (RHEL), to CentOS Stream, which tracks just ahead of a current RHEL release.
Read the rest of the announcement.
Use Case(s)
CentOS Linux 8, as a rebuild of RHEL 8, will end at the end of 2021. CentOS Stream continues after that date, serving as the upstream development branch of Red Hat Enterprise Linux.
Potential Configuration
# Maintainer: [email protected]
# Packer template for CentOS Stream 8.
# https://www.packer.io/docs/builders/vsphere/vsphere-iso
##################################################################################
# PACKER
##################################################################################
packer {
required_version = ">= 1.7.3"
}
##################################################################################
# VARIABLES
##################################################################################
# Credentials.
variable "vcenter_username" {
type = string
description = "The username to login to the vCenter Server instance. (e.g. [email protected])"
default = ""
sensitive = true
}
variable "vcenter_password" {
type = string
description = "The password for the login to the vCenter Server instance."
default = ""
sensitive = true
}
variable "build_username" {
type = string
description = "The username to login to the guest operating system. (e.g. rainpole)"
default = ""
sensitive = true
}
variable "build_password" {
type = string
description = "The password to login to the guest operating system."
default = ""
sensitive = true
}
# vSphere Objects
variable "vcenter_insecure_connection" {
type = bool
description = "Do not validate vCenter Server TLS certificate."
default = true
}
variable "vcenter_server" {
type = string
description = "The fully qualified domain name or IP address of the vCenter Server instance. (e.g. 'sfo-w01-vc01.sfo.rainpole.io')"
default = ""
}
variable "vcenter_datacenter" {
type = string
description = "The name of the target vSphere datacenter. (e.g. 'sfo-w01-dc01')"
default = ""
}
variable "vcenter_cluster" {
type = string
description = "The name of the target vSphere cluster. (e.g. 'sfo-w01-cl01')"
default = ""
}
variable "vcenter_datastore" {
type = string
description = "The name of the target vSphere datastore. (e.g. 'sfo-w01-cl01-vsan01')"
default = ""
}
variable "vcenter_network" {
type = string
description = "The name of the target vSphere network segment. (e.g. 'sfo-w01-dhcp')"
default = ""
}
variable "vcenter_folder" {
type = string
description = "The name of the target vSphere cluster. (e.g. 'sfo-w01-fd-templates')"
default = ""
}
variable "vcenter_content_library" {
type = string
description = "The name of the target vSphere content library, if used. (e.g. 'sfo-w01-cl01-lib01')"
default = ""
}
# ISO Objects
variable "iso_datastore" {
type = string
description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')"
default = ""
}
variable "iso_path" {
type = string
description = "The path on the source vSphere datastore for ISO images. (e.g. 'iso')"
default = ""
}
variable "iso_file" {
type = string
description = "The file name of the ISO image. (e.g. 'iso-centos-stream-8.iso')"
default = ""
}
variable "iso_checksum" {
type = string
description = "The SHA-512 checkcum of the ISO image. (e.g. Result of 'shasum -a 512 iso-centos-stream-8.iso')"
default = ""
}
# HTTP Endpoint for Kickstart
variable "http_directory" {
type = string
description = "The HTTP endpoint directory path. (e.g. ../../../configs/linux/centos-server/)"
default = ""
}
variable "http_file" {
type = string
description = "The guest operating system kickstart file. (e.g. ks.cfg)"
default = ""
}
# Virtual Machine Settings
variable "vm_guest_os_family" {
type = string
description = "The guest operatiing system family. Used for naming and VMware tools. (e.g.'linux')"
default = ""
}
variable "vm_guest_os_vendor" {
type = string
description = "The guest operatiing system vendor. Used for naming . (e.g. 'centos')"
default = ""
}
variable "vm_guest_os_member" {
type = string
description = "The guest operatiing system member. Used for naming. (e.g. 'stream')"
default = ""
}
variable "vm_guest_os_version" {
type = string
description = "The guest operatiing system version. Used for naming. (e.g. '8')"
default = ""
}
variable "vm_guest_os_type" {
type = string
description = "The guest operating system type, also know as guestid. (e.g. 'centos8_64Guest')"
default = ""
}
variable "vm_version" {
type = number
description = "The vSphere virtual hardware version. Refer to https://kb.vmware.com/kb/1003746. (e.g. '18')"
default = 18
}
variable "vm_firmware" {
type = string
description = "The virtual machine firmware. (e.g. 'bios' or 'efi')"
default = "bios"
}
variable "vm_cdrom_type" {
type = string
description = "The virtual machine CD-ROM type. (e.g. 'sata', or 'ide')"
default = "sata"
}
variable "vm_cpu_sockets" {
type = number
description = "The number of virtual CPUs sockets. (e.g. '2')"
default = 2
}
variable "vm_cpu_cores" {
type = number
description = "The number of virtual CPUs cores per socket. (e.g. '1')"
default = 1
}
variable "vm_mem_size" {
type = number
description = "The size for the virtual memory in MB. (e.g. '2048')"
default = 2048
}
variable "vm_disk_size" {
type = number
description = "The size for the virtual disk in MB. (e.g. '40960')"
default = 40960
}
variable "vm_disk_controller_type" {
type = list(string)
description = "The virtual disk controller types in sequence. (e.g. 'pvscsi')"
default = ["pvscsi"]
}
variable "vm_network_card" {
type = string
description = "The virtual network card type. (e.g. 'vmxnet3' or 'e1000e')"
default = "vmxnet3"
}
variable "vm_boot_wait" {
type = string
description = "The time to wait before boot. "
default = "2s"
}
variable "shell_scripts" {
type = list(string)
description = "A list of script and their relative paths to transfer and execute using SSH."
default = []
}
##################################################################################
# LOCALS
##################################################################################
locals {
buildtime = formatdate("YYYY-MM-DD hh:mm ZZZ", timestamp())
}
##################################################################################
# SOURCE
##################################################################################
source "vsphere-iso" "linux-centos-stream" {
vcenter_server = var.vcenter_server
username = var.vcenter_username
password = var.vcenter_password
datacenter = var.vcenter_datacenter
cluster = var.vcenter_cluster
datastore = var.vcenter_datastore
folder = var.vcenter_folder
insecure_connection = var.vcenter_insecure_connection
tools_upgrade_policy = true
remove_cdrom = true
convert_to_template = true
guest_os_type = var.vm_guest_os_type
vm_version = var.vm_version
notes = "Built by HashiCorp Packer on ${local.buildtime}."
vm_name = "${var.vm_guest_os_family}-${var.vm_guest_os_vendor}-${var.vm_guest_os_member}-${var.vm_guest_os_version}"
firmware = var.vm_firmware
CPUs = var.vm_cpu_sockets
cpu_cores = var.vm_cpu_cores
CPU_hot_plug = false
RAM = var.vm_mem_size
RAM_hot_plug = false
cdrom_type = var.vm_cdrom_type
disk_controller_type = var.vm_disk_controller_type
storage {
disk_size = var.vm_disk_size
disk_controller_index = 0
disk_thin_provisioned = true
}
network_adapters {
network = var.vcenter_network
network_card = var.vm_network_card
}
iso_paths = ["${ var.iso_datastore }${ var.iso_path }/${ var.iso_file }"]
iso_checksum = "sha512:var.iso_checksum"
http_directory = var.http_directory
boot_order = "disk,cdrom"
boot_wait = var.vm_boot_wait
boot_command = ["<tab>","text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/${var.http_file}","<enter><wait>"]
ip_wait_timeout = "20m"
ssh_password = var.build_password
ssh_username = var.build_username
ssh_port = 22
ssh_timeout = "20m"
ssh_handshake_attempts = "20"
shutdown_command = "echo '${var.build_password}' | sudo -S -E shutdown -P now"
shutdown_timeout = "15m"
/*
Comment or remove the option below to exclude the use of the vSphere content library.
- If ovf = true - the virtual machine image is exported to the target content library.
- If destroy = true - the virtual machine image is destroyed after a successfully exported the target content library
- By default, the target name is the vm_name unless name = "foo" is provided.
- The content library item is updated if the target name is the same.
*/
content_library_destination {
library = var.vcenter_content_library
ovf = true
destroy = true
}
}
##################################################################################
# BUILD
##################################################################################
build {
sources = ["source.vsphere-iso.linux-centos-server"]
/*
Uses the File Provisioner to copy the public key.
- The Shell Provisioner will execute a script that imports the public key to authorized_keys to the build user.
*/
provisioner "file" {
destination = "/tmp/id_ecdsa.pub"
source = "../../../keys/id_ecdsa.pub"
}
/*
Uses the File Provisioner to copy the .crt certificate for the Root Certificate Authority.
- The Shell Provisioner will execute a script that imports the certificate to the Certificate Authority Trust.
*/
provisioner "file" {
destination = "/tmp/root-ca.crt"
source = "../../../certificates/root-ca.crt"
}
// Uses the Shell Provisioner to execute a series of inline commands defined in the variables
provisioner "shell" {
execute_command = "echo '${var.build_password}' | {{.Vars}} sudo -E -S sh -eux '{{.Path}}'"
environment_vars = [
"BUILD_USERNAME=${var.build_username}"
]
scripts = var.shell_scripts
}
}
and
# Maintainer: [email protected]
# Packer template for CentOS Stream 8.
##################################################################################
# VARIABLES
##################################################################################
# HTTP Endpoint for Kickstart
http_directory = "../../../configs/linux/centos-server"
http_file = "ks-v8.cfg"
# Virtual Machine Settings
vm_guest_os_family = "linux"
vm_guest_os_vendor = "centos"
vm_guest_os_member = "stream"
vm_guest_os_version = "8"
vm_guest_os_type = "centos8_64Guest"
vm_version = 18
vm_firmware = "bios"
vm_cdrom_type = "sata"
vm_cpu_sockets = 2
vm_cpu_cores = 1
vm_mem_size = 2048
vm_disk_size = 40960
vm_disk_controller_type = ["pvscsi"]
vm_network_card = "vmxnet3"
vm_boot_wait = "2s"
# ISO Objects
iso_file = "iso-linux-centos-stream-8.iso"
iso_checksum = "552cf5dcdc9d3db41791a2b3bbbd18335d75607ca54e7aa8bf28a6ea1d49ce914a55da0bd839123aa96654b7de6db65cc786beb71e6233982ea96ce456a47035"
# Scripts
shell_scripts = ["../../../scripts/linux/centos-stream-cleanup.sh"]
Community Note
Please vote on this issue by adding a ๐ reaction to the original issue to help the maintainers prioritize this request.
Please do not leave "+1" or "me too" comments. These generate noise for issue followers and do not help prioritize the request.
The current build script is difficult to maintain when adding or sorting builds.
The build script is configurable with a configuration file.
No response
Description
Update all guestOS types for machine images in this repository to use only their "(Recommended)" firmware settings based on vSphere version support in this repository.
efi-secure
vm_guest_os_type = "windows2019srv_64Guest"
vm_guest_os_type = "windows9Server64Guest"
vm_guest_os_type = "rhel8_64Guest"
vm_guest_os_type = "centos8_64Guest"
vm_guest_os_type = "centos8_64Guest"
vm_guest_os_type = "centos8_64Guest"
bios
vm_guest_os_type = "vmwarePhoton64Guest"
vm_guest_os_type = "vmwarePhoton64Guest"
vm_guest_os_type = "rhel7_64Guest"
vm_guest_os_type = "ubuntu64Guest"
vm_guest_os_type = "ubuntu64Guest"
vm_guest_os_type = "centos7_64Guest"
vm_guest_os_type = "centos8_64Guest"
Note: Rocky Linux 8 Server will not boot into EFI even though it is centos8_64Guest
Use Case(s)
Ensure all machine images use the recommended firmware based on vSphere version support in this repository.
Community Note
Please vote on this issue by adding a ๐ reaction to the original issue to help the maintainers prioritize this request.
Please do not leave "+1" or "me too" comments. These generate noise for issue followers and do not help prioritize the request.
I don't get what rm -f output-vmware-iso/*.ova
is for.
N/A
N/A
No response
Nice repo !
I am trying to make Packer1.7+vSphere7.0.2 working together to create image of Ubuntu 2004, for some reason, it was waiting for getting IP address from DHCP, then after times out (no IP received) , the installation part started, but it wont auto install, it stopped at language selection screen.
Any details on how to make it work around these points?
Thanks
In the README.md
, Packer manifests are in manifests
folder.
manifests - manifests created after the completion of each build.
However, the current manifests are stored (and not ignored by GItHub) in an output
directory relative to the running build.
To do so, use Packer path variable to output manifest in /manifests folder.
Store manifests in a central location for the user.
/manifests
directory./manifests
directory..gitignore
to the /manifests
directory that ignores .json
output.No response
When filing a bug, please include the following information.
Description
VMware recently migrated Photon OS to a new package repository and for existing 3.x ISO images, users must point to the new repo which is now located at packages.vmware.com (previously hosted on bintray)
Expected Behavior
Successfully complete tdnf -y update
along installing any other packages
Actual Behavior
Failed to retrieve updates as the package repository is incorrect
==> vsphere-iso.linux-photon-server: Error: 401 when downloading https://dl.bintray.com/vmware/photon_release_3.0_x86_64/repodata/repomd.xml
==> vsphere-iso.linux-photon-server: . Please check repo url.
==> vsphere-iso.linux-photon-server: Error: Failed to synchronize cache for repo 'VMware Photon Linux 3.0(x86_64)' from 'https://dl.bintray.com/vmware/photon_release_3.0_x86_64'
==> vsphere-iso.linux-photon-server: Error: 401 when downloading https://dl.bintray.com/vmware/photon_updates_3.0_x86_64/repodata/repomd.xml
==> vsphere-iso.linux-photon-server: . Please check repo url.
==> vsphere-iso.linux-photon-server: Error: Failed to synchronize cache for repo 'VMware Photon Linux 3.0(x86_64) Updates' from 'https://dl.bintray.com/vmware/photon_updates_3.0_x86_64'
==> vsphere-iso.linux-photon-server: Error: 401 when downloading https://dl.bintray.com/vmware/photon_extras_3.0_x86_64/repodata/repomd.xml
==> vsphere-iso.linux-photon-server: . Please check repo url.
==> vsphere-iso.linux-photon-server: Error: Failed to synchronize cache for repo 'VMware Photon Extras 3.0(x86_64)' from 'https://dl.bintray.com/vmware/photon_extras_3.0_x86_64'
==> vsphere-iso.linux-photon-server: Error(1011) : No matching packages
Steps to Reproduce
Run the default VMware Photon OS 3
build
VMware vSphere Version
vSphere 7.0 Update 1 Build 16858589
HashiCorp Packer Version
1.6.5
Simplified Packer Build or Variables File(s)
N/A
Guest Operating System and Environment Details
Photon OS 3.0 Rev 2 - photon-3.0-a0f216d.iso
https://packages.vmware.com/photon/3.0/Rev2/iso/Update2/photon-3.0-a0f216d.iso
Guest Operating System
N/A
Log Fragments and crash.log Files
N/A
Additional Context
N/A
Description
After creating a virtual machine from the Ubuntu 20.04 template. The network adapter in the cloned virtual machine is in the disconnected status. (There is no network assigned to this virtual machine.)
Steps to Reproduce
Create a template with Ubuntu 20.04.
Create VM from Template.
VMware vSphere Version
7.0.2
HashiCorp Packer Version
Packer version: 1.7.3 [go1.16.5 darwin amd64]
Guest Operating System and Environment Details
MacOS 11.4
Guest Operating System
Ubuntu Server 20.04.2 LTS
Any
1.7.5
1.0.1
macOS Big Sur 11.6 (Intel)
No response
During image building, cloud-init (from user-data) and provisionner (from build target) are launching apt update/upgrade
at the same time.
Package update/upgrade should be done once.
Package update/upgrade are launched in parallel:
user-data:
disable_root: false
package_update: true
package_upgrade: true
package_reboot_if_required: true
### Update the guest operating system. ###
echo '> Updating the guest operating system ...'
sudo apt-get update
sudo apt-get upgrade -y
Build Ubuntu 20.04 image
==> vsphere-iso.linux-ubuntu-server: Provisioning with shell script: ../../../scripts/linux/ubuntu-server-2x.sh
==> vsphere-iso.linux-ubuntu-server: + export BUILD_USERNAME
==> vsphere-iso.linux-ubuntu-server: + export BUILD_KEY
vsphere-iso.linux-ubuntu-server: > Updating the guest operating system ...
==> vsphere-iso.linux-ubuntu-server: + export ANSIBLE_USERNAME
==> vsphere-iso.linux-ubuntu-server: + export ANSIBLE_KEY
==> vsphere-iso.linux-ubuntu-server: + echo > Updating the guest operating system ...
==> vsphere-iso.linux-ubuntu-server: + sudo apt-get update
vsphere-iso.linux-ubuntu-server: Hit:1 http://lu.archive.ubuntu.com/ubuntu focal InRelease
vsphere-iso.linux-ubuntu-server: Hit:2 http://lu.archive.ubuntu.com/ubuntu focal-updates InRelease
vsphere-iso.linux-ubuntu-server: Hit:3 http://lu.archive.ubuntu.com/ubuntu focal-backports InRelease
vsphere-iso.linux-ubuntu-server: Hit:4 http://lu.archive.ubuntu.com/ubuntu focal-security InRelease
vsphere-iso.linux-ubuntu-server: Reading package lists...
==> vsphere-iso.linux-ubuntu-server: + sudo apt-get upgrade -y
==> vsphere-iso.linux-ubuntu-server: E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2078 (apt-get)
==> vsphere-iso.linux-ubuntu-server: E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
==> vsphere-iso.linux-ubuntu-server: Script exited with non-zero exit status: 100.Allowed exit codes are: [0]
No response
I suggest (and I can create PR for) to remove packages update/upgrade from cloud-init's user-data, because I didn't find any KISS solution to know when cloud-init ends.
So, the resulting user-data
would be as follow.
user-data:
disable_root: false
21.11 (Default)
7.0 Update 2
1.7.8
1.0.2
Ubuntu Server 18.04.6
No response
Building failes
Building is successful
Building failes
Build
No response
rh
Community Note
Description:
Please add an option in the examples to support static IP addresses during machine image builds.
Use Case(s):
DHCP is not always available within the datacenter environment.
Potential Configuration:
None offered.
Potential References:
None offered.
main
6.7
1.7.10
1.0.3
RHEL 7.9
when i run the build getting - error creating vm: A component of the virtual machine is not accessible on the host.
Build 'vsphere-iso.linux-rhel' errored after 87 milliseconds 506 microseconds: error creating vm: A component of the virtual machine is not accessible on the host.
Build 'vsphere-iso.linux-rhel' errored after 87 milliseconds 506 microseconds: error creating vm: A component of the virtual machine is not accessible on the host.
Build 'vsphere-iso.linux-rhel' errored after 87 milliseconds 506 microseconds: error creating vm: A component of the virtual machine is not accessible on the host.
just run the build
No response
No response
No response
The current settings for ssh in [user data] file for ubuntu is below
ssh: install-server: true authorized-keys: - ecdsa-sha2-nistp521 ............. allow-pw: true
according to doc here
allow-pw
should set to false
if authorized-key
is in use.
Please verify
Add default support for efi-secure for the following guest operating systems, once the fix for vSphere 7.x Content Library OVA Templates is released:
Discussed in #39
Discussed in #39
ssh_proxy_host (string) - A SOCKS proxy host to use for SSH connection
ssh_proxy_port (int) - A port of the SOCKS proxy. Defaults to 1080.
ssh_proxy_username (string) - The optional username to authenticate with the proxy server.
ssh_proxy_password (string) - The optional password to use to authenticate with the proxy server.
https://www.packer.io/docs/builders/vsphere/vsphere-iso#ssh_proxy_host
7.0 Update 2
1.7.6
1.0.1
macOS Big Sur (Intel)
No response
When building multiple images from the same configuration (i.e. windows-server-*
) at the same time, the DHCP server receives the same hostname for each created VM.
Packer could create the VMs with different names.
Packer creates the VMs with the same name.
build.sh
scriptWindows Server * - All
optionNo response
No response
No response
7.0 Update 2
1.7.4
1.0.1
CentOS 8.4
No response
Hello, and thank you for this wonderful work.
Nothing serious, but when git cloning this repo, the manifest directory is missing at the root level (probably because git does not allow empty dirs).
Maybe you could add a ".placehoder" file in the manifest dir and commit it?
A packer run should be able to write its manifest in the end.
Missing manifest dir leads to everything working fine (the template is generated), but as the manifest can not be written, the whole operation appears as a failure, and the template is cleaned (too bad).
Just clone the repo, adjust according to the README, launch it, and witness the sad end.
[...]
Build 'vsphere-iso.linux-ubuntu-server' errored after 5 minutes 40 seconds: 1 error(s) occurred:
No response
No response
Hello,
here i'm proposing the addition of a templated for Debian/Linux.
I'm already in an advanced state of creation of the configuration for the latest LTS: Debian 11
I would kindly ask your support for advancing in the configuration as i'm encountering a strange issue with the keyboard input at installation startup.
I've produced myself a complete and working boot_command that i am already using with packer+vsphere with the official packer examples, but when i plug what i developed on your work and spin up the server, after ISO boot, the boot_command seems to not be input correctly (maybe due to some keyboard misconfiguration)
Do you have any advice that could help me debugging it futherly?
Ubuntu 20.04.4 has been released, so update ISO file on Ubuntu 20.04 build.
Use Ubuntu 20.04.4 ISO file
Update iso_file
and iso_checksum
in `builds/linux/ubuntu/20-04-lts/linux-ubuntu.auto.pkrvars.hcl.
No response
When filing a bug, please include the following information.
Description
Stopped at "Waiting for SSH to become available.... then times out with error
"Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain""
Steps to Reproduce
VMware vSphere Version
vSphere 7.0.2
HashiCorp Packer Version
Packer 1.7.3
Simplified Packer Build or Variables File(s)
I only changed the credential in pakvar.hcl to connect to my vCenter, which works fine.
I replaced "authorized-keys" value in [user data] file and replaced the key in [keys] folder
Nothing else changed, I kept build_username & build_password unchanged.
Guest Operating System and Environment Details
Ubuntu 20.04
Environment was untouched from var file
Log Fragments and crash.log Files
2021/07/14 23:41:40 packer.exe plugin: [INFO] Attempting SSH connection to 10.10.110.235:22...
2021/07/14 23:41:40 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/14 23:41:40 packer.exe plugin: [DEBUG] handshaking with SSH
2021/07/14 23:41:44 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
2021/07/14 23:41:44 packer.exe plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2021/07/14 23:41:51 packer.exe plugin: [INFO] Attempting SSH connection to 10.10.110.235:22...
2021/07/14 23:41:51 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/14 23:41:51 packer.exe plugin: [DEBUG] handshaking with SSH
2021/07/14 23:41:53 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
2021/07/14 23:41:53 packer.exe plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2021/07/14 23:42:00 packer.exe plugin: [INFO] Attempting SSH connection to 10.10.110.235:22...
2021/07/14 23:42:00 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/14 23:42:00 packer.exe plugin: [DEBUG] handshaking with SSH
2021/07/14 23:42:03 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
2021/07/14 23:42:03 packer.exe plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2021/07/14 23:42:10 packer.exe plugin: [INFO] Attempting SSH connection to 10.10.110.235:22...
2021/07/14 23:42:10 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/14 23:42:10 packer.exe plugin: [DEBUG] handshaking with SSH
2021/07/14 23:42:14 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
2021/07/14 23:42:14 packer.exe plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2021/07/14 23:42:14 ui error: ==> vsphere-iso.linux--server: Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
2021/07/14 23:42:14 ui: ask: ==> vsphere-iso.linux--server: Pausing before cleanup of step 'StepWaitForIp'. Press enter to continue.
2021/07/14 23:42:14 ui: ask: ==> vsphere-iso.linux--server: Pausing before cleanup of step 'StepBootCommand'. Press enter to continue.
2021/07/14 23:42:20 ui: ask: ==> vsphere-iso.linux--server: Pausing before cleanup of step 'StepRun'. Press enter to continue.
2021/07/14 23:42:21 ui: ==> vsphere-iso.linux--server: Power off VM...
Additional Context
while waiting for SSH to become available, i can ping the vm, i was trying to ssh into the vm directly by using
build_username = "rainpole"
build_password = "R@in!$aG00dThing."
Access was denied, "You dont have permission to connect"
7.0 Update 2
1.7.6
1.0.1
macOS Big Sur (intel)
No response
The letter e is present in the autounattend.pkrtpl.hcl
template.
<SystemLocale>e${vm_guest_os_language}</SystemLocale>
N/A
N/A
N/A
No response
No response
No response
Originally posted by na2626 October 11, 2021
Hello,
I'm trying to build some windows server templates but the process fails with error:
`CONFIRM: Build Microsoft Windows Server 2022 Datacenter Templates for VMware vSphere.
Continue? (y/n)
y
Building Microsoft Windows Server 2022 Datacenter Templates for VMware vSphere ...
Initializing Hashicorp Packer and required plugins ...
Starting the HashiCorp Packer build ...
Error: Failed preparing post-processor-block "manifest" ""
on /home/my-user/packer/projects/-vsphere-templates/builds/windows/windows-server-2022/windows-server.pkr.hcl line 428:
(source code not available)
/home/my-user/packer/projects/-vsphere-templates/builds/windows/windows-server-2022/windows-server.pkr.hcl:433,37-54:
Unsupported attribute; This object does not have an attribute named
"ansible_username".
Error: Failed preparing post-processor-block "manifest" ""
on /home/my-user/packer/projects/-vsphere-templates/builds/windows/windows-server-2022/windows-server.pkr.hcl line 428:
(source code not available)
/home/my-user/packer/projects/-vsphere-templates/builds/windows/windows-server-2022/windows-server.pkr.hcl:433,37-54:
Unsupported attribute; This object does not have an attribute named
"ansible_username".
==> Wait completed after 2 microseconds
==> Builds finished but no artifacts were created.
`
Any ideas to try to solve the issue?
Thank you very much for your great work!
Kind regards
7.0.2
1.7.4
1.0.1
Ubuntu 20.04
Building ubunto 20.04 image
vSphere 7.0.2
Packer 1.7.4
Terraform 1.0.7
Remote PC: Win10
Everything is in the same subnet: 172.16.2.x including: DNS, DHCP, vCetner, ESXI & Win10PC
The previous release worked fine till today. I built images 20 days ago, but failed today, nothing changed....It failed at below
"sudo apt-get upgrade y"
"APT-GET upgrade could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1935 (apt-get)"
So I downloaded the new release to try it out. the issue is DHCP IP address changes after server reboot.
==> vsphere-iso.linux-ubuntu-server: HTTP server is working at http://172.16.2.200:8078/ ==> vsphere-iso.linux-ubuntu-server: Typing boot command... ==> vsphere-iso.linux-ubuntu-server: Waiting for IP... ==> vsphere-iso.linux-ubuntu-server: IP address: 172.16.2.249 ==> vsphere-iso.linux-ubuntu-server: Using SSH communicator to connect: 172.16.2.249 ==> vsphere-iso.linux-ubuntu-server: Waiting for SSH to become available...
First I got an IP 172.16.2.249, then waiting for SSH to connect, there was no response after a long time waiting, so I logged in and checked the IP, turned out the server got a different IP address. 172.16.2.250
I tired 3 times, all the same issue.
Expected behavior:
Stay with the same IP
Server got a different IP after reboot
I only changed the vcenter variables in the code, everything else remained the same.
==> vsphere-iso.linux-ubuntu-server: Creating VM...
==> vsphere-iso.linux-ubuntu-server: Customizing hardware...
==> vsphere-iso.linux-ubuntu-server: Adding SATA controller...
==> vsphere-iso.linux-ubuntu-server: Mounting ISO images...
==> vsphere-iso.linux-ubuntu-server: Adding configuration parameters...
==> vsphere-iso.linux-ubuntu-server: Starting HTTP server on port 8078
==> vsphere-iso.linux-ubuntu-server: Set boot order...
==> vsphere-iso.linux-ubuntu-server: Power on VM...
==> vsphere-iso.linux-ubuntu-server: Waiting 5s for boot...
==> vsphere-iso.linux-ubuntu-server: HTTP server is working at http://172.16.2.200:8078/
==> vsphere-iso.linux-ubuntu-server: Typing boot command...
==> vsphere-iso.linux-ubuntu-server: Waiting for IP...
==> vsphere-iso.linux-ubuntu-server: IP address: 172.16.2.249
==> vsphere-iso.linux-ubuntu-server: Using SSH communicator to connect: 172.16.2.249
==> vsphere-iso.linux-ubuntu-server: Waiting for SSH to become available...
==> vsphere-iso.linux-ubuntu-server: Timeout waiting for SSH.
==> vsphere-iso.linux-ubuntu-server: Power off VM...
==> vsphere-iso.linux-ubuntu-server: Destroying VM...
Build 'vsphere-iso.linux-ubuntu-server' errored after 31 minutes 12 seconds: Timeout waiting for SSH.
==> Wait completed after 31 minutes 12 seconds
==> Some builds didn't complete successfully and had errors:
--> vsphere-iso.linux-ubuntu-server: Timeout waiting for SSH.
==> Builds finished but no artifacts were created.
Done.
No response
No response
22.03 (Default)
7.0 Update 2
1.8.0
1.0.3
Almalinux 8
Cloned repo to a fresh Ubuntu 20.04 LTS deployment, ran through the pre-reqs
Alma ISO variables
// Removable Media Settings
iso_path = "_isos/linux"
iso_file = "AlmaLinux-8.5-x86_64-dvd.iso"
iso_checksum_type = "md5"
iso_checksum_value = "f83ac836e4f4279ef903f1028263640c"
I've been running through each of the OS Template deployments, and so far everything has been going fine. However, I've gotten to Almalinux and while Rocky deployed without any issues, Almalinux is failing to find the ansible python interpreter at the hardcoded path of /usr/bin/python3
I believe it needs to point to /usr/libexec/platform-python
instead
Deployment finishes successfully
Deployment fails when gathering facts for Ansible configuration
vsphere-iso.linux-almalinux: TASK [Gathering Facts] *********************************************************
vsphere-iso.linux-almalinux: fatal: [default]: FAILED! => {"<sensitive>_facts": {}, "changed": false, "failed_modules": {"setup": {"failed": true, "module_stderr": "/bin/sh: /usr/bin/python3: No such file or directory\nShared connection to 127.0.0.1 closed.\r\n", "module_stdout": "", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127}}, "msg": "The following modules failed to execute: setup\n"}
Building an AlmaLinux OS 8 Template for VMware vSphere...
Initializing HashiCorp Packer and required plugins...
Starting the build....
vsphere-iso.linux-almalinux: output will be in this color.
==> vsphere-iso.linux-almalinux: Creating VM...
==> vsphere-iso.linux-almalinux: Customizing hardware...
==> vsphere-iso.linux-almalinux: Adding SATA controller...
==> vsphere-iso.linux-almalinux: Mounting ISO images...
==> vsphere-iso.linux-almalinux: Adding configuration parameters...
==> vsphere-iso.linux-almalinux: Starting HTTP server on port 8050
==> vsphere-iso.linux-almalinux: Set boot order...
==> vsphere-iso.linux-almalinux: Power on VM...
==> vsphere-iso.linux-almalinux: Waiting 2s for boot...
==> vsphere-iso.linux-almalinux: HTTP server is working at http://172.16.38.102:8050/
==> vsphere-iso.linux-almalinux: Typing boot command...
==> vsphere-iso.linux-almalinux: Waiting for IP...
==> vsphere-iso.linux-almalinux: IP address: 172.16.38.164
==> vsphere-iso.linux-almalinux: Using SSH communicator to connect: 172.16.38.164
==> vsphere-iso.linux-almalinux: Waiting for SSH to become available...
==> vsphere-iso.linux-almalinux: Connected to SSH!
==> vsphere-iso.linux-almalinux: Provisioning with Ansible...
vsphere-iso.linux-almalinux: Setting up proxy adapter for Ansible....
==> vsphere-iso.linux-almalinux: Executing Ansible: <sensitive>-playbook -e packer_build_name="linux-almalinux" -e packer_builder_type=vsphere-iso -e packer_http_addr=172.16.38.102:8050 --ssh-extra-args '-o IdentitiesOnly=yes' --extra-vars display_skipped_hosts=false --extra-vars BUILD_USERNAME=<sensitive> --extra-vars BUILD_SECRET=***** --extra-vars ANSIBLE_USERNAME=<sensitive> --extra-vars ANSIBLE_SECRET=***** -e <sensitive>_ssh_private_key_file=/tmp/<sensitive>-key2890125948 -i /tmp/packer-provisioner-<sensitive>1495634203 /home/localadmin/packer-examples-for-vsphere/<sensitive>/main.yml
vsphere-iso.linux-almalinux:
vsphere-iso.linux-almalinux: PLAY [all] *********************************************************************
vsphere-iso.linux-almalinux:
vsphere-iso.linux-almalinux: TASK [Gathering Facts] *********************************************************
vsphere-iso.linux-almalinux: fatal: [default]: FAILED! => {"<sensitive>_facts": {}, "changed": false, "failed_modules": {"setup": {"failed": true, "module_stderr": "/bin/sh: /usr/bin/python3: No such file or directory\nShared connection to 127.0.0.1 closed.\r\n", "module_stdout": "", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127}}, "msg": "The following modules failed to execute: setup\n"}
vsphere-iso.linux-almalinux:
vsphere-iso.linux-almalinux: PLAY RECAP *********************************************************************
vsphere-iso.linux-almalinux: default : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
vsphere-iso.linux-almalinux:
==> vsphere-iso.linux-almalinux: Provisioning step had errors: Running the cleanup provisioner, if present...
==> vsphere-iso.linux-almalinux: Power off VM...
==> vsphere-iso.linux-almalinux: Destroying VM...
Build 'vsphere-iso.linux-almalinux' errored after 10 minutes 24 seconds: Error executing Ansible: Non-zero exit status: exit status 2
==> Wait completed after 10 minutes 24 seconds
==> Some builds didn't complete successfully and had errors:
--> vsphere-iso.linux-almalinux: Error executing Ansible: Non-zero exit status: exit status 2
==> Builds finished but no artifacts were created.
No response
No response
main
vSphere Client version 6.7.0.50000
1.8.0
1.0.3
RHEL and Variants
No response
Packer "types" in the two letters, "u" and "p" rather than interpret the intent as the up-arrow. Changing to "" solve the problem.
When the ISO is booting and the grub/install menu is presented, the up-arrow is expected so that the kernel line can be modified.
The two letters, "u" and "p" are sent literally.
A standard packer build against centos and RHEL 8 is what I tested.
No response
No response
No response
Update the initial Ubuntu 22.04 LTS example to support the planned GA release on 27 April 2022.
Also test support as the Packer host.
Support the GA release.
Use and test existing from preview release of Ubuntu 22.04.
No response
Hi,
i tried to create the templates with a static ip, without success.
Can you help me to create templates (almalinux, windows 2016 and windows 2019) at creation with a static ip?
See below message, my build stopped at "ssh", it wont go any further.
==> vsphere-iso.linux-<sensitive>-server: IP address: 10.30.7.109
==> vsphere-iso.linux-<sensitive>-server: Using SSH communicator to connect: 10.30.7.109
==> vsphere-iso.linux-<sensitive>-server: Waiting for SSH to become available...
By any chance if there is way to see more information for debugging?
main
7.0 Update 2
v1.8.0
v1.0.3
Any Supported
The current packer templates seem to not use the build_password
variable so that the only password read by packer is the one that the user provides in the install script
I've noticed this situation while working on creating a Debian template starting from the existing template for Ubuntu 18.04.
In order to fix this issue and use the build_password
variable provided within the set-envvars.sh
script the following instruction should be added to the templates:
build_password = var.build_password
Run a build setting a password buid_password
in the config file as "password"
Run the set-envvars.sh
script and set the password to "different_password"
Run the build.
Result: the password used by packer will be "password" and not "different_password" as expected.
No response
No response
main
7.0.3
1.7.8
v1.0.2
Ubuntu 20.04
ubuntu 20.04
Symbol error in file scripts/linux/ubuntu-server-2x.sh
STDOUT have no error
==> vsphere-iso.linux-ubuntu-server: + cloud-init ...
==> vsphere-iso.linux-ubuntu-server: usage: /usr/bin/cloud-init [-h] [--version] [--file FILES] [--debug] [--force]
==> vsphere-iso.linux-ubuntu-server: {init,modules,single,query,dhclient-hook,features,analyze,devel,collect-logs,clean,status}
==> vsphere-iso.linux-ubuntu-server: ...
==> vsphere-iso.linux-ubuntu-server: /usr/bin/cloud-init: error: argument subcommand: invalid choice: '...' (choose from 'init', 'modules', 'single', 'query', 'dhclient-hook', 'features', 'analyze', 'devel', 'collect-logs', 'clean', 'status')
==> vsphere-iso.linux-ubuntu-server: + GRUB ...
==> vsphere-iso.linux-ubuntu-server: /tmp/script_1190.sh: 1: GRUB: not found
./build.sh
=> vsphere-iso.linux-ubuntu-server: + sudo sed -i s/.*PubkeyAuthentication.*/PubkeyAuthentication yes/ /etc/ssh/sshd_config
==> vsphere-iso.linux-ubuntu-server: + echo > Restarting the SSH daemon. ...
vsphere-iso.linux-ubuntu-server: > Restarting the SSH daemon. ...
==> vsphere-iso.linux-ubuntu-server: + sudo systemctl restart sshd
==> vsphere-iso.linux-ubuntu-server: + echo > Disabling and clean tmp ...
==> vsphere-iso.linux-ubuntu-server: + sudo sed -i s/D/#&/ /usr/lib/tmpfiles.d/tmp.conf
vsphere-iso.linux-ubuntu-server: > Disabling and clean tmp ...
==> vsphere-iso.linux-ubuntu-server: + echo > Creating the clean script ...
vsphere-iso.linux-ubuntu-server: > Creating the clean script ...
==> vsphere-iso.linux-ubuntu-server: + cloud-init ...
==> vsphere-iso.linux-ubuntu-server: usage: /usr/bin/cloud-init [-h] [--version] [--file FILES] [--debug] [--force]
==> vsphere-iso.linux-ubuntu-server: {init,modules,single,query,dhclient-hook,features,analyze,devel,collect-logs,clean,status}
==> vsphere-iso.linux-ubuntu-server: ...
==> vsphere-iso.linux-ubuntu-server: /usr/bin/cloud-init: error: argument subcommand: invalid choice: '...' (choose from 'init', 'modules', 'single', 'query', 'dhclient-hook', 'features', 'analyze', 'devel', 'collect-logs', 'clean', 'status')
==> vsphere-iso.linux-ubuntu-server: + GRUB ...
==> vsphere-iso.linux-ubuntu-server: /tmp/script_1190.sh: 1: GRUB: not found
==> vsphere-iso.linux-ubuntu-server: + sudo cat
==> vsphere-iso.linux-ubuntu-server: + echo > Changing the permissions on /home/$BUILD_USERNAME/clean.sh ...
==> vsphere-iso.linux-ubuntu-server: + sudo chmod +x /home/<sensitive>/clean.sh
vsphere-iso.linux-ubuntu-server: > Changing the permissions on /home/$BUILD_USERNAME/clean.sh ...
==> vsphere-iso.linux-ubuntu-server: + echo > Running the clean script ...
vsphere-iso.linux-ubuntu-server: > Running the clean script ...
==> vsphere-iso.linux-ubuntu-server: + sudo /home/<sensitive>/clean.sh
No response
### Prepare cloud-init ###
echo `> Preparing cloud-init ...`
### Modify GRUB ###
echo `> Modifying GRUB ...`
Hello
Could you add Rocky Linux support please?
Hi,
I tried to install Almalinux and Ubuntu with the KS config with efi, but i dont get it to work.
Any suggestions?
The Windows Update Provisioner referenced https://github.com/rgl/packer-provisioner-windows-update here doesn't work with Packer 1.7.0
A pull request has been submitted to fix this rgl/packer-plugin-windows-update#84
I have just made the provisioner from Swampdragons Repo and replaced on my side and the builds are working again.
Not sure if you want to update the docs to point to this repo ? or wait until the PR is merged
Implement Windows 10 Pro image
wsl
is only available on Windows 10.
In order to test wsl
automation scripts, I need Windows 10 image for the CI.
N/A
No response
Any
1.7.5
1.0.1
macOS Big Sur 11.6 (Intel)
My current Terraform workflow is using VM template stored in VM folder tree.
So, I need to convert to VM without storing it to content library.
In Packer documentation (see https://www.packer.io/docs/builders/vsphere/vsphere-iso#convert_to_template)
The import doesn't work if
convert_to_template
is set totrue
When convert_to_template
is set to true
, content_library_destination
block should be removed.
Packer returns an error when trying to push VM template to content library.
Set convert_to_template
is set to true
=> vsphere-iso.linux-ubuntu-server: Importing VM template linux-ubuntu-server-20-04-lts1632170716 to Content Library...
==> vsphere-iso.linux-ubuntu-server: Failed to import template linux-ubuntu-server-20-04-lts1632170716: 400 Bad Request: {"type":"com.vmware.vapi.std.errors.invalid_argument","value":{"error_type":"INVALID_ARGUMENT","messages":[{"args":["vm-15548"],"default_message":"The provided source virtual machine ID vm-15548 is from a virtual machine template, which is not supported.","id":"com.vmware.vdcs.vmtx-main.invalid_source_vm_template_not_supported"}]}}
==> vsphere-iso.linux-ubuntu-server: 400 Bad Request: {"type":"com.vmware.vapi.std.errors.invalid_argument","value":{"error_type":"INVALID_ARGUMENT","messages":[{"args":["vm-15548"],"default_message":"The provided source virtual machine ID vm-15548 is from a virtual machine template, which is not supported.","id":"com.vmware.vdcs.vmtx-main.invalid_source_vm_template_not_supported"}]}}
==> vsphere-iso.linux-ubuntu-server: Step "StepImportToContentLibrary" failed
==> vsphere-iso.linux-ubuntu-server: [c] Clean up and exit, [a] abort without cleanup, or [r] retry step (build may fail even if retry succeeds)?
Cancelling build after receiving interrupt
==> vsphere-iso.linux-ubuntu-server: Provisioning step had errors: Running the cleanup provisioner, if present...
==> vsphere-iso.linux-ubuntu-server: Power off VM...
==> vsphere-iso.linux-ubuntu-server: Destroying VM...
==> vsphere-iso.linux-ubuntu-server: Deleting cd_files image from remote datastore ...
Build 'vsphere-iso.linux-ubuntu-server' errored after 10 minutes 35 seconds: 400 Bad Request: {"type":"com.vmware.vapi.std.errors.invalid_argument","value":{"error_type":"INVALID_ARGUMENT","messages":[{"args":["vm-15548"],"default_message":"The provided source virtual machine ID vm-15548 is from a virtual machine template, which is not supported.","id":"com.vmware.vdcs.vmtx-main.invalid_source_vm_template_not_supported"}]}}
No response
I suggest (and I can create PR for) to update code as follow
common_content_library_name
default to null
content_library_destination
dynamic "content_library_destination" {
for_each = var.common_content_library_name != null ? [1] : []
content {
library = var.common_content_library_name
ovf = var.common_content_library_ovf
destroy = var.common_content_library_destroy
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.