diff options
| author | Josh Kearney <josh@jk0.org> | 2011-03-02 15:42:21 -0600 |
|---|---|---|
| committer | Josh Kearney <josh@jk0.org> | 2011-03-02 15:42:21 -0600 |
| commit | 6d62f387e39b42821f8a8f6ca560dd47b3bb9c7e (patch) | |
| tree | 2bdbe77404c971d72ff0dd4aef286e8d0248b6bb /nova | |
| parent | bb7c1b8c63632c789ed0cd3785a22b7baa90fd83 (diff) | |
| download | nova-6d62f387e39b42821f8a8f6ca560dd47b3bb9c7e.tar.gz nova-6d62f387e39b42821f8a8f6ca560dd47b3bb9c7e.tar.xz nova-6d62f387e39b42821f8a8f6ca560dd47b3bb9c7e.zip | |
Inject IPv6 data into XenStore for instance
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index bc39aa140..094b41588 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -514,18 +514,30 @@ class VMOps(object): network_IPs = [ip for ip in IPs if ip.network_id == network.id] def ip_dict(ip): - return {'netmask': network['netmask'], - 'enabled': '1', - 'ip': ip.address} + return { + "ip": ip.address, + "netmask": network["netmask"], + "enabled": "1"} + + def ip6_dict(ip6): + return { + "ip": ip6.addressV6, + "netmask": ip6.netmaskV6, + "gateway": ip6.gatewayV6, + "enabled": "1"} mac_id = instance.mac_address.replace(':', '') location = 'vm-data/networking/%s' % mac_id - mapping = {'label': network['label'], - 'gateway': network['gateway'], - 'mac': instance.mac_address, - 'dns': [network['dns']], - 'ips': [ip_dict(ip) for ip in network_IPs]} + mapping = { + 'label': network['label'], + 'gateway': network['gateway'], + 'mac': instance.mac_address, + 'dns': [network['dns']], + 'ips': [ip_dict(ip) for ip in network_IPs], + 'ip6s': [ip6_dict(ip) for ip in network_IPs]} + self.write_to_param_xenstore(vm_opaque_ref, {location: mapping}) + try: self.write_to_xenstore(vm_opaque_ref, location, mapping['location']) |
