-
Notifications
You must be signed in to change notification settings - Fork 95
Not able to create vsphere docker volume (using short volume names) after renaming datastore; running into "IndexError('list index out of range',)" #818
Comments
The datastore for the volume ops is obtained from the VM group info in vsi. And that doesn't change when path names change. For example group info If the folder "2" is now changed to "2.tmp" the VM data doesn't. mv 2 2.tmp 2-28419cf8.hlog 2.vmdk 2_1-d286f072022a0891.vmfd stats-1 vmware-37.log vmware-42.log But VM data remains as before Which is why the datastore name doesn't change on the next create after a name change. While admin CLI enumerates datastores on the host. |
One fix for this may be to not use VMM groupInfo to get the datastore and instead use the "datastoreUrl" in the VM config got via VIM api. |
Verified this has been fixed in top of the master branch. Please see the following detail:
|
I am still able to reproduce this issue on the latest plugin/driver.
Error message from docker host
|
Nirdesh and I talked. My test is slightly different with Nirdesh's test. He ran the test with only _DEFAULT tenant exist and we can reproduce it with the top of master. It looks like something related with _DEFAULT tenant handling. |
I checked the log, and this is the root cause. For _DEFAULT tenant, when volume create using the short name (without @datastore), the datastore which VM lives will be used as default_datastore. In this function, we call vmdk_utils.get_datastores() to get all datastores and check if any datastore name match the datastore name we get from config_path. The logic in "vmdk_utils.get_datastores" has some issue since it will use the cached value instead of pulling the information again. This will have some issues when user change the datastore name. |
…et_datastore_name_from_config_path". Rename function "get_datastore_name" to "get_datastore_name_from_config_path" and change the logic to refresh datastore cache when a datastore which matchs the datastore name extracted from config_path. Force to refresh datastore cache in function "get_datastore_name_from_config_path".
I discussed with Mark offline. The fix I did in #959 is not the best one since it refresh datastore cache in each operation. step2: We checked the trace of this exception, and find that it caused by function "get_datastore_url" during the operation authorize call. After analyze the code, we found that function "get_datastore_url" is not needed during operation authorize call, and we can remove it by refactoring related code. |
This issue has been fixed. |
Short volume name reference: https://github.com/vmware/docker-volume-vsphere/blob/master/docs/misc/VolumeNames.md#short-volume-names
Steps to reproduce:
Expectation: volume creation should not complain if underlying datastore got renamed
from ESX logs:
The text was updated successfully, but these errors were encountered: