vmware-archive / vsphere-storage-for-docker

vSphere Storage for Docker
https://vmware.github.io/vsphere-storage-for-docker
Apache License 2.0
251 stars 95 forks source link

Allow for a null VC uuid for a VM to allow the plugin to be used on standalone hosts. #1997

Closed govint closed 6 years ago

govint commented 6 years ago

Modified ESX service to allow vc uuid to be zero length string in cases where user has a standalone ESX host with no VC.

Test:

docker volume create -d vsphere vc_vol_1 vc_vol_1 docker volume inspect vc_vol_1 [ { "Driver": "vsphere", "Labels": {}, "Mountpoint": "/mnt/vmdk/vc_vol_1/", "Name": "vc_vol_1", "Options": {}, "Scope": "global", "Status": { "access": "read-write", "attach-as": "independent_persistent", "capacity": { "allocated": "13MB", "size": "100MB" }, "clone-from": "None", "created": "Tue Nov 21 13:02:21 2017", "created by VM": "master-VM0.0", "datastore": "sharedVmfs-0", "diskformat": "thin", "fstype": "ext4", "status": "detached" } } ]

docker run --rm -it -v vc_vol_1:/mnt centos Unable to find image 'centos:latest' locally latest: Pulling from library/centos d9aaf4d82f24: Pull complete Digest: sha256:4565fe2dd7f4770e825d4bd9c761a81b26e49cc9e3c9631c58cfc3188be9505a Status: Downloaded newer image for centos:latest

exit docker volume rm vc_vol_1 vc_vol_1

govint commented 6 years ago

Test failed because of a host issue, will restart the CI.

from vmware.esxcli.Session import Session, SessionOptions, IsInVisor, \

ImportError: No module named esxcli.Session