Score:0

Packer Autoinstall with Ubuntu 21.04/21.10 Desktop

ธง tr

I was trying to automate a Packer build of Ubuntu Desktop 21.04 in vSphere with the HCL below. Since then I have found out that this won't work with the desktop images until 21.10 "Impish" at minimum, as discussed here:

https://discourse.ubuntu.com/t/refreshing-the-ubuntu-desktop-installer/20659/76?u=nathanto

The original question is below to help others.

The key piece is where the boot command defines the seedfrom. That seems not to work in the sense that the user-data is never loaded. The VM boots, and the net.ifnames=0 argument from the boot command is applied (interfaces are named eth0).

The logic of the boot command is to press c to get to the grub> prompt, and then the commands are entered as shown in the boot_command below.

I see in the /proc/cmdline that the boot command is applied properly.

I can see no indication that the user-data is loaded though. If I look at the web server shown in the boot command, using Firefox from the booted VM, the user-data and meta-data files are there and accessible.

Does anyone have any ideas of how to debug this please?

source "vsphere-iso" "dev_vm" {
  username            = var.vcenter_username
  password            = var.vcenter_password
  vcenter_server      = var.vcenter_server
  cluster             = var.vcenter_cluster
  datacenter          = var.vcenter_datacenter
  datastore           = var.vcenter_vm_datastore
  guest_os_type       = "ubuntu64Guest"
  insecure_connection = "true"
  iso_checksum        = "sha256:fa95fb748b34d470a7cfa5e3c1c8fa1163e2dc340cd5a60f7ece9dc963ecdf88"
  iso_urls            = ["https://releases.ubuntu.com/21.04/ubuntu-21.04-desktop-amd64.iso"]
  http_directory      = "./http"

  vm_name             = "dev_vm"
  CPUs                = 2
  RAM                 = 2048
  RAM_reserve_all     = true
  boot_wait           = "3s"
  convert_to_template = false
  boot_command        = [
    "c",
    "linux /casper/vmlinuz --- autoinstall ds='nocloud-net;seedfrom=http://{{.HTTPIP}}:{{.HTTPPort}}/' net.ifnames=0 ",
    "<enter><wait>",
    "initrd /casper/initrd<enter><wait>",
    "boot<enter>"
  ]
  network_adapters {
    network      = "xxx"
    network_card = "e1000"
  }
  storage {
    disk_size             = 40960
    disk_thin_provisioned = true
  }

  ssh_username = "xx"
  ssh_password = "xx"
  ssh_timeout  = "60m"
}

build {
  sources = [
    "source.vsphere-iso.dev_vm"
  ]
...
}

Andrew Lowther avatar
jp flag
คุณกำลังใช้ Desktop iso แต่กำลังใช้เทคนิคการทำงานอัตโนมัติสำหรับ _subiquity_ ซึ่งเป็นโปรแกรมติดตั้งเซิร์ฟเวอร์ ฉันไม่คิดว่า Desktop iso ใช้ _subiquity_ การสนทนานี้แนะนำว่าอาจมีตัวติดตั้งเดสก์ท็อปที่ใช้ _subiquity_ กับรุ่น 21.10 https://discourse.ubuntu.com/t/refreshing-the-ubuntu-desktop-installer/20659
Nathan Sowatskey avatar
tr flag
ขอบคุณ ฉันกำลังค้นหาเดสก์ท็อปรุ่น 21.10 และจะรายงานกลับ
Nathan Sowatskey avatar
tr flag
สิ่งนี้ *เริ่ม* เพื่อทำงานใน 21.10 ตามที่กล่าวไว้ที่นี่: https://discourse.ubuntu.com/t/refreshing-the-ubuntu-desktop-installer/20659/76?u=nathanto

โพสต์คำตอบ

คนส่วนใหญ่ไม่เข้าใจว่าการถามคำถามมากมายจะปลดล็อกการเรียนรู้และปรับปรุงความสัมพันธ์ระหว่างบุคคล ตัวอย่างเช่น ในการศึกษาของ Alison แม้ว่าผู้คนจะจำได้อย่างแม่นยำว่ามีคำถามกี่ข้อที่ถูกถามในการสนทนา แต่พวกเขาไม่เข้าใจความเชื่อมโยงระหว่างคำถามและความชอบ จากการศึกษาทั้ง 4 เรื่องที่ผู้เข้าร่วมมีส่วนร่วมในการสนทนาด้วยตนเองหรืออ่านบันทึกการสนทนาของผู้อื่น ผู้คนมักไม่ตระหนักว่าการถามคำถามจะมีอิทธิพลหรือมีอิทธิพลต่อระดับมิตรภาพระหว่างผู้สนทนา