summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorTodd Willey <todd@ansolabs.com>2011-01-27 15:58:22 -0800
committerTodd Willey <todd@ansolabs.com>2011-01-27 15:58:22 -0800
commitf61da82b6dc614867028e39eec71ed98de8bfac7 (patch)
treee935ca43b096cd8c79584c49ad32b42d30b0b69a /nova/virt
parent4b4781f5cc015c80c9acb0625aaeac9cde667d4b (diff)
parentd4f77e1c9eaad19f2a917081737840f9e52dac13 (diff)
Merge & fix conflict.
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/hyperv.py2
-rw-r--r--nova/virt/images.py3
-rw-r--r--nova/virt/libvirt.xml.template6
-rw-r--r--nova/virt/libvirt_conn.py29
-rw-r--r--nova/virt/xenapi/vmops.py2
5 files changed, 28 insertions, 14 deletions
diff --git a/nova/virt/hyperv.py b/nova/virt/hyperv.py
index 5afa3221d..29d18dac5 100644
--- a/nova/virt/hyperv.py
+++ b/nova/virt/hyperv.py
@@ -191,7 +191,7 @@ class HyperVConnection(object):
vcpus = long(instance['vcpus'])
procsetting.VirtualQuantity = vcpus
procsetting.Reservation = vcpus
- procsetting.Limit = vcpus
+ procsetting.Limit = 100000 # static assignment to 100%
(job, ret_val) = vs_man_svc.ModifyVirtualSystemResources(
vm.path_(), [procsetting.GetText_(1)])
diff --git a/nova/virt/images.py b/nova/virt/images.py
index 9c987e14d..7a6fef330 100644
--- a/nova/virt/images.py
+++ b/nova/virt/images.py
@@ -111,5 +111,8 @@ def _image_path(path):
def image_url(image):
+ if FLAGS.image_service == "nova.image.glance.GlanceImageService":
+ return "http://%s:%s/images/%s" % (FLAGS.glance_host,
+ FLAGS.glance_port, image)
return "http://%s:%s/_images/%s/image" % (FLAGS.s3_host, FLAGS.s3_port,
image)
diff --git a/nova/virt/libvirt.xml.template b/nova/virt/libvirt.xml.template
index 8139c3620..88bfbc668 100644
--- a/nova/virt/libvirt.xml.template
+++ b/nova/virt/libvirt.xml.template
@@ -75,11 +75,13 @@
<!-- <model type='virtio'/> CANT RUN virtio network right now -->
<filterref filter="nova-instance-${name}">
<parameter name="IP" value="${ip_address}" />
- <parameter name="DHCPSERVER" value="${dhcp_server}" />
- <parameter name="RASERVER" value="${ra_server}" />
+ <parameter name="DHCPSERVER" value="${dhcp_server}" />
#if $getVar('extra_params', False)
${extra_params}
#end if
+#if $getVar('ra_server', False)
+ <parameter name="RASERVER" value="${ra_server}" />
+#end if
</filterref>
</interface>
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py
index c1038a31f..4e0fd106f 100644
--- a/nova/virt/libvirt_conn.py
+++ b/nova/virt/libvirt_conn.py
@@ -673,8 +673,7 @@ class LibvirtConnection(object):
# Assume that the gateway also acts as the dhcp server.
dhcp_server = network['gateway']
ra_server = network['ra_server']
- if not ra_server:
- ra_server = 'fd00::'
+
if FLAGS.allow_project_net_traffic:
if FLAGS.use_ipv6:
net, mask = _get_net_and_mask(network['cidr'])
@@ -713,11 +712,13 @@ class LibvirtConnection(object):
'mac_address': instance['mac_address'],
'ip_address': ip_address,
'dhcp_server': dhcp_server,
- 'ra_server': ra_server,
'extra_params': extra_params,
'rescue': rescue,
'local': instance_type['local_gb'],
'driver_type': driver_type}
+
+ if ra_server:
+ xml_info['ra_server'] = ra_server + "/128"
if not rescue:
if instance['kernel_id']:
xml_info['kernel'] = xml_info['basepath'] + "/kernel"
@@ -909,6 +910,11 @@ class FirewallDriver(object):
"""
raise NotImplementedError()
+ def _ra_server_for_instance(self, instance):
+ network = db.network_get_by_instance(context.get_admin_context(),
+ instance['id'])
+ return network['ra_server']
+
class NWFilterFirewall(FirewallDriver):
"""
@@ -961,6 +967,10 @@ class NWFilterFirewall(FirewallDriver):
self.static_filters_configured = False
self.handle_security_groups = False
+ def apply_instance_filter(self, instance):
+ """No-op. Everything is done in prepare_instance_filter"""
+ pass
+
def _get_connection(self):
return self._libvirt_get_connection()
_conn = property(_get_connection)
@@ -1119,7 +1129,9 @@ class NWFilterFirewall(FirewallDriver):
'nova-base-ipv6',
'nova-allow-dhcp-server']
if FLAGS.use_ipv6:
- instance_secgroup_filter_children += ['nova-allow-ra-server']
+ ra_server = self._ra_server_for_instance(instance)
+ if ra_server:
+ instance_secgroup_filter_children += ['nova-allow-ra-server']
ctxt = context.get_admin_context()
@@ -1146,10 +1158,6 @@ class NWFilterFirewall(FirewallDriver):
return
- def apply_instance_filter(self, instance):
- """No-op. Everything is done in prepare_instance_filter"""
- pass
-
def refresh_security_group_rules(self, security_group_id):
return self._define_filter(
self.security_group_to_nwfilter_xml(security_group_id))
@@ -1310,8 +1318,9 @@ class IptablesFirewallDriver(FirewallDriver):
elif(ip_version == 6):
# Allow RA responses
ra_server = self._ra_server_for_instance(instance)
- our_rules += ['-A %s -s %s -p icmpv6 '
- '-j ACCEPT' % (chain_name, ra_server)]
+ if ra_server:
+ our_rules += ['-A %s -s %s -p icmpv6 -j ACCEPT' %
+ (chain_name, ra_server + "/128")]
#Allow project network traffic
if (FLAGS.allow_project_net_traffic):
cidrv6 = self._project_cidrv6_for_instance(instance)
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 628a171fa..e84ce20c4 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -149,7 +149,7 @@ class VMOps(object):
if isinstance(instance_or_vm, (int, long)):
ctx = context.get_admin_context()
try:
- instance_obj = db.instance_get_by_id(ctx, instance_or_vm)
+ instance_obj = db.instance_get(ctx, instance_or_vm)
instance_name = instance_obj.name
except exception.NotFound:
# The unit tests screw this up, as they use an integer for