4

I've got a cluster with 84 Openstack Essex compute nodes, one of which decided to pine for the fjords about 2 hours ago, with 8 running instances on it.

The instances are all running off qcow2 disks on an NFS share, so the disk images are still available.

nova live-migration only seems capable of migrating a running instance from one functioning node to another.

What I want is to 'migrate' the dead instances from the dead compute node to any of the live compute nodes. The fact that the instances will be rebooted (and will have to fsck on boot) doesn't really matter - it's better than losing them completely.

Before I start acting on thoughts about messing with virsh and hacking nova's mysql database directly, does anyone know of any tool or documented procedure for this kind of 'dead-migration'?

user9517
  • 114,104
  • 20
  • 206
  • 289
cas
  • 6,653
  • 31
  • 34
  • Craig this is very interesting topic, I'm looking forward to the answer. I suggest you to forward it to Openstack dev mailing list. – so_user Aug 08 '12 at 19:46

4 Answers4

4

It is old question, but yes you can with nova evacuate command. Example to move vm_name to nova_compute1 node:

nova evacuate vm_name nova_compute1 
nova reboot --hard vm_name

Instance will be booted on new node.

Alen Komljen
  • 156
  • 3
2

I never done this. I hope this reference help you to recover the instances.

http://docs.openstack.org/essex/openstack-compute/admin/content/nova-disaster-recovery-process.html

  • Thanks, but i've seen that. It's not really related to what I needed to do. One of my colleagues ended up editing the nova mysql instances table directly and some manual stuffing around with virsh define, virsh nwdefine, and virst start on the target node. The sort of thing that really should be automated. – cas Aug 05 '12 at 09:57
  • The link appears to be dead. – killjoy Sep 18 '19 at 14:52
0

In newer openstack client you can use:

openstack server evacuate $SERVER_ID
-1

Openstack instance migration has successful only after following steps.

both host machines need to connect ssh without password for user nova.

For that we need to create a key pair with ssh-keygen after running command su nova

# usermod -s /bin/bash nova
# su nova
# ssh-keygen

key pair will generate in /var/lib/nova/.ssh

#cat <pub_key> >> /var/lib/nova/.ssh/authorized_keys
#echo 'StrictHostKeyChecking no' >> /var/lib/nova/.ssh/config

Do the above steps to the second host.

copy the public key(id_rsa.pub) from the first host to second host and add to authorized keys by running the following command

#cat <pub_key> >> /var/lib/nova/.ssh/authorized_keys

copy the public key(id_rsa.pub) from the Second host to first host and add to authorized keys The authorized keys file in /var/lib/nova/.ssh/ should contain public key from both host. then

# su nova
# ssh nova@otherhost should connect without password.

Then Openstack migration will work.

Abhijeet Kasurde
  • 985
  • 9
  • 20