Migrate Instances

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

ShubhamMeshram gravatar image

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

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 -0500 )edit

Selected automatically on what basis?

ShubhamMeshram gravatar imageShubhamMeshram ( 2017-03-29 12:18:08 -0500 )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 -0500 )edit

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

ShubhamMeshram gravatar imageShubhamMeshram ( 2017-03-30 00:05:26 -0500 )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 -0500 )edit