Ask Your Question

Migrate Instances

asked 2017-03-29 03:44:11 -0600

ShubhamMeshram gravatar image

updated 2017-03-29 03:46:24 -0600

I want to migrate* instances from one node to other. There are two ways to migrate :

i) I use the horizon dashboard to right click on the instance options and migrate and choose to target host.

ii) I can use the command line to do the same by typing the command : nova migrate <instance-id>

Both the ways require me to confirm the migration by clicking on the confirm/resize button manually in the dashboard. Is there a way to automate this? Like from the command line itself I want to be able to give confirmation too and then the migration happens.

Also, the second way doesn't let me specify the target host and in my setup its obvious it'll migrate the host other than where its residing currently. But what if I have more than 2 hosts?

I tried the command : openstack server migrate test-VM-1 --live controller.localdomain where test-VM-1 is my VM name and controller.localdomain is the name of the target host. which processes for a while and does nothing. there is no output of the command nor is there migration happening.

I am having a Packstack setup on CentOS 7 with two nodes namely, controller node and compute node.

*I dont mean Live migrate. I am referring to just migrate the instances.

edit retag flag offensive close merge delete


Perhaps the --poll option of the CLI command helps, or openstack server migrate --wait.

According to the API documentation, the destination host is selected automatically.

Bernd Bausch gravatar imageBernd Bausch ( 2017-03-29 08:20:35 -0600 )edit

Selected automatically on what basis?

ShubhamMeshram gravatar imageShubhamMeshram ( 2017-03-29 12:18:08 -0600 )edit

It's the Nova scheduler that decides which host to use. Same decision when you launch a new instance.

Bernd Bausch gravatar imageBernd Bausch ( 2017-03-29 13:15:09 -0600 )edit

Yeah but you see that doesn't answer my question about the confirmation part?

ShubhamMeshram gravatar imageShubhamMeshram ( 2017-03-30 00:05:26 -0600 )edit

That's why I write comments, not an answer. But I think you can use the --poll or --wait options. When the migration command returns, you can then issue the confirm command.

Bernd Bausch gravatar imageBernd Bausch ( 2017-03-30 00:35:04 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-08-04 19:07:46 -0600

schof gravatar image

"nova migrate" does not allow you to choose a destination, as you discovered. The destination is picked by nova-scheduler.

"nova live-migration" does allow you to optionally specify a destination. There is no confirmation step.

Live migration is not a 100% survivable process for an instance -- you'll probably need some logic to poll and wait until the migration is complete, and then verify that the instance is functional on the new hypervisor.

I don't understand your comment about "I don't mean live migrate."

migrate" will work on stopped instances, and "live-migration" will work only on running instances. Both migrate instances, so I'm still a little confused about the last line in your question.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-03-29 03:44:11 -0600

Seen: 2,083 times

Last updated: Mar 29 '17