Ask Your Question
0

how can I boot a snapshot with same network interfaces as the original virtual machine?

asked 2015-10-22 14:22:00 -0500

Is there a way where I can nova boot a snapshot and assign an ip?

For instance I have a virtual machine running, i have taken a snapshot of it and the Openstack infrastructure fails, when the infrastructure is up again, I want to relaunch the snapshot with the same internet protocol address as the original virtual machine.

I can see a way for fixed addresses, but for floating ip how could I do it?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-10-23 23:42:32 -0500

One possibility, assuming that the failure doesn't destroy the neutron database:

  • Create a port neutron port-create
  • Assign it a floating IP neutron floatingip-associate ipaddr portid
  • Boot your instance with this port nova boot ... --nic port-id=....
  • After failure, boot an instance from the snapshot, using the same port

Or you bulk-create floating IPs, providing the range, then associate the correct IP to the instance after you booted it:

  • nova floating-ip-bulk-create <range>
  • nova floating-ip-associate <server> <ip from that range>

I doubt there is a guarantee that you will actually get the range you request, so the former approach is probably more robust.

edit flag offensive delete link more

Comments

This is a way relying on floating internet protocol addresses. I felt a need to restore the virtual machines in a way where the new ones would have the same fixed internet addresses as the old ones.

tbodine gravatar imagetbodine ( 2015-10-26 07:59:24 -0500 )edit

Perhaps I misunderstand you, but you asked "I can see a way for fixed addresses, but for floating ip how could I do it?", so I gave you a recipe for setting floating the same IPs as originally. Glad you found the fixed-ip option in the second answer.

Bernd Bausch gravatar imageBernd Bausch ( 2015-10-26 08:29:09 -0500 )edit
0

answered 2015-10-26 08:05:21 -0500

updated 2015-10-26 08:06:02 -0500

  1. While the system is up a. generate a table of virtual machines, internet protocol addresses, flavors and security groups b. take a snapshot of each virtual machine.

    1. At Recovery time for each virtual machine in the table

Nova boot -flavor {flavor} -image {vmsnapshot} -security-groups {secgroups} -nic net-id={net-id},v4-fixed-ip={ip} vmname

restart services on virtual machine

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2015-10-22 14:22:00 -0500

Seen: 454 times

Last updated: Oct 26 '15