-
Notifications
You must be signed in to change notification settings - Fork 95
[Cross ESX] 'Attached to vm' field is not populated even though volume is attached to a container. #1053
Comments
The reason attached to VM field is not populated is because the VM uuid is stored in volume metadata while a volume is mounted to a VM. If the docker volume inspect is done from a VM that resides on a different ESX as compared to the ESX on which the VM which mounted the volume resides on; we can't find the name of VM using uuid( because the later ESX isn't aware about the VM on other ESX). |
I agree with proposed approach to store VM name in KV. In fact I recommend same for admin ls command to store vm name in addition to UUID in database. Optionally you can postfix VM Name with * indicating VM using volume is running on another host. VM getting renamed and inspect or admin ls returning is really really corner case. Also later with Hostd Notification, this problem will be solved anyway. In summary, go ahead with your fix. CC /@govint |
Agreed. |
1. Persisting vm name along with uuid in KV when a volume is attached to a VM 2. If vm name cannot be retrieved using uuid (VM might reside on another host) then use the vm name persisted in KV. Using this in both for admincli and plugin requests Fixes #1053
* Persisting VM name in KV while attaching volume 1. Persisting vm name along with uuid in KV when a volume is attached to a VM 2. If vm name cannot be retrieved using uuid (VM might reside on another host) then use the vm name persisted in KV. Using this in both for admincli and plugin requests Fixes #1053 * Handling VM names for in volume metadata for volumes created without persisting VM name in metadata * Populating attached VM with uuid in case vm name cannot be retrieved on host and is not persisted in KV store
Test Steps:
docker volume inspect
from vm-1docker volume inspect
from vm-2. "Attached-to-vm" field is not present.Admin cli volume ls
from both the ESXs does show the "Attached-to" field correctly.Setup and command output detail is as follows:
Setup : 2 ESXs (E1 & E2 having 2 shared datastores (shared vmfs))
Admin cli volume ls from ESX-1:
Admin cli volume ls from ESX-2:
Docker volume inspect from VM-2:
Docker volume inspect from the vm from where container was started - VM-1
Admin cli volume ls from ESX-1:
Admin cli volume ls from ESX-2:
The text was updated successfully, but these errors were encountered: