migrations: Call AdoptResources from migrationmaster worker #6952

Merged
merged 3 commits into from Feb 9, 2017

Conversation

Projects
None yet
3 participants
Member

babbageclunk commented Feb 9, 2017

Description of change

Once the migration is successful we call AdoptResources on the target controller to mark all of the resources used by the model as managed by the target controller. This prevents the source controller from incorrectly cleaning those resources up if it's destroyed.

Which resources are transferred depends on the cloud hosting the model, but it generally includes things like instances, volumes, and security groups.

QA steps

(Should be done for all clouds, but especially ec2, gce, azure, rackspace, maas, lxd and openstack, since they handle resource tagging and cleanup when a controller is destroyed.)

  • bootstrap two controllers, A and B
  • add a model on A
  • deploy an application the model
  • migrate the model to B
  • once the migration is complete and the model is running on B, destroy controller A
  • the model should continue running on B

Bug reference

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

babbageclunk added some commits Feb 9, 2017

Call AdoptResources from the migrationmaster worker
It's done in the success phase after all of the minions have reported
back.

axw approved these changes Feb 9, 2017

Nice and neat. LGTM

worker/migrationmaster/worker.go
// There's no turning back from SUCCESS - any problems should have
// been picked up in VALIDATION. After the minion wait in the
// SUCCESS phase, the migration can only proceed to LOGTRANSFER.
return coremigration.LOGTRANSFER, nil
}
+func (w *Worker) transferResources(targetInfo coremigration.TargetInfo, modelUUID string) error {
+ w.setInfoStatus("transferring cloud resources to target controller")
@axw

axw Feb 9, 2017

Member

transferring ownership of?

@babbageclunk

babbageclunk Feb 9, 2017

Member

yup, will change this

Member

babbageclunk commented Feb 9, 2017

$$merge$$

Contributor

jujubot commented Feb 9, 2017

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

Contributor

jujubot commented Feb 9, 2017

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

Member

axw commented Feb 9, 2017

$$merge$$

Contributor

jujubot commented Feb 9, 2017

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

Member

babbageclunk commented Feb 9, 2017

Thanks @axw

Contributor

jujubot commented Feb 9, 2017

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

Member

axw commented Feb 9, 2017

$$merge$$

Contributor

jujubot commented Feb 9, 2017

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

@jujubot jujubot merged commit 2f970c3 into juju:2.1 Feb 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment