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

Feature request: Ability to configure a filesystem label for virtual floppy #6587

Closed
wallrj opened this issue Aug 14, 2018 · 7 comments
Closed
Labels
builder/qemu community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers enhancement

Comments

@wallrj
Copy link

wallrj commented Aug 14, 2018

Follow up to: #3015

Use Case

I want to be able to build images based on existing cloud Images:

These images come with cloud-init pre-installed, which allows an admin to set a default password or SSH authorized key at boot time. This "user-data" can be supplied in various ways,

I want to use either the NoCloud or the ConfigDrive datasources, in conjunction with the Packer Qemu builder.

With these datasources, the user-data can be supplied on a vfat formatted floppy disk drive attached to the VM, but it needs to have a specific filesystem label:

I'd like to be able to choose the label that is given to the Packer floppy drive. E.g.

{
  "builders": [
    {
      "type": "qemu",
      "accelerator": "kvm",
      "floppy_files": ["files/meta-data", "files/user-data"],
      "floppy_filesystem_label": "cidata",
...

Workarounds

Meanwhile, there are couple of workarounds:

  1. Mimic an RHEV system: https://gist.github.com/DazWorrall/bfe376d71967059da57d
  2. Mimic an old Openstack system: Use ConfigDrive v1 and place everything in floppy_files: ["meta.js"]

Neither of these Cloud Init DataSource mechanisms check the floppy disk filesystem label.

System Info

  • Packer v1.2.5
  • On Fedora 28
@SwampDragons SwampDragons added the community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers label Dec 11, 2018
@simonklb
Copy link

Hi! I'm new to Packer and was also looking for a way to use the QEMU builder with a Ubuntu cloud image as backing file.

Is there a specific reason why you want to use floppy? I found that http_directory together with the nocloud-net datasource worked well:

"http_directory": "./seed",
"qemuargs": [
    ["-smbios", "type=1,serial=ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/"]
]

Where the seed directory contains the meta-data and user-data files.

However, I tried using a seed image (created with cloud-localds) attached as a floppy disk as well and saw no issues on my end:

"qemuargs": [
    ["-fda", "seed.img"]
]

Tested with the following images:
https://cloud-images.ubuntu.com/xenial/20181207/xenial-server-cloudimg-amd64-disk1.img
https://cloud-images.ubuntu.com/bionic/20181206/bionic-server-cloudimg-amd64.img

@wallrj
Copy link
Author

wallrj commented Dec 11, 2018

@simonklb I didn't know about nocloud-net datasource. Thank you! I'll try it out.

@wallrj
Copy link
Author

wallrj commented Jan 2, 2019

@simonklb I tried nocloud-net this morning and the problem is that Centos7 still uses cloudinit-0.7.9 which doesn't support the nocloud-net datasource or the --smbios mechanism for configuring nocloud.

It wasn't introduced until version 17.1

@simonklb
Copy link

simonklb commented Jan 3, 2019

Ah, that explains it.

I believe that prior to this change you could get the cloud-config by simulating the EC2 metadata service on 169.254.169.254. Not sure if it's possible to achieve this using Packer though. Otherwise I guess you are stuck with having to mount the seed image using qemuargs.

Would love to hear other solutions to this if there are any available!

@ikalnytskyi
Copy link

packer == 1.5.1, the following solution works fine for me:

{
      "floppy_files": [
        "data/qemu/user-data",
        "data/qemu/meta-data"
      ],
      "floppy_label": "cidata"
}

@SwampDragons
Copy link
Contributor

Oh yes this looks like it was solved in #8099 and just left off the closure notes; thanks for pointing this out.

@ghost
Copy link

ghost commented Apr 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
builder/qemu community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers enhancement
Projects
None yet
Development

No branches or pull requests

4 participants