ubuntu image with packer template: root not resizing with flavor

16 views
Skip to first unread message

john

unread,
Nov 6, 2020, 2:27:57 PM11/6/20
to Packer
New to packer.
I am building a ubuntu 16.04 image with disk size as 10G. When I create a open stack flavor with a bigger root size I was assuming it will pick it from flavor and resize accordingly. However, root size is getting fixed to the size I give in template.

The same template used for centos7.7 is working fine.

{
  "builders": [
    {
      "type": "qemu",
      "boot_command": [
        "{{ user `boot_command_prefix` }}",
        "/install/vmlinuz noapic ",
        "file=/floppy/{{ user `preseed` }} ",
        "debian-installer={{ user `locale` }} auto locale={{ user `locale` }} kbd-chooser/method=us ",
        "hostname={{ user `hostname` }} ",
        "fb=false debconf/frontend=noninteractive ",
        "keyboard-configuration/modelcode=SKIP ",
        "keyboard-configuration/layout=USA ",
        "keyboard-configuration/variant=USA console-setup/ask_detect=false ",
        "passwd/user-fullname={{ user `ssh_fullname` }} ",
        "passwd/user-password={{ user `ssh_password` }} ",
        "passwd/user-password-again={{ user `ssh_password` }} ",
        "passwd/username={{ user `ssh_username` }} ",
        "initrd=/install/initrd.gz -- <enter>"
      ],
      "disk_size": "{{ user `disk_size` }}",
      "floppy_files": [
        "http/{{ user `preseed` }}"
      ],
      "headless": "{{ user `headless` }}",
      "http_directory": "http",
      "iso_checksum": "{{ user `iso_checksum` }}",
      "iso_checksum_type": "{{ user `iso_checksum_type` }}",
      "iso_urls": [
        "{{ user `iso_url` }}"
      ],
      "output_directory": "/data/tmp/packer/output/Ubuntu-16.04-minimal",
      "shutdown_command": "echo '{{ user `ssh_password` }}'|sudo -S shutdown -P now",
      "ssh_password": "{{ user `ssh_password` }}",
      "ssh_username": "{{ user `ssh_username` }}",
      "ssh_wait_timeout": "10000s",
      "accelerator": "kvm",
      "vm_name": "{{ user `vm_name` }}",
      "qemuargs": [
          ["-nographic" ]       
      ]
    }
  ],
  "provisioners": [
    {
      "environment_vars": [
        "UPDATE={{user `update`}}",
        "INSTALL_DEV_PACKAGES={{user `install_dev_packages`}}",
        "INSTALL_VAGRANT_KEY={{user `install_ubuntu_key`}}",
        "SSH_USERNAME={{user `ssh_username`}}",
        "SSH_PASSWORD={{user `ssh_password`}}",
        "http_proxy={{user `http_proxy`}}",
        "https_proxy={{user `https_proxy`}}",
        "ftp_proxy={{user `ftp_proxy`}}",
        "rsync_proxy={{user `rsync_proxy`}}",
        "no_proxy={{user `no_proxy`}}"
      ],
      "execute_command": "echo '{{ user `ssh_password` }}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
      "scripts": [
        "scripts/base.sh",
        "scripts/cloud-init.sh",
        "scripts/wmt-release.sh",
        "scripts/ntp.sh",
        "scripts/serial-console.sh",
        "scripts/cleanup.sh",
        "scripts/zerodisk.sh"
       ],
      "type": "shell"
    }
  ],
  "variables": {
    "boot_command_prefix": "<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
    "cleanup_pause": "",
    "cpus": "1",
    "custom_script": ".",
    "desktop": "false",
    "disk_size": "40960",
    "ftp_proxy": "{{env `ftp_proxy`}}",
    "headless": "false",
    "http_proxy": "{{env `http_proxy`}}",
    "https_proxy": "{{env `https_proxy`}}",
    "install_ubuntu_key": "true",
    "install_dev_packages": "false",
    "iso_checksum": "sum",
    "iso_checksum_type": "sha1",
    "iso_name": "ubuntu-16.04-server-amd64.iso",
    "iso_url": "url",
    "locale": "en_US",
    "memory": "512",
    "no_proxy": "{{env `no_proxy`}}",
    "preseed" : "preseed.cfg",
    "rsync_proxy": "{{env `rsync_proxy`}}",
    "hostname": "dsdsd",
    "ssh_fullname": "dsds",
    "ssh_password": "dsds",
    "ssh_username": "dsd",
    "update": "true",
    "ubuntufile_template": "",
    "vm_name": "packer-qemu"
  }
}

Where does the resize configuration exist. Please help
Reply all
Reply to author
Forward
0 new messages