Puncte:0

Packer Autoinstall with Ubuntu 21.04/21.10 Desktop

drapel 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
drapel jp
Utilizați iso-ul desktop, dar utilizați o tehnică de automatizare pentru _subiquity_, programul de instalare a serverului. Nu cred că desktop-ul iso folosește încă _subiquity_. Această discuție sugerează că ar putea exista un program de instalare pentru desktop care să folosească _subiquity_ cu versiunea 21.10 https://discourse.ubuntu.com/t/refreshing-the-ubuntu-desktop-installer/20659
Nathan Sowatskey avatar
drapel tr
Vă mulțumesc, mă uit la versiunile desktop 21.10 și voi raporta.
Nathan Sowatskey avatar
drapel tr
Acest lucru *începe* să funcționeze în 21.10, așa cum sa discutat aici: https://discourse.ubuntu.com/t/refreshing-the-ubuntu-desktop-installer/20659/76?u=nathanto

Postează un răspuns

Majoritatea oamenilor nu înțeleg că a pune multe întrebări deblochează învățarea și îmbunătățește legătura interpersonală. În studiile lui Alison, de exemplu, deși oamenii își puteau aminti cu exactitate câte întrebări au fost puse în conversațiile lor, ei nu au intuit legătura dintre întrebări și apreciere. În patru studii, în care participanții au fost implicați în conversații ei înșiși sau au citit transcrieri ale conversațiilor altora, oamenii au avut tendința să nu realizeze că întrebarea ar influența – sau ar fi influențat – nivelul de prietenie dintre conversatori.