Displaying 4 results from an estimated 4 matches for "update_domain_state".
2009 Aug 10
0
[PATCH server] Fixed db-omatic so it doesn't die due to unhandled exceptions related to saving db objects in update_host_state and update_domain_state.
...= state
- vm.save!
+
+ begin
+ vm.save!
+ rescue
+ @logger.error "Optimistic locking failed; tried updating a stale row for VM #{vm.description}"
+ @logger.error "For now, workaround is retrying."
+ return update_domain_state(domain, state_override)
+ end
domain[:synced] = true
end
@@ -234,7 +243,13 @@ class DbOmatic < Qpid::Qmf::Console
#db_host.lock_version = 2
# XXX: This would just be for init..
#db_host.is_disabled = 0
- db_host.save!
+...
2009 Aug 10
1
[PATCH server] Fixed db-omatic so it doesn't die due to an unhandled ActiveRecord::StaleObjectError exception.
...vm.state = state
- vm.save!
+
+ begin
+ vm.save!
+ rescue ActiveRecord::StaleObjectError => e
+ @logger.error "Optimistic locking failed for VM #{vm.description}, retrying."
+ @logger.error e.backtrace
+ return update_domain_state(domain, state_override)
+ end
domain[:synced] = true
end
@@ -234,7 +243,14 @@ class DbOmatic < Qpid::Qmf::Console
#db_host.lock_version = 2
# XXX: This would just be for init..
#db_host.is_disabled = 0
- db_host.save!
+...
2009 Jun 25
2
[PATCH] Fix dbomatic state changes.
...; Qpid::Qmf::Console
end
end
+ def set_vm_stopped(db_vm)
+ db_vm.host_id = nil
+ db_vm.memory_used = nil
+ db_vm.num_vcpus_used = nil
+ db_vm.needs_restart = nil
+ db_vm.vnc_port = nil
+ db_vm.state = Vm::STATE_STOPPED
+ end
+
def update_domain_state(domain, state_override = nil)
vm = Vm.find(:first, :conditions => [ "uuid = ?", domain['uuid'] ])
if vm == nil
@@ -190,12 +199,7 @@ class DbOmatic < Qpid::Qmf::Console
result = qmf_vm.undefine
if result.status == 0...
2009 Jun 29
0
[PATCH server] Add svc_vm_actions method to VmService.
...; Qpid::Qmf::Console
end
end
+ def set_vm_stopped(db_vm)
+ db_vm.host_id = nil
+ db_vm.memory_used = nil
+ db_vm.num_vcpus_used = nil
+ db_vm.needs_restart = nil
+ db_vm.vnc_port = nil
+ db_vm.state = Vm::STATE_STOPPED
+ end
+
def update_domain_state(domain, state_override = nil)
vm = Vm.find(:first, :conditions => [ "uuid = ?", domain['uuid'] ])
if vm == nil
@@ -190,12 +199,7 @@ class DbOmatic < Qpid::Qmf::Console
result = qmf_vm.undefine
if result.status == 0...