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

[test automation] VM migration tests #1013

Closed
ashahi1 opened this issue Mar 8, 2017 · 3 comments
Closed

[test automation] VM migration tests #1013

ashahi1 opened this issue Mar 8, 2017 · 3 comments
Assignees
Milestone

Comments

@ashahi1
Copy link
Contributor

ashahi1 commented Mar 8, 2017

Test - 1: vmotion a vm which is part of _DEFAULT tenant and verify docker CLI/Admin CLI commands for created volume

- Create a volume vol1 
- Do docker volume ls/inspect and admin cli ls to verify created_by_vm field on ESX-1 & ESX-2 too
- Migrate the vm to ESX-2
- Perform docker volume ls and admin cli ls (from ESX-2 & ESX-1 too)
- Attach the volume and run the container
- Do docker volume ls/inspect and admin cli ls to verify created_by_vm/attach-to field on ESX-2 & ESX-1 too
- Stop the container
- Migrate the vm back to ESX-1
- Perform docker volume ls/inspect and admin cli ls (from ESX-1 & ESX-2 too)
- Attach the volume and run the container
- Perform docker volume ls/inspect and admin cli ls (from ESX-1 & ESX-2 too) [verify created_by_vm/attach-to field]

Test - 2: vmotion a vm which is part of _DEFAULT tenant and volume was attached while performing vm migration; verify docker CLI/Admin CLI commands for created volume

- Create a volume vol1 
- Do docker volume ls/inspect and admin cli ls to verify created_by_vm field on ESX-1 & ESX-2 too
- Attach the volume and run the container
- Do docker volume inspect and admin cli ls to verify created_by_vm/attached-to field on ESX-1 & ESX-2 too
- Migrate the vm to ESX-2 (leave container as attached/running)
- Perform docker volume ls/inspect and admin cli ls (from ESX-1 & ESX-2) [verify created_by_vm/attach-to]
- Stop the container
- Perform docker volume ls/inspect and admin cli ls (from ESX-1 & ESX-2) [verify created_by_vm/attach-to]
- Migrate the vm back to ESX-1
- Perform docker volume ls and admin cli ls (from ESX-1 & ESX-2) [verify created_by_vm/attach-to]
@ashahi1
Copy link
Contributor Author

ashahi1 commented Mar 10, 2017

Test 1: vmotion a vm which is part of _DEFAULT tenant and verify docker CLI/Admin CLI commands for created volume.

Test Steps:

- Create a volume vol1 
- Do docker volume ls/inspect and admin cli ls to verify created_by_vm field on ESX-1 & ESX-2 too
- Migrate the vm to ESX-2
- Perform docker volume ls and admin cli ls (from ESX-2 & ESX-1 too)
- Attach the volume and run the container
- Do docker volume ls/inspect and admin cli ls to verify created_by_vm/attach-to field on ESX-2 & ESX-1 too
- Stop the container
- Migrate the vm back to ESX-1
- Perform docker volume ls/inspect and admin cli ls (from ESX-1 & ESX-2 too)
- Attach the volume and run the container
- Perform docker volume ls/inspect and admin cli ls (from ESX-1 & ESX-2 too) [verify created_by_vm/attach-to field]

Test finished successfully. Did not see any issues during any operation.


Steps and their corresponding output's are as follows:

  • Created a volume from VM-1
