Migrate Instances
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.
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.
Selected automatically on what basis?
It's the Nova scheduler that decides which host to use. Same decision when you launch a new instance.
Yeah but you see that doesn't answer my question about the confirmation part?
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.