diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2011-01-20 15:47:08 -0600 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2011-01-20 15:47:08 -0600 |
| commit | 9b993d50835c79d23dca422335de362ebaf7f4fa (patch) | |
| tree | 19ed51f43372e998c31a2fcc5a5bccf0578bd6dc | |
| parent | 089bdfa8c2f0f116b55c69bbcde6fca6632cb145 (diff) | |
| download | nova-9b993d50835c79d23dca422335de362ebaf7f4fa.tar.gz nova-9b993d50835c79d23dca422335de362ebaf7f4fa.tar.xz nova-9b993d50835c79d23dca422335de362ebaf7f4fa.zip | |
added plugin call for resetnetworking
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 3 | ||||
| -rwxr-xr-x | plugins/xenserver/xenapi/etc/xapi.d/plugins/agent | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 882b9d9d6..7f9e78df5 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -358,7 +358,8 @@ class VMOps(object): def reset_networking(self, instance): vm = self._get_vm_opaque_ref(instance) - self.write_to_xenstore(vm, "resetnetwork", "") + args = {'id': str(uuid.uuid4())} + resp = self._make_agent_call('resetnetwork', vm, '', args) def write_network_config_to_xenstore(self, instance): vm = self._get_vm_opaque_ref(instance) diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent b/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent index 12c3a19c8..5c5ec7c45 100755 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent @@ -91,6 +91,18 @@ def password(self, arg_dict): return resp +@jsonify +def resetnetwork(self, arg_dict): + """ + writes a resquest to xenstore that tells the agent to reset the networking + + """ + arg_dict['value'] = json.dumps({'name': 'resetnetwork', 'value': ''}) + request_id = arg_dict['id'] + arg_dict['path'] = "data/host/%s" % request_id + xenstore.write_record(self, arg_dict) + + def _wait_for_agent(self, request_id, arg_dict): """Periodically checks xenstore for a response from the agent. The request is always written to 'data/host/{id}', and |