root@photon-xVmYMbyTn [ ~ ]# docker volume create --driver=vsphere --name=vol_1013 -o size=300mb -o attach-as=independent_persistent -o access=read-only -o diskformat=thin
vol_1013
root@photon-xVmYMbyTn [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
vsphere             vol_1013@vsanDatastore
root@photon-xVmYMbyTn [ ~ ]# docker volume inspect vol_1013@vsanDatastore
[
    {
        "Name": "vol_1013@vsanDatastore",
        "Driver": "vsphere",
        "Mountpoint": "/mnt/vmdk/vol_1013@vsanDatastore",
        "Status": {
            "access": "read-only",
            "attach-as": "independent_persistent",
            "capacity": {
                "allocated": "128MB",
                "size": "300MB"
            },
            "clone-from": "None",
            "created": "Fri Mar 10 20:39:41 2017",
            "created by VM": "photon-VM0.1",
            "datastore": "vsanDatastore",
            "diskformat": "thin",
            "fstype": "ext4",
            "status": "detached"
        },
        "Labels": {},
        "Scope": "global"
    }
]
root@photon-xVmYMbyTn [ ~ ]#

[root@sc-rdops-vm17-dhcp-28-249:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume    Datastore      Created By VM  Created              Attached To VM (n..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access     Attach As           
--------  -------------  -------------  -------------------  -------------------  --------------  --------  -----  -----------  ---------------  ---------  --------------------
vol_1013  vsanDatastore  photon-VM0.1   Fri Mar 10 20:39:..  detached             [VSAN default]  300MB     128MB  thin         ext4             read-only  independent_persis..

[root@sc-rdops-vm17-dhcp-28-249:~]

  • Migrated the vm to ESX-2 (vMotion)
From ESX-1: 
[root@sc-rdops-vm17-dhcp-28-249:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume    Datastore      Created By VM  Created              Attached To VM (n..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access     Attach As           
--------  -------------  -------------  -------------------  -------------------  --------------  --------  -----  -----------  ---------------  ---------  --------------------
vol_1013  vsanDatastore  photon-VM0.1   Fri Mar 10 20:39:..  detached             [VSAN default]  300MB     128MB  thin         ext4             read-only  independent_persis..

[root@sc-rdops-vm17-dhcp-28-249:~]

From ESX-2:

[root@sc-rdops-vm17-dhcp-30-189:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume    Datastore      Created By VM  Created                Attached To VM (nam..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access     Attach As             
--------  -------------  -------------  ---------------------  ---------------------  --------------  --------  -----  -----------  ---------------  ---------  ----------------------
vol_1013  vsanDatastore  photon-VM0.1   Fri Mar 10 20:39:41..  detached               [VSAN default]  300MB     128MB  thin         ext4             read-only  independent_persistent

[root@sc-rdops-vm17-dhcp-30-189:~]
  • Attached the volume and ran the container
root@photon-xVmYMbyTn [ ~ ]# docker run -it --volume-driver=vsphere -v vol_1013@vsanDatastore:/vol1 --name ub_1013 ubuntu
root@52b1e074ffe6:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var  vol1
root@52b1e074ffe6:/# df -h
Filesystem                                       Size  Used Avail Use% Mounted on
overlay                                          7.8G  610M  6.8G   9% /
tmpfs                                            2.0G     0  2.0G   0% /dev
tmpfs                                            2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:0:0  283M  2.1M  262M   1% /vol1
/dev/root                                        7.8G  610M  6.8G   9% /etc/hosts
shm                                               64M     0   64M   0% /dev/shm
root@52b1e074ffe6:/# echo "Hello from vm1 and ESX-2" > vol1/hellos
bash: vol1/hellos: Read-only file system
root@52b1e074ffe6:/#

  • Admin cli volume ls output from ESX-1 and ESX-2
From ESX-1:

[root@sc-rdops-vm17-dhcp-28-249:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume    Datastore      Created By VM  Created              Attached To VM (n..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access     Attach As           
--------  -------------  -------------  -------------------  -------------------  --------------  --------  -----  -----------  ---------------  ---------  --------------------
vol_1013  vsanDatastore  photon-VM0.1   Fri Mar 10 20:39:..  564d2415-1c6f-462..  [VSAN default]  300MB     128MB  thin         ext4             read-only  independent_persis..

[root@sc-rdops-vm17-dhcp-28-249:~]

From ESX-2:

[root@sc-rdops-vm17-dhcp-30-189:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume    Datastore      Created By VM  Created                Attached To VM (nam..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access     Attach As             
--------  -------------  -------------  ---------------------  ---------------------  --------------  --------  -----  -----------  ---------------  ---------  ----------------------
vol_1013  vsanDatastore  photon-VM0.1   Fri Mar 10 20:39:41..  photon-VM0.1           [VSAN default]  300MB     128MB  thin         ext4             read-only  independent_persistent

[root@sc-rdops-vm17-dhcp-30-189:~]

  • docker volume inspect output:
root@photon-xVmYMbyTn [ ~ ]# docker volume inspect vol_1013@vsanDatastore
[
    {
        "Name": "vol_1013@vsanDatastore",
        "Driver": "vsphere",
        "Mountpoint": "/mnt/vmdk/vol_1013@vsanDatastore",
        "Status": {
            "access": "read-only",
            "attach-as": "independent_persistent",
            "capacity": {
                "allocated": "128MB",
                "size": "300MB"
            },
            "clone-from": "None",
            "created": "Fri Mar 10 20:39:41 2017",
            "created by VM": "photon-VM0.1",
            "datastore": "vsanDatastore",
            "diskformat": "thin",
            "fstype": "ext4",
            "status": "attached"
        },
        "Labels": {},
        "Scope": "global"
    }
]
root@photon-xVmYMbyTn [ ~ ]#
  • Stopped the container and migrated the vm back to ESX-1

  • After migration finished, again ran the container from vm

root@photon-xVmYMbyTn [ ~ ]# docker run -it --volume-driver=vsphere -v vol_1013@vsanDatastore:/vol1 --name ub_1013_E1 ubuntu
root@37cab280960e:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var  vol1
root@37cab280960e:/# df -h
Filesystem                                       Size  Used Avail Use% Mounted on
overlay                                          7.8G  610M  6.8G   9% /
tmpfs                                            2.0G     0  2.0G   0% /dev
tmpfs                                            2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:0:0  283M  2.1M  262M   1% /vol1
/dev/root                                        7.8G  610M  6.8G   9% /etc/hosts
shm                                               64M     0   64M   0% /dev/shm
root@37cab280960e:/#
  • Admin cli volume ls from ESX-1 and ESX-2 after migration:
From ESX-1:

[root@sc-rdops-vm17-dhcp-28-249:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume    Datastore      Created By VM  Created              Attached To VM (n..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access     Attach As           
--------  -------------  -------------  -------------------  -------------------  --------------  --------  -----  -----------  ---------------  ---------  --------------------
vol_1013  vsanDatastore  photon-VM0.1   Fri Mar 10 20:39:..  photon-VM0.1         [VSAN default]  300MB     128MB  thin         ext4             read-only  independent_persis..

[root@sc-rdops-vm17-dhcp-28-249:~]

From ESX-2:

[root@sc-rdops-vm17-dhcp-30-189:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume    Datastore      Created By VM  Created                Attached To VM (nam..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access     Attach As               
--------  -------------  -------------  ---------------------  ---------------------  --------------  --------  -----  -----------  ---------------  ---------  ----------------------  
vol_1013  vsanDatastore  photon-VM0.1   Fri Mar 10 20:39:41..  564d2415-1c6f-462c-..  [VSAN default]  300MB     128MB  thin         ext4             read-only  independent_persistent  

[root@sc-rdops-vm17-dhcp-30-189:~]

@ashahi1
Copy link
Contributor Author

ashahi1 commented Mar 10, 2017

Test - 2: vmotion a vm which is part of _DEFAULT tenant and volume was attached while performing vm migration; verify docker CLI/Admin CLI commands for created volume

Test Steps:

- Create a volume vol1 
- Do docker volume ls/inspect and admin cli ls to verify created_by_vm field on ESX-1 & ESX-2 too
- Attach the volume and run the container
- Do docker volume inspect and admin cli ls to verify created_by_vm/attached-to field on ESX-1 & ESX-2 too
- Migrate the vm to ESX-2 (leave container as attached/running)
- Perform docker volume ls/inspect and admin cli ls (from ESX-1 & ESX-2) [verify created_by_vm/attach-to]
- Stop the container
- Perform docker volume ls/inspect and admin cli ls (from ESX-1 & ESX-2) [verify created_by_vm/attach-to]
- Migrate the vm back to ESX-1
- Perform docker volume ls and admin cli ls (from ESX-1 & ESX-2) [verify created_by_vm/attach-to]

Test finished successfully. Did not see any issues during any operation.


  • Steps and their corresponding output is as follows:
root@photon-xVmYMbyTn [ ~ ]# docker volume create --driver=vsphere --name=vol_1013_Test2 -o size=300mb -o attach-as=independent_persistent -o access=read-write -o diskformat=thin
vol_1013_Test2
root@photon-xVmYMbyTn [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
vsphere             vol_1013_Test2@vsanDatastore
root@photon-xVmYMbyTn [ ~ ]# docker volume inspect vol_1013_Test2@vsanDatastore
[
    {
        "Name": "vol_1013_Test2@vsanDatastore",
        "Driver": "vsphere",
        "Mountpoint": "/mnt/vmdk/vol_1013_Test2@vsanDatastore",
        "Status": {
            "access": "read-write",
            "attach-as": "independent_persistent",
            "capacity": {
                "allocated": "128MB",
                "size": "300MB"
            },
            "clone-from": "None",
            "created": "Fri Mar 10 22:06:13 2017",
            "created by VM": "photon-VM0.1",
            "datastore": "vsanDatastore",
            "diskformat": "thin",
            "fstype": "ext4",
            "status": "detached"
        },
        "Labels": {},
        "Scope": "global"
    }
]
root@photon-xVmYMbyTn [ ~ ]#

- From ESX-1: 

[root@sc-rdops-vm17-dhcp-28-249:~] /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_1013_Test2  vsanDatastore  photon-VM0.1   Fri Mar 10 22:0..  detached           [VSAN default]  300MB     128MB  thin         ext4             read-write  independent_per..

[root@sc-rdops-vm17-dhcp-28-249:~]

- From ESX-2:

[root@sc-rdops-vm17-dhcp-30-189:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume          Datastore      Created By VM  Created               Attached To VM (n..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access      Attach As           
--------------  -------------  -------------  --------------------  -------------------  --------------  --------  -----  -----------  ---------------  ----------  --------------------
vol_1013_Test2  vsanDatastore  photon-VM0.1   Fri Mar 10 22:06:1..  detached             [VSAN default]  300MB     128MB  thin         ext4             read-write  independent_persis..

[root@sc-rdops-vm17-dhcp-30-189:~]

  • Ran the container and migrated the vm to ESX-2 while container was still running.
  • After migration finished, admin cli volume ls output from ESX-1 and ESX-2 are as follows:
- From ESX-1:

[root@sc-rdops-vm17-dhcp-28-249:~] /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_1013_Test2  vsanDatastore  photon-VM0.1   Fri Mar 10 22:0..  564d2415-1c6f-4..  [VSAN default]  300MB     128MB  thin         ext4             read-write  independent_per..

[root@sc-rdops-vm17-dhcp-28-249:~]


- From ESX-2:

[root@sc-rdops-vm17-dhcp-30-189:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume          Datastore      Created By VM  Created               Attached To VM (n..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access      Attach As           
--------------  -------------  -------------  --------------------  -------------------  --------------  --------  -----  -----------  ---------------  ----------  --------------------
vol_1013_Test2  vsanDatastore  photon-VM0.1   Fri Mar 10 22:06:1..  photon-VM0.1         [VSAN default]  300MB     128MB  thin         ext4             read-write  independent_persis..

[root@sc-rdops-vm17-dhcp-30-189:~]

  • Stopped the container. Admin cli volume ls from ESX-1 and ESX-2 and docker volume ls outputs are follows:
- From ESX-1:

[root@sc-rdops-vm17-dhcp-28-249:~] /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_1013_Test2  vsanDatastore  photon-VM0.1   Fri Mar 10 22:0..  detached           [VSAN default]  300MB     128MB  thin         ext4             read-write  independent_per..

[root@sc-rdops-vm17-dhcp-28-249:~]

From ESX-2: 
[root@sc-rdops-vm17-dhcp-30-189:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume          Datastore      Created By VM  Created               Attached To VM (n..  Policy          Capacity  Used   Disk Format  Filesystem Type  Access      Attach As           
--------------  -------------  -------------  --------------------  -------------------  --------------  --------  -----  -----------  ---------------  ----------  --------------------
vol_1013_Test2  vsanDatastore  photon-VM0.1   Fri Mar 10 22:06:1..  detached             [VSAN default]  300MB     128MB  thin         ext4             read-write  independent_persis..

[root@sc-rdops-vm17-dhcp-30-189:~]


From VM: 

root@photon-xVmYMbyTn [ ~ ]# docker volume inspect vol_1013_Test2@vsanDatastore
[
    {
        "Name": "vol_1013_Test2@vsanDatastore",
        "Driver": "vsphere",
        "Mountpoint": "/mnt/vmdk/vol_1013_Test2@vsanDatastore",
        "Status": {
            "access": "read-write",
            "attach-as": "independent_persistent",
            "capacity": {
                "allocated": "128MB",
                "size": "300MB"
            },
            "clone-from": "None",
            "created": "Fri Mar 10 22:06:13 2017",
            "created by VM": "photon-VM0.1",
            "datastore": "vsanDatastore",
            "diskformat": "thin",
            "fstype": "ext4",
            "status": "detached"
        },
        "Labels": {},
        "Scope": "global"
    }
]
root@photon-xVmYMbyTn [ ~ ]#

@shuklanirdesh82 shuklanirdesh82 modified the milestones: v1 GA, 0.13 Mar 13, 2017
@ashahi1 ashahi1 closed this as completed Mar 13, 2017
@ashahi1
Copy link
Contributor Author

ashahi1 commented Mar 13, 2017

//CC @msterin Please reopen this issue if the above test steps and their output is not as per expected behavior or we still need to do any additional tests.

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

No branches or pull requests

3 participants