Reason:
Stopping a running container to do a migration is inconvenient.
Description:
I'm sure there's a cleaner way to do this in Ruby (I'm more of a Python coder),
but here's my patch for app/models/virtual_server.rb to handle online
migrations if a container is running.
--- virtual_server.rb.trunk 2012-02-24 22:50:51.146769657 +0300
+++ virtual_server.rb 2012-02-24 22:51:04.194766238 +0300
@@ -1,5 +1,10 @@
def migrate(target_hardware_server)
- hardware_server.rpc_client.exec('vzmigrate',
"#{shellescape(target_hardware_server.host)} #{shellescape(identity.to_s)}")
+ if self.state == 'running'
+ online = "--online"
+ else
+ online = ""
+ end
+ hardware_server.rpc_client.exec('vzmigrate', "#{online}
#{target_hardware_server.host} #{identity}")
target_hardware_server.sync_virtual_servers
destroy
end
Original issue reported on code.google.com by rie...@squishypuppy.com on 24 Feb 2012 at 7:53
Original issue reported on code.google.com by
rie...@squishypuppy.com
on 24 Feb 2012 at 7:53