TLDR:我已经完成了大部分AutoInstall (我认为?)但是,在通过AutoInstall之后,它会一直打开GUI安装。寻找任何输入,以了解为什么它会不断地打开GUI。/TLDR
Longer版本:我正在尝试通过使用Hashicorp将ubuntu (以及最终的其他发行版)部署到Proxmox。我已经安排好了大部分的工作.说大也大吧?它成功地“部署”了,但是它无法完成最初的设置,它一直在通过AutoInstall,但是仍然会打开GUI安装。从手动遍历GUI开始,在完成AutoInstall部分之后,似乎所有内容都已填写完毕(减去用户标识部分,即FullName/Username/etc)。它似乎甚至不需要找到一个IP地址,就像您刚通过GUI时一样,所以我认为DHCP运行得很好吗?
我试过考虑其他一些类似的问题,但他们的解决方案对我来说还不管用。
我有一些理论,但似乎没有一个理论是正确的,或者我不知道如何检验它们。
user-data (yaml)中的一些东西,因为它试图打开GUI。.pkr.hcl文件中缺少了一些配置参数,这是proxmox正确设置vm所必需的吗?preseed.cfg替换为user-data (yaml)文件,所以我对这一理论表示怀疑。user-data文件没有正确加载到Ubuntu中吗?-debug之外,我已经尝试过了)。我试过/var/log/installer,但我不认为我对发生了什么事情有很强的把握。但是,除了SSH键错误之外,我没有看到任何故障,也看不到任何user-data下载或下载失败的迹象。seed from http://192.168.0.144:80/user-data not supported by DataSourceNoCloud [seed=None][dsmode=net] /var/log/cloud-init.log中发现了为什么会出现这种情况,任何建议都将不胜感激:)/var/lib/cloud/seed/nocloud/user-data,同样,我希望得到任何建议:)如果您很酷,可以尝试复制这些东西,或者在它(希望)被回答后偶然发现了这个问题,那么使用example.auto.pkrvars.hcl文件可以让您的生活更轻松。
Proxmox:Proxmox VE 7.1-4 Windows:Windows 10 Pro : 10.0.19043.0 封隔器:1.7.10
Example.pkr.hclpacker {
required_plugins {
proxmox = {
version = " >= 1.0.1"
source = "github.com/hashicorp/proxmox"
}
}
}
source "proxmox-iso" "proxmox-ubuntu-20" {
proxmox_url = "https://proxmox.lan:8006/api2/json"
vm_name = "packer-ubuntu-20"
iso_url = "http://iso.repo.lan/ubuntu-20.04.3-live-server-amd64.iso"
iso_checksum = "f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98"
username = "${var.pm_user}"
password = "${var.pm_pass}"
token = "${var.pm_token}"
node = "proxmox"
iso_storage_pool = "local"
ssh_username = "${var.ssh_user}"
ssh_password = "${var.ssh_pass}"
ssh_timeout = "20m"
ssh_pty = true
ssh_handshake_attempts = 20
boot_wait = "5s"
http_directory = "http" # Starts a local http server, serves Preseed file
boot_command = [
"",
"",
"ip=${cidrhost("192.168.0.0/24", 9)}::${cidrhost("192.168.0.0/24", 1)}:${cidrnetmask("192.168.0.0/24")}::::${cidrhost("192.168.0.0/24", 1)} ",
"autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/",
"--- "
]
insecure_skip_tls_verify = true
template_name = "packer-ubuntu-20"
template_description = "packer generated ubuntu-20.04.3-server-amd64"
unmount_iso = true
pool = "packer"
memory = 4096
cores = 1
sockets = 1
os = "l26"
qemu_agent = true
cloud_init = true
# scsi_controller = "virtio-scsi-pci"
disks {
type = "scsi"
disk_size = "30G"
storage_pool = "local-lvm"
storage_pool_type = "lvm"
format = "raw"
}
network_adapters {
bridge = "vmbr0"
model = "virtio"
firewall = true
# vlan_tag = 1
}
}
build {
sources = ["source.proxmox-iso.proxmox-ubuntu-20"]
provisioner "shell" {
inline = [
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
"ls /"
]
}
}vars.pkr.hclvariable "pm_user" {
type = string
description = "Proxmox User Name"
default = "packer@pam!"
}
variable "pm_pass" {
type = string
description = "Proxmox User Password"
default = "packer"
}
variable "pm_token" {
type = string
description = "Proxmox API Token"
}
variable "ssh_user" {
type = string
description = "SSH User"
default = "packer"
}
variable "ssh_pass" {
type = string
description = "SSH Password"
default = "packer"
}
variable "vm_name" {
type = string
description = "VM Name"
default = "packer_hostname"
}http/user-dataautoinstall:
version: 1
locale: en_US.UTF-8
keyboard:
layout: en
variant: us
identity:
hostname: packer-ubuntu-20
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0" #ubuntu
username: ubuntu
realname: ubuntu
refresh-installer:
update: false
ssh:
install-server: yes
allow-pw: yes
packages:
- qemu-guest-agent
storage:
layout:
name: direct
swap:
size: 0https://www.aerialls.eu/posts/ubuntu-server-2004-image-packer-subiquity-for-proxmox/ https://ubuntu.com/server/docs/install/autoinstall-reference https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html https://cloudinit.readthedocs.io/en/latest/topics/modules.html#write-files https://cloudalbania.com/posts/2022-01-homelab-with-proxmox-and-packer/
发布于 2022-02-05 16:59:39
幸运的是,我在一个完全错误的方向上搜索SMH。问题是,我没有仔细阅读Cloud 常见问题。我所要做的就是添加#cloud-config作为我的user-data文件中的第一行。
对任何感兴趣的人来说,下面的吐露都会奏效。
我把所有的文件都放在这里了。如果有兴趣的https://github.com/aRustyDev/packer,请随意阅读
Example.pkr.hclpacker {
required_plugins {
proxmox = {
version = " >= 1.0.1"
source = "github.com/hashicorp/proxmox"
}
}
}
source "proxmox-iso" "proxmox-ubuntu-20" {
proxmox_url = "https://proxmox.lan:8006/api2/json"
vm_name = "packer-ubuntu-20"
iso_url = "http://iso.repo.lan/ubuntu-20.04.3-live-server-amd64.iso"
iso_checksum = "f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98"
username = "${var.pm_user}"
password = "${var.pm_pass}"
token = "${var.pm_token}"
node = "proxmox"
iso_storage_pool = "local"
ssh_username = "${var.ssh_user}"
ssh_password = "${var.ssh_pass}"
ssh_timeout = "20m"
ssh_pty = true
ssh_handshake_attempts = 20
boot_wait = "5s"
http_directory = "http" # Starts a local http server, serves Preseed file
boot_command = [
"",
"",
"ip=${cidrhost("192.168.0.0/24", 9)}::${cidrhost("192.168.0.0/24", 1)}:${cidrnetmask("192.168.0.0/24")}::::${cidrhost("192.168.0.0/24", 1)} ",
" autoinstall ds=nocloud-net;s=http://httpd.proxmox.local:80/preseed/ubuntu-20/ ",
"--- "
]
insecure_skip_tls_verify = true
template_name = "packer-ubuntu-20"
template_description = "packer generated ubuntu-20.04.3-server-amd64"
unmount_iso = true
pool = "packer"
memory = 4096
cores = 1
sockets = 1
os = "l26"
qemu_agent = true
disks {
type = "scsi"
disk_size = "30G"
storage_pool = "local-lvm"
storage_pool_type = "lvm"
format = "raw"
}
network_adapters {
bridge = "vmbr0"
model = "virtio"
firewall = true
}
}
build {
sources = ["source.proxmox-iso.proxmox-ubuntu-20"]
provisioner "shell" {
inline = [
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
"ls /"
]
}
}vars.pkr.hclvariable "pm_user" {
type = string
description = "Proxmox User Name"
default = "packer@pam!"
}
variable "pm_pass" {
type = string
description = "Proxmox User Password"
default = "packer"
}
variable "pm_token" {
type = string
description = "Proxmox API Token"
}
variable "ssh_user" {
type = string
description = "SSH User"
default = "packer"
}
variable "ssh_pass" {
type = string
description = "SSH Password"
default = "packer"
}
variable "vm_name" {
type = string
description = "VM Name"
default = "packer_hostname"
}http/user-data#cloud-config
autoinstall:
version: 1
locale: en_US.UTF-8
keyboard:
layout: en
variant: us
identity:
hostname: packer-ubuntu-20
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0" #ubuntu
username: ubuntu
realname: ubuntu
refresh-installer:
update: false
ssh:
install-server: yes
allow-pw: yes
packages:
- qemu-guest-agent
storage:
layout:
name: direct
swap:
size: 0https://askubuntu.com/questions/1391042
复制相似问题