Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User data not used when installing ubuntu from iso #209

Open
stgrace opened this issue Jan 2, 2025 · 4 comments
Open

User data not used when installing ubuntu from iso #209

stgrace opened this issue Jan 2, 2025 · 4 comments
Labels
blocker an external issue is blocking roadmap planned in the roadmap

Comments

@stgrace
Copy link

stgrace commented Jan 2, 2025

/kind bug

What steps did you take and what happened:

packer build .

With the following:

source "nutanix" "ubuntu" {
  nutanix_username = var.nutanix_username
  nutanix_password = var.nutanix_password
  nutanix_endpoint = var.nutanix_endpoint
  nutanix_port     = var.nutanix_port
  nutanix_insecure = var.nutanix_insecure
  cluster_name     = var.nutanix_cluster
  os_type          = "Linux"

  vm_disks {
    image_type = "ISO_IMAGE"
    source_image_name = var.ubuntu_disk_image_name
  }

  vm_disks {
      image_type = "DISK"
      disk_size_gb = 40
  }

  vm_nics {
    subnet_name       = var.nutanix_subnet
  }

  image_name        = "ubuntu-24.04-tls"
  force_deregister  = true
  user_data         = base64encode(file("scripts/cloud-init/cloud-config.yaml"))

  shutdown_command  = "echo 'packer' | sudo -S shutdown -P now"
  shutdown_timeout = "2m"
  ssh_password     = "ubuntu"
  ssh_username     = "ubuntu"
}
#cloud-config
users:
  - name: ubuntu
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
chpasswd:
  list: |
    ubuntu:ubuntu
  expire: False
ssh_pwauth: True

Iso does not use provided cloud-config.

What did you expect to happen:

Cloud-config to be used to automate the installation.

Environment:

  • packer-plugin-nutanix version (use packer plugins installed): 0.9.4
  • Packer version (use packer version): Packer v1.11.2
  • OS (e.g. from /etc/os-release): ubuntu-24.04.1-live-server-amd64
@tuxtof
Copy link
Contributor

tuxtof commented Jan 2, 2025

Hello @stgrace
this is not a packer issue , but just how Ubuntu is working

the only cloud-init argument supported by iso is autoinstall

@stgrace
Copy link
Author

stgrace commented Jan 2, 2025

Hi @tuxtof,

Tried it with autoinstall as well, neither worked.
Currently running it with a cd mount as you mentioned in a different issue.
I feel like either something needs to be changed to make user_data work (again), or the ubuntu example needs to be updated to use cd_files and label? What do you think?

@tuxtof
Copy link
Contributor

tuxtof commented Jan 3, 2025

Hello @stgrace

you can check here , i already give more details

#160

there is few errors in the method you try to use

  • Ubuntu autoinstall mode use the NoCloud cloud-init datasource as mentioned in the official doc here https://ubuntu.com/server/docs/install/autoinstall
  • Nutanix AHV is using the Config Drive v2 datasource, this is the reason why your boot times out and goes to the GUI installer. To use it you need to specify the right format with the ds="configdrive" append arg

You can also use the autoinstall arg to skip confirmation.

And if you want a full e2e automatic experience , as we don't support yet the boot_cmd in packer , best is to switch to a netboot install so you can modify your grub/pxe config at the source and add autoinstall and correct ds mode

@tuxtof
Copy link
Contributor

tuxtof commented Jan 3, 2025

also mentioned in

#109
#105
#49

there is some API missing for now, who block us to go forward :-(

@tuxtof tuxtof added blocker an external issue is blocking roadmap planned in the roadmap labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker an external issue is blocking roadmap planned in the roadmap
Projects
None yet
Development

No branches or pull requests

2 participants