Older Windows agents are very picky about the data sent to it. It also requires the public key for the password exchange to be in a string format and not an integer.

Also, because of the length of time it takes Windows to boot fully (including a full reboot), the reset network command gets lost. Move this to after we've made sure the agent is up and running successfully.
This commit is contained in:
Johannes Erdfelt 2011-07-20 21:07:09 +00:00 committed by Tarmac
commit d86af556f4
2 changed files with 4 additions and 4 deletions

View File

@ -340,6 +340,7 @@ class VMOps(object):
_check_agent_version()
_inject_files()
_set_admin_password()
self.reset_network(instance, vm_ref)
return True
except Exception, exc:
LOG.warn(exc)
@ -349,9 +350,6 @@ class VMOps(object):
timer.f = _wait_for_boot
# call to reset network to configure network from xenstore
self.reset_network(instance, vm_ref)
return timer.start(interval=0.5, now=True)
def _handle_spawn_error(self, vdis, spawn_error):

View File

@ -72,7 +72,9 @@ def key_init(self, arg_dict):
info to be passed, such as passwords. Returns the shared
secret key value.
"""
pub = int(arg_dict["pub"])
# WARNING: Some older Windows agents will crash if the public key isn't
# a string
pub = arg_dict["pub"]
arg_dict["value"] = json.dumps({"name": "keyinit", "value": pub})
request_id = arg_dict["id"]
arg_dict["path"] = "data/host/%s" % request_id