cannot remove and re-add a manually provisioned machine

Bug #1851489 reported by Andrea Ieri
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Joseph Phillips

Bug Description

Expected behavior:
Removing a manually provisioned machine cleans up all deployed juju code

Current behavior (2.6.9):
Manual cleanup is needed to re-deploy a manually provisioned machine

How to reproduce:
$ juju add-machine ssh:ubuntu@<some-IP>
created machine 64
$ juju remove-machine 64
removing machine 64
$ juju add-machine ssh:ubuntu@<some-IP>
ERROR machine is already provisioned

Workaround:
$ sudo systemctl disable jujud-machine-64.service
Removed /etc/systemd/system/multi-user.target.wants/jujud-machine-64.service.
Removed /etc/systemd/system/jujud-machine-64.service.
$ sudo rm -rf /lib/systemd/system/jujud-machine-64
$ sudo rm -rf /var/lib/juju
# Now add-machine will work

Changed in juju:
status: New → Triaged
Tim Penhey (thumper)
Changed in juju:
importance: Undecided → Medium
tags: added: manual-provider
Revision history for this message
Joseph Phillips (manadart) wrote :

The removal of cleanup logic was a deliberate step to ensure that no Juju infrastructure can self-destruct under any circumstances.

As a compromise, machine initialisation has been modified to add an executable script to /sbin for cleaning a controller or machine previously provisioned by Juju.

So there is still a manual step required, but it is simply "/sbin/remove-juju-services".

The patch is here: https://github.com/juju/juju/pull/10877

Changed in juju:
status: Triaged → In Progress
assignee: nobody → Joseph Phillips (manadart)
milestone: none → 2.7.1
Changed in juju:
milestone: 2.7.1 → 2.7.2
Revision history for this message
Joseph Phillips (manadart) wrote :

This actually went out with 2.7.1.

Changed in juju:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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