Drop lxd-storage feature flag #7635

Merged
merged 1 commit into from Jul 13, 2017

Conversation

Projects
None yet
3 participants
Member

axw commented Jul 13, 2017

Description of change

Tidy up the lxd storage provider, and drop the feature flag.
This PR makes the "lxd" storage provider usable for creating
model-level filesystems. This provider does not support
block storage. The filesystems can be dynamically created,
destroyed, attached, and detached.

Using the "lxd" storage pool (i.e. without configuration),
storage will be allocated from the LXD storage pool called
"juju", using the driver "dir". The provider also predefines
a "lxd-zfs" storage pool, which maps to the LXD storage pool
called "juju-zfs", using a zfs pool of the same name. Juju
will create the LXD storage pools as necessary, and will
ensure that they have the same configuration before use.

QA steps

  1. juju bootstrap localhost
  2. juju deploy postgresql --storage pgdata=1G,lxd

Confirm that the machine comes up, and postgresql deploys successfully. Using "lxd storage list juju", you should be able to see the volume created by Juju. Then, opening a terminal in the container, you should be able to see that volume mounted at /srv/pgdata, with the postgresql database stored within it.

Documentation changes

Yes, we should update the storage docs to refer to this new storage provider.

Bug reference

None.

Awesome

provider/lxd/environ.go
@@ -165,6 +165,11 @@ func (env *environ) Destroy() error {
return errors.Trace(err)
}
}
+ if env.storageSupported() {
+ if err := destroyModelFilesystems(env); err != nil {
+ return errors.Annotate(err, "destroying LXD volumes for model")
@wallyworld

wallyworld Jul 13, 2017

Owner

"LXD filesystems" maybe?
The underlying artefact may be an LXD volume but we're presenting to the user a Juju filesystem storage?

@axw

axw Jul 13, 2017

Member

OK, done

provider/lxd/storage.go
}
- return &lxdFilesystemSource{e.env, lxdStorageConfig}, nil
+ err = env.raw.CreateStoragePool(cfg.lxdPool, cfg.driver, cfg.attrs)
@wallyworld

wallyworld Jul 13, 2017

Owner

I assume CreateStoragePool is idempotent?

@axw

axw Jul 13, 2017

Member

It's not, but (a) there's no special error code, and (b) we check for existence above

@axw

axw Jul 13, 2017

Member

I've changed things a bit so that we make the CreateStoragePool call first, then if it fails we check if the pool already exists. If it does not exist, then we return the original error.

Drop lxd-storage feature flag
Tidy up the lxd storage provider, and drop the feature flag.

Using the "lxd" storage pool (i.e. without configuration),
storage will be allocated from the LXD storage pool called
"juju", using the driver "dir". The provider also predefines
a "lxd-zfs" storage pool, which maps to the LXD storage pool
called "juju-zfs", using a zfs pool of the same name. Juju
will create the LXD storage pools as necessary, and will
ensure that they have the same configuration before use.
Member

axw commented Jul 13, 2017

$$merge$$

Contributor

jujubot commented Jul 13, 2017

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

@jujubot jujubot merged commit d07880c into juju:develop Jul 13, 2017

1 check passed

github-check-merge-juju Ran tests against PR. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment