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

Deprecate user_data #150

Open
2 of 4 tasks
VoyTechnology opened this issue Sep 2, 2022 · 2 comments
Open
2 of 4 tasks

Deprecate user_data #150

VoyTechnology opened this issue Sep 2, 2022 · 2 comments

Comments

@VoyTechnology
Copy link
Member

VoyTechnology commented Sep 2, 2022

The user_data field doesn't work and unfortunately we should deprecate the field until it does.

Problem

At the moment the user_data is provided to the Virtualbox VM by setting extra data on the VM. This in itself is useless, as this needs to be read on the VM side with guest additions and then somehow then passed to cloud-init (this is the assumption for user_data support, I am not sure are there any other uses for user_data).

Short Term Solution

user_data field is deprecated, and all issues will be closed pointing at this one as it's clear it's broken and there is no need to have 10 of them open.

Long term solution

Bring back support for user_data, but this time make it work. One of the proposed solutions is to create an image out of the data and mount it. This is something we should explore. If we fail we will just remove user_data support completely.

Action Items

  • Close all open user_data issues
  • Mark the field as deprecated - Deprecated and remove user_data #151
  • Explore user_data image
  • Reimplement user_data or remove it based feasibility of the image idea.
VoyTechnology added a commit that referenced this issue Sep 2, 2022
As per #150, the user_data is not working, so the field is marked as
deprecated until its fixed.

All references from the examples and docs have been removed to avoid
confusion.
VoyTechnology added a commit that referenced this issue Sep 2, 2022
As per #150, the user_data is not working, so the field is marked as
deprecated until its fixed.

All references from the examples and docs have been removed to avoid
confusion.
VoyTechnology added a commit that referenced this issue Sep 14, 2022
As per #150, the user_data is not working, so the field is marked as
deprecated until its fixed.

All references from the examples and docs have been removed to avoid
confusion.
@EvanCarroll
Copy link

If VirtualBox were to spin up a webserver up on the 169.254.169.254 address to host cloud-init config files, and attach the booting machine into a vlan with only that other box. Then it would work?

@netcarver
Copy link

I managed to use cloud-localds to create a user_data.iso that can be mounted into the vm using the optical_disks option, allowing cloud-init to proceed with the user_data from the mounted image.

1. Outline user_data cloud-init file

Create /home/user/boxes/user_data and set to whatever you want. Minimal snippet to start...

#cloud-config
locale: en_GB.UTF-8
timezone: Europe/London
package_update: True
packages:
  - virtualbox-guest-utils
  - podman
  - btop
  - ncdu
  - duf

2. Create the user_data.iso for mounting into VMs

cd /home/user/boxes && cloud-localds user_data.iso user_data

Giving /home/user/boxes/user_data.iso.

3. Mount this .iso using optical_disks option

In the main.tf file, I added the iso as an optical disk;

resource "virtualbox_vm" "node" {
  name      = ...
  image     = "/home/user/boxes/jammy-server-cloudimg-amd64.ova"
  ...
  
  optical_disks = [ "/home/user/boxes/user_data.iso" ]

  network_adapter {
    ...
  }
}

Which successfully executes cloud-init as expected on the provisioned VMs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants