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

VMDK migration #636

Closed
sosher opened this issue Oct 20, 2016 · 6 comments
Closed

VMDK migration #636

sosher opened this issue Oct 20, 2016 · 6 comments

Comments

@sosher
Copy link

sosher commented Oct 20, 2016

Hi
How can you migrate a volume/vmdk from one datastore to another ?
what will be the steps needed ?
Scenarios include

  • backup restore,
  • moving volume/vmdk from one host to anohter
  • moving from datastore to anohter

Thanks.

@kerneltime
Copy link
Contributor

kerneltime commented Oct 26, 2016

These are good questions that are on our radar. @sosher we will be publishing documentation in the coming weeks for the cross compatibility with existing workflows around datastores.

@msterin
Copy link
Contributor

msterin commented Oct 26, 2016

@kernetime is correct, stand by for the docs.
As a quick summary though:

  • backup/restore is supported via creating a Docker volume with -o attach-as=persistent. Unfortunately Docker volume command does not allow to change properties for existing volumes, so it can be changed only with ESX side vmdkops_admi.py. The (attached) volume then can be backed up with any existing backup tool.
  • moving between hosts is automatic on volume usage as long as datastore is shared between hosts
  • moving between datastores - for offline volumes it can be accomplished with simple copy, for online we do need to document it , it's a little tricky today

@ashahi1
Copy link
Contributor

ashahi1 commented Jul 31, 2017

Steps performed:

  1. Create a volume named - Volume11
root@photon-machine [ ~ ]# docker volume create -d vsphere:latest --name Volume11 -o attach-as=persistent
Volume11
root@photon-machine [ ~ ]#
  1. Docker volume ls and docker volume inspect
root@photon-machine [ ~ ]# docker volume ls
DRIVER              VOLUME NAME
vsphere:latest      Volume11@sharedVmfs-0
root@photon-machine [ ~ ]#
root@photon-machine [ ~ ]# docker volume inspect Volume11
[
    {
        "Driver": "vsphere:latest",
        "Labels": {},
        "Mountpoint": "/mnt/vmdk/Volume11",
        "Name": "Volume11",
        "Options": {
            "attach-as": "persistent"
        },
        "Scope": "global",
        "Status": {
            "access": "read-write",
            "attach-as": "persistent",
            "capacity": {
                "allocated": "13MB",
                "size": "100MB"
            },
            "clone-from": "None",
            "created": "Mon Jul 31 14:23:32 2017",
            "created by VM": "photon-VM2.3",
            "datastore": "sharedVmfs-0",
            "diskformat": "thin",
            "fstype": "ext4",
            "status": "detached"
        }
    }
]
root@photon-machine [ ~ ]#
  1. Ran a container with volume mounted and wrote data to it.
root@photon-machine [ ~ ]# docker run -it --volume-driver=vsphere:latest -v Volume11@sharedVmfs-0:/vol1 --name ub ubuntu
root@5c7fdb22d082:/#
root@5c7fdb22d082:/# echo "Hello">vol1/test
root@5c7fdb22d082:/# cat vol1/test
Hello
root@5c7fdb22d082:/#
  1. While container is running, took snapshot of the vm.
  2. After snapshot finished successfully, to see if the volume is part of the snapshot, checked the dockvols folder where the volume is located and see if there is a delta disk for the volume.
[root@sc-rdops-vm01-dhcp-20-85:/vmfs/volumes/59779d5c-1f1a28a6-4b34-02000231f630/dockvols/11111111-1111-1111-1111-111111111111] ls
Volume11-000001-b4bc1235cc332172.vmfd  Volume11-000001.vmdk                   Volume11-flat.vmdk
Volume11-000001-delta.vmdk             Volume11-bf722fb875090b87.vmfd         Volume11.vmdk
[root@sc-rdops-vm01-dhcp-20-85:/vmfs/volumes/59779d5c-1f1a28a6-4b34-02000231f630/dockvols/11111111-1111-1111-1111-111111111111]

@msterin
Copy link
Contributor

msterin commented Jul 31, 2017

@ashahi1 - So what's the conclusion ?

@ashahi1
Copy link
Contributor

ashahi1 commented Aug 1, 2017

@msterin Idea was to verify if persistent volume is part of the snaphot of the vm. After snapshot finished successfully, we have a delta disk for the volume in the dockvols folder, so we can conclude that volume is part of the vm snapshot.

@ashahi1
Copy link
Contributor

ashahi1 commented Aug 1, 2017

Closing this issue.

@ashahi1 ashahi1 closed this as completed Aug 1, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

7 participants