Merge 2.2 into develop (storage fixes) #8131

Merged
merged 6 commits into from Nov 27, 2017

Conversation

Projects
None yet
3 participants
Member

axw commented Nov 27, 2017

Description of change

Merge storage fixes from 2.2 into develop. Things have changed a bit: the scope of a filesystem is now always the same as the backing volume, and when you destroy a unit, it leaves detachable storage in the model.

So we now also cater for detachable, volume-backed filesystems by short-circuit removing their attachments, without destroying the filesystem. We also update the status of filesystems for which we remove the attachments (i.e. set to "detached").

QA steps

  1. juju bootstrap aws
  2. juju deploy jenkins --storage jenkins=ebs
    (wait)
  3. juju ssh 0
    cd /srv/mnt/jenkins
    (sit there to prevent filesystem from being unmounted)
  4. juju remove-application jenkins
    (wait; machine should be torn down, filesystem and volume should be left in the model; status should be "detached", with no error message)
  5. juju destroy-model --destroy-storage
    (filesystem and volume should be destroyed)

Documentation changes

None.

Bug reference

Fixes https://bugs.launchpad.net/juju/+bug/1722818

axw and others added some commits Nov 23, 2017

state: destroy backing volumes with machines
When progressing a machine to Dead, where the
machine has volume-backed filesystems, ensure
we destroy the backing filesystem. The method
for removing machine-scoped filesystems had a
partial/broken approach to removing filesystems;
we now use the "removeFilesystemOps method for
consistency; a "removeVolumeOps" method has
been extracted, and is used similarly.
Merge pull request #8124 from axw/lp1722818-removemachinefilesystems-…
…destroy-backing-volumes

state: destroy backing volumes with machines

## Description of change

When progressing a machine to Dead, where the
machine has volume-backed filesystems, ensure
we destroy the backing filesystem. The method
for removing machine-scoped filesystems had a
partial/broken approach to removing filesystems;
we now use the "removeFilesystemOps method for
consistency; a "removeVolumeOps" method has
been extracted, and is used similarly.

## QA steps

1. juju bootstrap openstack
2. juju deploy jenkins --storage jenkins=cinder
(wait)
3. juju remove-machine --force 0

It's not entirely repeatable, because there's a race involved. I modified the storage provisioner to prevent it from removing the filesystem before the machine was progressed to Dead and removed.

## Documentation changes

None.

## Bug reference

Fixes the main issue in https://bugs.launchpad.net/juju/+bug/1722818.
state: short-circuit remove machine filesystems
When a machine is destroyed and its cleanup is
run, short-circuit the removal of non-detachable
filesystems as long as the machine is non-manual.
For manual machines, the machine is not going
anywhere, so the filesystem must be detached and
destroyed by the machine's storage provisioner.

Note that the cleanup will still continue to fail
while the filesystem has a related a storage instance,
meaning the unit has not run the storage-detaching
hook. This ensures that we don't pull the filesystem
out from underneath the unit during destruction.

Fixes the other half of https://bugs.launchpad.net/juju/+bug/1722818
Merge pull request #8127 from axw/lp1722818-destroymachine-removefile…
…systemattachments

state: short-circuit remove machine filesystems

## Description of change

When a machine is destroyed and its cleanup is
run, short-circuit the removal of non-detachable
filesystems as long as the machine is non-manual.
For manual machines, the machine is not going
anywhere, so the filesystem must be detached and
destroyed by the machine's storage provisioner.

Note that the cleanup will still continue to fail
while the filesystem has a related a storage instance,
meaning the unit has not run the storage-detaching
hook. This ensures that we don't pull the filesystem
out from underneath the unit during destruction.

## QA steps

1. juju bootstrap openstack
2. juju deploy jenkins --storage jenkins=cinder
(wait)
3. juju ssh 0
cd /srv/mnt/jenkins
(just sit there to prevent the filesystem being unmounted)
4. juju remove-application jenkins
(the machine should be removed successfully, and the cinder volume should be removed)

## Documentation changes

None.

## Bug reference

Fixes the other half of https://bugs.launchpad.net/juju/+bug/1722818
state: add dyingMachine cleanup in destroyHostOps
When destroying a unit's host machine, enqueue a
"dyingMachine" cleanup. This ensures that removing
a unit or application has the same effect as
(force-) destroying the machine, and its storage
is detached/removed.
Member

axw commented Nov 27, 2017

$$merge$$

Contributor

jujubot commented Nov 27, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit e5ecebc into juju:develop Nov 27, 2017

1 check failed

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment