Skip to content

Virtual Machine migration from one project to another

These instructions help in facilitating migration of a virtual machine from one project to another within OpenStack environment.

Preparing of VM

Your virtual machine needs to be in Shut Down state before we start snapshotting the machine, so that there isn't a state change on the machine during the process.

You can shut down the VM through the web interface.

Create a snapshot of the VM

Via CLI

  • List the servers in your current project
    openstack server list
    
  • Create a snapshot
    openstack server image create myInstance --name myInstanceSnapshot
    
  • Check if the snapshot is in the list of images and in active status.
    openstack image list
    

Via Web Interface

Follow the instructions here

Download the snapshot

Copy the ID of snapshot you just took and use it below in place of myInstanceSnapshotID

openstack image save --file snapshot.raw myInstanceSnapshotID

Import snapshot into the new project

Via CLI

  • Source openrc file for the new project
  • Import snapshot
     openstack image create myInstanceSnapshot --disk-format qcow2 --container-format bare --private --file <snapshot-file>
    

Via Web interface

Follow the instructions here

Create a new instance from the snapshot

Via CLI

Launch an instance

openstack server create --flavor m1.medium --image myInstanceSnapshot --network dmznet myNewInstance

Via Web Interface

Follow the instructions here