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

Volume gets created on incorrect vsan datastore. #1914

Closed ashahi1 closed 7 years ago

ashahi1 commented 7 years ago

Testbed had a vsan datastore named - vsanDatastore

  1. Created a volume using long volume name - testX1@vsanDatastore
  2. Verified from docker cli and esxcli that volume was successfully created
  3. Tried creating another volume using incorrect datastore name - testX2@vsandatastore Remember that we do not have volume named vsandatastore. Even though we do not have any volume named vsandatastore, volume creation succeeded.
  4. Docker cli and esxcli also lists both the volumes are created on vsanDatastore.

So step 3 can be confusing to the user as even though the setup does not have a volume named vsandatastore, volumes creation succeeds.

So user is passing datastore name as vsandatastore whereas volume is getting created on vsanDatastore.

Logs have been attached at the end.


Detailed steps and their output are as follows:

  1. Created a volume using long volume name - testX1@vsanDatastore
    root@sc-rdops-vm02-dhcp-52-237:~# docker volume create -d vsphere --name testX1@vsanDatastore
    testX1@vsanDatastore
    root@sc-rdops-vm02-dhcp-52-237:~#
  2. Verified from docker cli and esxcli that volume was successfully created
    
    root@sc-rdops-vm02-dhcp-52-237:~# docker volume ls
    DRIVER              VOLUME NAME
    vsphere:latest      testX1@vsanDatastore
    root@sc-rdops-vm02-dhcp-52-237:~#

[root@sc2-rdops-vm03-dhcp-106-33:~] esxcli storage guestvol volume ls Volume Datastore VMGroup Capacity Used Filesystem Policy Disk Format Attached-to Access Attach-as Created By Created Date


testX1 vsanDatastore _DEFAULT 100MB 80MB ext4 [VSAN default] thin detached read-write independent_persistent ubuntu-VM0.2 Fri Sep 29 19:03:55 2017 [root@sc2-rdops-vm03-dhcp-106-33:~]

3. Tried creating another volume using incorrect datastore name - testX2@vsandatastore . Volume creation succeeds even though there is no volume named ```vsandatastore ```.

root@sc-rdops-vm02-dhcp-52-237:~# docker volume create -d vsphere --name testX2@vsandatastore testX2@vsandatastore root@sc-rdops-vm02-dhcp-52-237:~#

4. Docker cli and esxcli also lists both the volumes are created on vsanDatastore. 

root@sc-rdops-vm02-dhcp-52-237:~# docker volume ls DRIVER VOLUME NAME vsphere:latest testX1@vsanDatastore vsphere:latest testX2@vsanDatastore <<<<<<<<<< root@sc-rdops-vm02-dhcp-52-237:~#

[root@sc2-rdops-vm03-dhcp-106-33:~] esxcli storage guestvol volume ls Volume Datastore VMGroup Capacity Used Filesystem Policy Disk Format Attached-to Access Attach-as Created By Created Date


testX1 vsanDatastore _DEFAULT 100MB 80MB ext4 [VSAN default] thin detached read-write independent_persistent ubuntu-VM0.2 Fri Sep 29 19:03:55 2017 testX2 vsanDatastore _DEFAULT 100MB 80MB ext4 [VSAN default] thin detached read-write independent_persistent ubuntu-VM0.2 Fri Sep 29 19:04:22 2017 [root@sc2-rdops-vm03-dhcp-106-33:~]



Logs:
[docker-volume-vsphere.txt](https://github.com/vmware/docker-volume-vsphere/files/1345432/docker-volume-vsphere.txt)
[vmdk_ops.txt](https://github.com/vmware/docker-volume-vsphere/files/1345433/vmdk_ops.txt)
shuklanirdesh82 commented 7 years ago

@ashahi1 I guess you have tried on vDVS 0.16 version .. can you please add those detail for the reference?

Thanks!

ashahi1 commented 7 years ago

I tried the same steps mentioned in original description with vDVS 0.16 version and I was NOT able to create volume if I pass datastore name as vsandatastore rather than vsanDatastore.

root@sc-rdops-vm02-dhcp-52-237:~# docker volume create -d vsphere --name test4@vsandatastore
Error response from daemon: create test4@vsandatastore: VolumeDriver.Create: Invalid datastore 'vsandatastore'.
Known datastores: sharedVmfs-0, sharedVmfs-1, local.2-0, local.2-1, local.2-2, vsanDatastore.
Default datastore: _VM_DS
root@sc-rdops-vm02-dhcp-52-237:~#
shaominchen commented 7 years ago

Regression issue.

govint commented 7 years ago

Actually, the code is designed to match the datastore name as a case insensitive string and working as observed. Closing as won't-fix.