Proxmox/QEMU 忽略自定义云初始化配置

问题描述 投票:0回答:1

我正在尝试使用 Proxmox 7.0-8 启动一个非常基本的 cloud-init-provisioned VM。我编写了 YAML(并使用 cloud-init 工具对其进行了验证)只是为了创建一个关联了 SSH 密钥的用户。

我从一个模板(id 1000)开始并按如下方式创建我的虚拟机

root@pve:~# qm config 1000
agent: 1
boot: c
bootdisk: virtio0
cores: 2
hotplug: disk,network,usb
ide2: local-lvm:vm-1000-cloudinit,media=cdrom
memory: 4096
name: ubuntu-impish-cloudinit
net0: virtio=7A:00:B5:A4:94:F8,bridge=vmbr0
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=bd772092-d7eb-4ac1-b0b3-e22782c7fa5f
sockets: 1
template: 1
vcpus: 1
vga: qxl
virtio0: local-lvm:base-1000-disk-0,size=32G
vmgenid: 816cba87-f348-46a9-a85d-c0781d8b605c

root@pve:~# qm clone 1000 101 --name test
create full clone of drive ide2 (local-lvm:vm-1000-cloudinit)
  Logical volume "vm-101-cloudinit" created.
create linked clone of drive virtio0 (local-lvm:base-1000-disk-0)
  Logical volume "vm-101-disk-0" created.

# Ignore the name of the file - it's the eventual use case but for now only does
# very simple things
root@pve:~# qm set 101 --cicustom "user=snippets:snippets/cloud_init_k8s_worker.yml"
update VM 101: -cicustom user=snippets:snippets/cloud_init_k8s_worker.yml

# Confirm the snippet is found
root@pve:~# pvesm list snippets
Volid                                       Format  Type      Size VMID
snippets:snippets/cloud_init_k8s_worker.yml snippet snippets  803

root@pve:~# qm start 101
generating cloud-init ISO

root@pve:~# qm cloudinit dump 101 user
#cloud-config
hostname: test
manage_etc_hosts: true
chpasswd:
  expire: False
users:
  - default
package_upgrade: true

我在这里错过了什么?我在任何地方都找不到错误,但是转储的 cloudinit 与我之前传入的 YAML 不匹配(并且明显不同)。

qemu proxmox
1个回答
0
投票
sudo qm config 8011 # my setup
# boot: c
# bootdisk: scsi0
# cores: 1
# ide2: local:8011/vm-8011-cloudinit.qcow2,media=cdrom
# memory: 1024
# meta: creation-qemu=7.0.0,ctime=1674616579
# name: debian11
# net0: virtio=52:61:A8:2E:0A:31,bridge=vmbr0
# scsi0: local:8011/vm-8011-disk-0.raw,size=32G
# scsihw: virtio-scsi-pci
# serial0: socket
# smbios1: uuid=acdgdf1b-c382-46ed-afa1-3eed8701fc53
# vga: serial0
# vmgenid: 9f24af13-9122-4ddf-bc45-248b094da4fa

# vga: qxl (I not able to make spice run on cloud-init image)
qm set 1000 --serial0 socket --vga serial0
© www.soinside.com 2019 - 2024. All rights reserved.