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
Fix vmware vm uuid parsing and add DeleteFrom and DetachFrom #566
Conversation
Signed-off-by: Harsh Desai <harsh@portworx.com>
Signed-off-by: Harsh Desai <harsh@portworx.com>
FYI: title has |
if err != nil { | ||
return nil, err | ||
} | ||
cfg.VMUUID, _ = storageops.GetEnvValueStrict("VSPHERE_VM_UUID") |
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.
curious why this change is needed?
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.
VMUUID is required to be fetched from the env variableVSPHERE_VM_UUID
only if one is running unit tests for dev.
When running in a real vSphere environment, Portworx (porx) will fetch this from a cloudprovider providerID
field that the vmware cloud provider in k8s populates in the node object. For e.g
- apiVersion: v1
kind: Node
metadata:
creationTimestamp: 2018-08-13T03:46:12Z
spec:
externalID: 421076c2-e509-7897-e64f-84b0bff79cbe
providerID: vsphere://421076c2-e509-7897-e64f-84b0bff79cbe
So we don't need the env variable.
And in a non-k8s environment, this can be fetched from a /sys/fs file where vmware puts the vm uuid.
@harsh-px just for my info, is there a reason this code is a part of libopenstorage ? |
This is the storageops interface ASG/cloud drive code in porx (AWS, GCE, vSphere) uses. For e.g https://github.com/portworx/porx/blob/master/storage/hal/provider/aws/aws_storage.go#L50 is where aws uses it. |
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.
the changes look good.
Please add a UT esp. for DetachFrom for completeness.
@harsh-px iirc the reason storage ops of AWS was put in libopenstorage was to have AWS volume driver code reuse the storage ops. gke/vmware don't have that dependency (does not have volume driver implementation for osd). is there any interface/implementation required for osd itself from either gke/vmware ? |
Signed-off-by: Harsh Desai <harsh@portworx.com>
@adityadani added
Nothing in osd is using gke/vmware. Currently it's only porx. Project rico in libopenstorage was going to use all of these storage ops (https://github.com/libopenstorage/rico/tree/master/pkg/cloudprovider). |
Signed-off-by: Harsh Desai harsh@portworx.com
What this PR does / why we need it: