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

Force to refresh datastore cache for listVMDK. #971

Merged
merged 1 commit into from
Feb 26, 2017

Conversation

lipingxue
Copy link
Contributor

This is the first step for the fix of #818.
In this change, we force to refresh datastore cache for listVMDK, which provides a workaround for #818.

@lipingxue
Copy link
Contributor Author

This is the test to verify this fix.
Step1: run "docker volume ls" to list volumes

root@photon-eZ5ILvREQ [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
vmdk                vol1@new-datastore1
vmdk                vol2@new-datastore1
vmdk                vol3@new-datastore1
vmdk                vol4@new-datastore1
vmdk                vol5@new-datastore1
vmdk                vol6@new-datastore1
vmdk                vol7@new-datastore1

Step2: change the datastore name from "new-datastore1" to "datastore1"

Step3: try to create a new volume, which failed

root@photon-eZ5ILvREQ [ ~ ]# docker volume create --driver=vmdk --name=vol8
Error response from daemon: create vol8: VolumeDriver.Create: Server returned an error: IndexError('list index out of range',)

Step4: run "docker volume ls", which list the volume with new datastore name(correct)

root@photon-eZ5ILvREQ [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
vmdk                vol1@datastore1
vmdk                vol2@datastore1
vmdk                vol3@datastore1
vmdk                vol4@datastore1
vmdk                vol5@datastore1
vmdk                vol6@datastore1
vmdk                vol7@datastore1

Step5: try to create a new volume, which succeeded

root@photon-eZ5ILvREQ [ ~ ]# docker volume create --driver=vmdk --name=vol8
vol8
root@photon-eZ5ILvREQ [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
vmdk                vol1@datastore1
vmdk                vol2@datastore1
vmdk                vol3@datastore1
vmdk                vol4@datastore1
vmdk                vol5@datastore1
vmdk                vol6@datastore1
vmdk                vol7@datastore1
vmdk                vol8@datastore1

@lipingxue
Copy link
Contributor Author

Please review this change @msterin @shaominchen

Copy link
Contributor

@shaominchen shaominchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@lipingxue lipingxue merged commit 8e29514 into master Feb 26, 2017
@lipingxue lipingxue deleted the fix_listVMDK_after_ds_change.liping branch February 26, 2017 18:11
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants