-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Pure Storage storage driver #14599
base: main
Are you sure you want to change the base?
Conversation
return err | ||
} | ||
|
||
err = os.Remove(mountPath) |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
This path depends on a
user-provided value
This path depends on a
user-provided value
This path depends on a
user-provided value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe @simondeziel is planning to address this issue more generally higher up the call stack, so wont block this PR.
c53014e
to
69f6cae
Compare
doc/howto/storage_pools.md
Outdated
|
||
Create a storage pool named `pool1` that uses NVMe/TCP by default: | ||
|
||
lxc storage create pool1 pure pure.gateway=https://<purestorage-address> pure.api.token=<purestorage-api-token> pure.array.address=<nvme-ip> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That gateway HTTPS verification presumably relies on the OS provided trust store so it would work if it's an "official TLS" cert like one signed by Let's Encrypt.
I must admit not knowing how to provide a different trusted CA if one doesn't have an official cert.
69f6cae
to
231d0f0
Compare
231d0f0
to
276bb1b
Compare
@minaelee Thanks for the comments. I've addressed all of them, but will ask you for another review just before we merge the PR, as there may still be some changes to the docs. Thanks again :) |
parentName, _, isSnapshot := api.GetParentAndSnapshotName(vol.Name()) | ||
if !isSnapshot { | ||
// Volume has no parent. | ||
return "", nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be an error as it means the vol passed in is not a snapshot and the function is being used incorrectly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about this one, and decided to just return an empty string to avoid checking for snapshot on every place where the function is called. However, in such case the function name "GetParentVolumeUUID" would probably be more appropirate, as non-snapshot volumes have no parent.
On the other side, returning an error as you have suggested prevents unnecessary or incorrect usage of the function.
} | ||
|
||
reqHeaders := map[string]string{ | ||
"Api-Token": p.driver.config["pure.api.token"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need to have this casing of Api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not matter. I think it can be all lower case if preferred?
|
||
p.accessToken = respHeaders["X-Auth-Token"] | ||
if p.accessToken == "" { | ||
return errors.New("Failed to obtain access token") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we get any other sort of error message from this post?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we get any error from this post, it will be returned as "Failed to login: ".
For example: Error: Failed to create storage pool "pure": Failed to login: Unable to list user for API token
where Unable to list user for API token
is PureStorage error.
The check p.accessToken == ""
is just to ensure that we also successfully parsed the the access token from the response. This code is only reached if Post request was successful.
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
…ce information Signed-off-by: Din Music <[email protected]>
…volumes Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
…zed images Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Pure Storage does not allow mounting snapshots directly, therefore we have to create a new volume from it before mounting it. Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Correctly initialize Pure Storage pool. Signed-off-by: Din Music <[email protected]>
…lable storage drivers Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Currently, Pure Storage driver does not support recovery. Mainly bacuse the storage volume names are encoded, which would result in indistinguishable storage volume names after the recovery. Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
… drivers Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
92bf8b5
to
bc794ea
Compare
This PR adds
pure
storage driver for Pure Storage remote storage.Driver supports communication over either iSCSI or NVMe/TCP.
iscsiadm
to the LXD host: commands/daemon: Redirect iscsiadm to the host lxd-pkg-snap#646