Unattended installation user data conflict

Bug #1879103 reported by Andrew Stoltz
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
cloud-init
Invalid
Undecided
Unassigned
subiquity
Fix Committed
Undecided
Unassigned

Bug Description

When passing user-data to the 20.04 unattended installation through an iso described at https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/QuickStart, user creation doesn't happen. This is because /dev/sr1 takes priority over /var/lib/cloud/seed/nocloud-net/.

The simple workaround for anyone experiencing this issue is to add the following to their user-data script:

  late-commands:
    - "eject /dev/sr1"

I experienced this using Hyper-V.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Ups, that's a bit messy. I'm not sure what we can do about this.

I have to say that I had expected that this would work by intercepting the reboot and disconnecting both the cidata drive and the install media before starting the VM again.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Ouch

Revision history for this message
Ryan Harper (raharper) wrote :

@Andrew

Would you be able to run 'cloud-init collect-logs' and attach the tarball to this bug?

Changed in cloud-init:
status: New → Incomplete
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Here's some logs from a reproducer.

Changed in cloud-init:
status: Incomplete → Confirmed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I had a bit of a think and a poke around and think I came up with a solution: https://github.com/CanonicalLtd/subiquity/pull/790

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I tried my fix with the testcase from bug 1879485 and it worked, so that's a good start!

Revision history for this message
Ryan Harper (raharper) wrote :

Hrm, the cloud-init.tar.gz seems to have an empty /run ... I really wanted to see the /run/cloud-init/.ds-identify.result,ds-identify.log,cloud.cfg

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Re: [Bug 1879103] Re: Unattended installation user data conflict

On Tue, 16 Jun 2020 at 11:10, Ryan Harper <email address hidden>
wrote:

> Hrm, the cloud-init.tar.gz seems to have an empty /run ... I really
> wanted to see the /run/cloud-init/.ds-identify.result,ds-
> identify.log,cloud.cfg
>

Well I had to dig it out of a disk image because I couldn't log in to the
VM in this case... There are ways to make this possible I guess but a bit
tedious.

In any case, it's fairly clear what happens here when you read the source
for DataSourceNoCloud: filesystems with the relevant label are checked
after self.seed_dirs, and so any user-data there wins.

Changed in subiquity:
status: New → Fix Committed
Revision history for this message
Dan Watkins (oddbloke) wrote :

OK, it sounds like cloud-init is behaving as we expect it to, so I'm going to mark our task as Invalid. Do comment (and change status to New, if you can) if you think that's incorrect.

Changed in cloud-init:
status: Confirmed → Invalid
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.