Unable to do an unattended storage section configuration on ubuntu

171 views
Skip to first unread message

Sonali Prasad

unread,
Oct 11, 2022, 2:44:50 AM10/11/22
to Packer
Hi Team, 

I am using the  user-data file to automatically complete the  installer  configuration   on  ubuntu_server_20.04.3-live-server-amd64.iso image, but I am unable to set up the storage section in an automated way. 
This is my user-data file placed under http directory:
I have also attached the screenshot of storage page, kindly have a look. 

#cloud-config
autoinstall:
  version: 1
  interactive-sections:
    - storage
  locale: en_US
  keyboard:
    layout: en
    variant: us
  network:
    network:
      version: 2
      ethernets:
        ens33:
          dhcp4: true
  identity:
    hostname: ubuntu-server
    username: ubuntu
    password: ubuntu
  kernel:
    package: linux-generic
  ssh:
    allow-pw: true
    authorized-keys: []
    install-server: true
  user-data:
    disable_root: false
  packages:
    - build-essential
    - network-manager
    - dkms
    - emacs-nox
    #- ubuntu-desktop-minimal^
  package_update: true
  package_upgrade: true
  late-commands:
    - 'sed -i "s/dhcp4: true/&\n      dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml'
    - echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
    - echo 'ubuntu-server ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
    - curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/ubuntu
    - apt update -y
    - apt install cloud-init -y
    - apt install openssh-server -y
    - apt install nfs-common nfs-kernel-server -y
    - cat <<EOF > /etc/resolv.conf
    nameserver <ip>
    EOF
    - firewall-cmd --permanent --add-port=22/tcp  
    - firewall-cmd --permanent --add-port=80/tcp
    - firewall-cmd --permanent --add-port=443/tcp
    - firewall-cmd --permanent --add-port=2376/tcp
    - firewall-cmd --permanent --add-port=2379/tcp
    - firewall-cmd --reload
    - apt install iputils-ping open-vm-tools openssh-server net-tools perl open-iscsi ntp curl vim ifupdown zip unzip gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release python3-pip jq openvpn -y
    - service vmtoolsd restart


Any advice or pointers would be much appreciated.


storage.PNG

Abhijeet Dhumal

unread,
Jun 1, 2023, 3:22:02 AM6/1/23
to Packer
Hi, 
Do you have the solution for autoinstall guided storage configuration

Reply all
Reply to author
Forward
0 new messages