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

vmdkops_admin output is not consistent when more than 2 ESX are present and accessing shared datastore (attached-to-vm field is inconsistent) #934

Closed
shuklanirdesh82 opened this issue Feb 18, 2017 · 2 comments
Assignees
Labels

Comments

@shuklanirdesh82
Copy link
Contributor

vmdkops_admin output is not consistent when more than 2 ESX are present and accessing shared datastore e.g. vsan, shared vmfs etc (attached-to-vm field is inconsistent)

Test bed scenario: 2 ESX having shared datastore (vsan/shared vmfs). One docker host per ESX created on the the shared datastore (let's say vm1 & vm2)

Note: both VMs are part of _DEFAULT tenant

Steps to reproduce

  1. create volume from vm1 & vm2 on shared datastore
VM1: docker volume create --driver=vmdk --name=vol_231_vsan
VM2: docker volume create --driver=vmdk --name=vol_99_vsan
  1. make sure both volumes are accessible from either VMs (docker volume ls from both VMs)
  2. attach container from one of the VM
VM1: docker run --rm -it -v vol_231_vsan@vsanDatastore:/mnt/myvol2 --name cnt_2311 busybox
  1. invoke docker inspect from another VM and make sure it says volume is attached
root@photon-TX4FfW2ET [ ~ ]# docker volume inspect vol_231_vsan@vsanDatastore
[
    {
        "Name": "vol_231_vsan@vsanDatastore",
        "Driver": "vmdk",
        "Mountpoint": "/mnt/vmdk/vol_231_vsan@vsanDatastore",
        "Status": {
            "access": "read-write",
            "attach-as": "independent_persistent",
            "capacity": {
                "allocated": "80MB",
                "size": "100MB"
            },
            "clone-from": "None",
            "created": "Sat Feb 18 06:16:43 2017",
            "created by VM": "VM84_vsan",
            "datastore": "vsanDatastore",
            "diskformat": "thin",
            "fstype": "ext4",
            "status": "attached"
        },
        "Labels": {},
        "Scope": "global"
    }
]
  1. On ESX side invoke vmdkops_admin
ESX1:

[root@sc-rdops-vm17-dhcp-0-84:/vmfs/volumes] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume          Datastore      Created By VM  Created                   Attached To VM  Policy          Capacity  Used     Disk Format  Filesystem Type  Access      Attach As               
--------------  -------------  -------------  ------------------------  --------------  --------------  --------  -------  -----------  ---------------  ----------  ----------------------   
vol_231_vsan    vsanDatastore  VM84_vsan      Sat Feb 18 06:16:43 2017  VM84_vsan       [VSAN default]  100.00MB  80.00MB  thin         ext4             read-write  independent_persistent  
vol_99_vsan     vsanDatastore  VM100_vsan     Sat Feb 18 06:20:54 2017  detached        [VSAN default]  100.00MB  80.00MB  thin         ext4             read-write  independent_persistent 

ESX2:

[root@sc-rdops-vm17-dhcp-15-100:/vmfs/volumes] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume          Datastore      Created By VM  Created                   Attached To VM  Policy          Capacity  Used     Disk Format  Filesystem Type  Access      Attach As               
--------------  -------------  -------------  ------------------------  --------------  --------------  --------  -------  -----------  ---------------  ----------  ----------------------  
vol_231_vsan    vsanDatastore  VM84_vsan      Sat Feb 18 06:16:43 2017  detached        [VSAN default]  100.00MB  80.00MB  thin         ext4             read-write  independent_persistent  
vol_99_vsan     vsanDatastore  VM100_vsan     Sat Feb 18 06:20:54 2017  detached        [VSAN default]  100.00MB  80.00MB  thin         ext4             read-write  independent_persistent  

Expected outcome: admin ls outcome should be consistent from both ESX hosts.

@shuklanirdesh82 shuklanirdesh82 added this to the 0.13 milestone Feb 18, 2017
@govint
Copy link
Contributor

govint commented Feb 20, 2017

Issue is on the second ESX host, the VM UUID isn't known and hence printing as detached. Instead if the VM UUID isn't known then should instead pring the UUID itself. At least that way user has a way to know the volume is in use. We could consider including the host name/IP but if the VM moves then that data would be incorrect.

Multi-node scenarios don't play well with VM names presently. The ESX service isn't cluster aware for now so VM UUIDs will not resolve to a name on any host except the one where the VM is running.

@govint
Copy link
Contributor

govint commented Feb 21, 2017

Fixed via #939

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

No branches or pull requests

2 participants