Skip to content

Conversation

@axw
Copy link
Contributor

@axw axw commented Jul 18, 2017

Description of change

Add state/apiserver support for non-destructively removing storage from a model. This PR is just about modifying the model entities, and updating the storage provisioner API with methods for reporting the new information to a storage provisioner worker.

There will be a followup PR that adds the API client, CLI, worker, and storage provider changes.

QA steps

Smoke test, ensure "remove-storage" works as before.

Documentation changes

None (yet).

Bug reference

None.

@axw axw changed the title Release storage controller Support releasing storage (model/apiserver changes) Jul 18, 2017
result[i].Error = common.ServerError(err)
continue
}
destroy := a.storage.DestroyStorageInstance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring for the containing Destroy method needs updating

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also, I'll be renaming the method to Remove in the next PR, after discussion with Christian.

@axw axw force-pushed the release-storage-controller branch from ec54d73 to 49081db Compare July 19, 2017 00:55
Add a new method, State.ReleaseStorageInstance,
which atomically marks a storage instance Dying
and sets it to "releasing". A storage instance
that is being released is one that will be
removed from the model without destorying the
cloud storage resources.
@axw axw force-pushed the release-storage-controller branch from 49081db to 8fd5f42 Compare July 19, 2017 01:00
@axw
Copy link
Contributor Author

axw commented Jul 19, 2017

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Jul 19, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Jul 19, 2017

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/11322

Update the Storage API facade to handle the new
ReleaseStorage field in the DestroyStorage method's
parameters. This is to support a client requesting
that storage be non-destructively removed from the
model.

Update the StorageProvisioner API with new methods
for obtaining parameters to destroy volumes and
filesystems (distinct from parameters for creating),
which include a new field indicating whether or
not the storage should be released rather than
destroyed.
@axw axw force-pushed the release-storage-controller branch from 8fd5f42 to c770def Compare July 19, 2017 01:27
@axw
Copy link
Contributor Author

axw commented Jul 19, 2017

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Jul 19, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 9c67c29 into juju:develop Jul 19, 2017
jujubot added a commit that referenced this pull request Jul 19, 2017
Release storage client worker provider

## Description of change

Add api, cmd, worker/storageprovisioner, and storage provider changes required to support non-destructively removing storage from a model.

The `juju remove-storage` command grows a `--no-destroy` flag, which instructs Juju to remove the storage without destroying the associated cloud storage resources. This can be used to release the storage from Juju's control. Once the storage is removed from the model, destroying the model or controller will not destroy the storage.

The VolumeSource and FilesystemSource interfaces grow methods for releasing storage, rather than destroying it. The storageprovisioner worker uses these methods for storage that is marked for releasing.

Requires #7648

## QA steps

1. juju bootstrap localhost
2. juju deploy postgresql --storage pgdata=lxd
3. juju remove-storage --force --no-destroy pgdata/0
4. juju destroy-controller localhost
5. lxc storage volume show juju juju-<model-uuid-suffix>-filesystem-0 # use "list" to get the name
(volume should remain, but should show no juju-controller-uuid or juju-model-uuid tags)

As above, but with EBS. In the portal, you should see the juju-controller-uuid/juju-model-uuid tags are empty after the storage is released/removed.

## Documentation changes

Yes, we'll need to document `juju remove-storage --no-destroy`.

## Bug reference

None.
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

Successfully merging this pull request may close these issues.

3 participants