Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

volume creation fails when datastore name is having embedded spaces e.g. "datastore (1)" #816

Closed
shuklanirdesh82 opened this issue Dec 13, 2016 · 2 comments

Comments

@shuklanirdesh82
Copy link
Contributor

Steps to reproduce:

  1. rename existing datastore which is not having spaces e.g. datastore => datastore (1)
  2. invoke volume creation (docker volume create --driver=vmdk --name=MyVol22334 -o size=1gb)

Expectation: volume creation should succeed

Note: having spaces in datastore name is a valid name in vc context; while adding ESXs to VC which is having same datastore name; VC renames datastore by appending '(N)' for later ESX automatically

Current result: volume creation is failing with following outcome

-----------from console---------------
# docker volume create --driver=vmdk --name=MyVol22334 -o size=1gb
Error response from daemon: create MyVol22334: VolumeDriver.Create: Failed to create /vmfs/volumes/datastore (1)/dockvols/MyVol22334.vmdk. /bin/sh: syntax error: unexpected "("

-------from docker-volume-vsphere.log -------------
2016-12-13 20:34:06.835956871 +0000 UTC [ERROR] Create volume failed error="Failed to create /vmfs/volumes/datastore (1)/dockvols/MyVol22334.vmdk. /bin/sh: syntax error: unexpected \"(\"\n" name=MyVol22334 

on ESX side:

----------from vmdk_ops.log ----------
12/13/16 20:34:06 2663252 [photon2-[datastore (1)] dockvols/MyVol22334.vmdk] [INFO   ] executeRequest 'get' completed with ret={u'Error': 'Volume MyVol22334 not found (file: /vmfs/volumes/datastore (1)/dockvols/MyVol22334.vmdk)'}
12/13/16 20:34:06 2663252 [photon2-[datastore (1)] dockvols/MyVol22334.vmdk] [INFO   ] *** createVMDK: /vmfs/volumes/datastore (1)/dockvols/MyVol22334.vmdk opts = {u'size': u'1gb', u'fstype': u'ext4'}
12/13/16 20:34:06 2663252 [photon2-[datastore (1)] dockvols/MyVol22334.vmdk] [INFO   ] executeRequest 'create' completed with ret={u'Error': 'Failed to create /vmfs/volumes/datastore (1)/dockvols/MyVol22334.vmdk. /bin/sh: syntax error: unexpected "("\n'}
@shuklanirdesh82
Copy link
Contributor Author

created volumes are not viewable so pulling into 0.12 release. If user happens to rename the datastore with embedded namespace, it will run into following issue.

using admin cli:

[root@sc-rdops-vm07-dhcp-193-230:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Invalid destination specification:
vmkfstools: (1)/dockvols/f7d20fb8-ead2-4327-ad6f-066c82a76930/dockerVol_1486430383.vmdk: No name specification expected.
Failed to stat /vmfs/volumes/vsanDatastore (1)/dockvols/f7d20fb8-ead2-4327-ad6f-066c82a76930/dockerVol_1486430383.vmdk. VMDK corrupted. Please remove and then retry

@lipingxue
Copy link
Contributor

The following is the test steps and results.

  1. two volumes have been created in datastore "tmp(datastiore1)"
  2. rename the datastore name to "tmp (datastore1)" (add a space in the datastore name)
  3. run "docker volume ls"
root@photon-eZ5ILvREQ [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
vmdk                vol1@tmp- (datastore1)
vmdk                vol2@tmp- (datastore1)
  1. run "docker volume create" to create a new volume "vol3"
root@photon-eZ5ILvREQ [ ~ ]# docker volume create --driver=vmdk --name=vol3 -o size=100MB
vol3
  1. run "docker volume ls" again, which list all three volumes.
root@photon-eZ5ILvREQ [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
vmdk                vol1@tmp- (datastore1)
vmdk                vol2@tmp- (datastore1)
vmdk                vol3@tmp- (datastore1)

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants