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

Tenancy: Add access to datastore does not add access. #687

Closed
kerneltime opened this issue Nov 2, 2016 · 4 comments
Closed

Tenancy: Add access to datastore does not add access. #687

kerneltime opened this issue Nov 2, 2016 · 4 comments

Comments

@kerneltime
Copy link
Contributor

kerneltime commented Nov 2, 2016

I had a tenant to whom I tried to give access to the datastores and it failed.

[root@localhost:~]  /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant ls
Uuid                                  Name     Description  Default_datastore  VM_list                      
------------------------------------  -------  -----------  -----------------  ---------------------------  
dc17b3b1-1f4d-4f8b-a6f4-3dba064ba88f  tenant1               default_ds         photon.vsan.1,photon.vsan.2  
5afa4767-ecd8-489e-9d97-5c46ae50d3fc  DevAppX               default_ds         ubuntu                       

[root@localhost:~]  /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant access add --name tenant1 --datastore datastore1 --rights all
{'mount_volume': 1, 'global_visibility': 0, 'max_volume_size': 0, 'create_volume': 1, 'delete_volume': 1, 'datastore': 'datastore1', 'usage_quota': 0}
tenant access add succeeded
[root@localhost:~] ls /vmfs/volumes/
57302fae-961b9cf9-2e49-000c29acb565/     57303269-7342b974-b24a-000c29acb565/     bd5a4479-14fea494-d916-6fbe178010ee/     vsan:5201dd577fe793bd-112186a6c2b42e0c/
57303269-4d223a2e-d657-000c29acb565/     b78f9f70-08216aea-97af-6952c751dfe2/     datastore1/                              vsanDatastore/
[root@localhost:~] ls /vmfs/volumes/
[root@localhost:~]  /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant access add --name tenant1 --datastore vsanDatastore --rights all
{'mount_volume': 1, 'global_visibility': 0, 'max_volume_size': 0, 'create_volume': 1, 'delete_volume': 1, 'datastore': 'vsanDatastore', 'usage_quota': 0}
tenant access add succeeded
[root@localhost:~]  /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant ls
Uuid                                  Name     Description  Default_datastore  VM_list                      
------------------------------------  -------  -----------  -----------------  ---------------------------  
dc17b3b1-1f4d-4f8b-a6f4-3dba064ba88f  tenant1               default_ds         photon.vsan.1,photon.vsan.2  
5afa4767-ecd8-489e-9d97-5c46ae50d3fc  DevAppX               default_ds         ubuntu  

On the VM I continue to get errors

root@photon-VYb05tsNa [ ~ ]# docker volume ls
list vmdk: VolumeDriver.List: No mount privilege
DRIVER              VOLUME NAME
@lipingxue
Copy link
Contributor

You need to add access privileges on datastore where the vm lives.

@kerneltime
Copy link
Contributor Author

Also, on the VM I am getting errors that were not present before

root@photon-VYb05tsNa [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
root@photon-VYb05tsNa [ ~ ]# docker volume create --driver=vmdk --name=storage2 -o size=10gb
Error response from daemon: create storage2: VolumeDriver.Create: Server returned an error: KeyError(u'gb',)
root@photon-VYb05tsNa [ ~ ]# docker volume create --driver=vmdk --name=storage2             
Error response from daemon: create storage2: VolumeDriver.Create: Server returned an error: KeyError('mb',)

@kerneltime
Copy link
Contributor Author

[root@localhost:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant access ls --name tenant1
Datastore      Create_volume  Delete_volume  Mount_volume  Max_volume_size  Total_size  
-------------  -------------  -------------  ------------  ---------------  ----------  
datastore1     1              1              1             0B               0B          
vsanDatastore  1              1              1             0B               0B          

[root@localhost:~] 

@kerneltime
Copy link
Contributor Author

Is there supposed to be a validation for a datastore to be present? And is the datastore case sensitive?

[root@localhost:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant access add --name tenant1 --datastore vsandatastore --rights all
{'mount_volume': 1, 'global_visibility': 0, 'max_volume_size': 0, 'create_volume': 1, 'delete_volume': 1, 'datastore': 'vsandatastore', 'usage_quota': 0}
tenant access add succeeded
[root@localhost:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant access ls --name tenant1
Datastore      Create_volume  Delete_volume  Mount_volume  Max_volume_size  Total_size  
-------------  -------------  -------------  ------------  ---------------  ----------  
datastore1     1              1              1             0B               0B          
vsanDatastore  1              1              1             0B               0B          
vsandatastore  1              1              1             0B               0B    

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

No branches or pull requests

2 participants