Commit f7f49800 authored by David Johnson's avatar David Johnson

Merge branch 'queens' into 'master'

See merge request !1
parents fb4d1cb9 2022d7ed
This diff is collapsed.
--- /usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js~ 2017-08-30 05:08:44.000000000 -0600
+++ /usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js 2017-11-30 12:29:31.341556532 -0700
@@ -200,7 +200,7 @@
// REQUIRED for JS logic (image | snapshot | volume | volume_snapshot)
source_type: null,
source: [],
- create_volume_default: true,
+ create_volume_default: false,
// REQUIRED for JS logic
vol_create: false,
// May be null
--- /usr/lib/python2.7/dist-packages/manila/network/neutron/api.py.orig 2018-02-28 04:27:48.000000000 -0700
+++ /usr/lib/python2.7/dist-packages/manila/network/neutron/api.py 2018-06-21 10:56:50.807123424 -0600
@@ -172,14 +172,14 @@
def create_port(self, tenant_id, network_id, host_id=None, subnet_id=None,
fixed_ip=None, device_owner=None, device_id=None,
- mac_address=None, port_security_enabled=True,
+ mac_address=None, port_security_enabled=False,
security_group_ids=None, dhcp_opts=None, **kwargs):
try:
port_req_body = {'port': {}}
port_req_body['port']['network_id'] = network_id
port_req_body['port']['admin_state_up'] = True
port_req_body['port']['tenant_id'] = tenant_id
- if not port_security_enabled:
+ if port_security_enabled:
port_req_body['port']['port_security_enabled'] = (
port_security_enabled)
elif security_group_ids:
--- /usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ofswitch.py~ 2017-09-25 08:34:16.000000000 -0600
+++ /usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ofswitch.py 2017-12-13 10:41:06.994922408 -0700
@@ -112,30 +112,41 @@
if table_id is None:
table_id = ofp.OFPTT_ALL
+ cookie_masks = []
if cookie == ovs_lib.COOKIE_ANY:
- cookie = 0
+ #cookie_masks.append((0,0))
if cookie_mask != 0:
raise Exception("cookie=COOKIE_ANY but cookie_mask set to %s" %
cookie_mask)
+ cookies = set([f.cookie for f in self.dump_flows()]) - \
+ self.preserved_cookies
+ LOG.warning("Preserved cookies for %s: %s", self.br_name,
+ self.preserved_cookies)
+ for c in cookies:
+ cookie_masks.append((c,ovs_lib.UINT64_BITMASK))
elif cookie == COOKIE_DEFAULT:
- cookie = self._default_cookie
- cookie_mask = ovs_lib.UINT64_BITMASK
+ cookie_masks.append((self._default_cookie,ovs_lib.UINT64_BITMASK))
+ elif cookie in self.preserved_cookies:
+ return
- match = self._match(ofp, ofpp, match, **match_kwargs)
- if strict:
- cmd = ofp.OFPFC_DELETE_STRICT
- else:
- cmd = ofp.OFPFC_DELETE
- msg = ofpp.OFPFlowMod(dp,
- command=cmd,
- cookie=cookie,
- cookie_mask=cookie_mask,
- table_id=table_id,
- match=match,
- priority=priority,
- out_group=ofp.OFPG_ANY,
- out_port=ofp.OFPP_ANY)
- self._send_msg(msg)
+ for (_cookie,_mask) in cookie_masks:
+ match = self._match(ofp, ofpp, match, **match_kwargs)
+ if strict:
+ cmd = ofp.OFPFC_DELETE_STRICT
+ else:
+ cmd = ofp.OFPFC_DELETE
+ LOG.warning("Deleting flow with cookie 0x%(cookie)x",
+ {'cookie': _cookie})
+ msg = ofpp.OFPFlowMod(dp,
+ command=cmd,
+ cookie=_cookie,
+ cookie_mask=_mask,
+ table_id=table_id,
+ match=match,
+ priority=priority,
+ out_group=ofp.OFPG_ANY,
+ out_port=ofp.OFPP_ANY)
+ self._send_msg(msg)
def dump_flows(self, table_id=None):
(dp, ofp, ofpp) = self._get_dp()
--- /usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/br_cookie.py~ 2017-09-25 08:34:16.000000000 -0600
+++ /usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/br_cookie.py 2017-12-13 10:35:45.466905659 -0700
@@ -17,6 +17,8 @@
from neutron.agent.common import ovs_lib
+import os
+import os.path
class OVSBridgeCookieMixin(object):
'''Mixin to provide cookie retention functionality
@@ -26,6 +28,26 @@
def __init__(self, *args, **kwargs):
super(OVSBridgeCookieMixin, self).__init__(*args, **kwargs)
self._reserved_cookies = set()
+ self._preserved_cookies = set()
+
+ if not os.path.exists("/var/lib/neutron/ovs-default-flows.reserved_cookie"):
+ sc = self.request_cookie()
+ self._preserved_cookies.add(sc)
+ self._reserved_cookies.add(sc)
+ f = file("/var/lib/neutron/ovs-default-flows.reserved_cookie",'w')
+ f.write(str(sc))
+ f.close()
+ else:
+ f = file("/var/lib/neutron/ovs-default-flows.reserved_cookie",'r')
+ sc = int(f.read())
+ f.close()
+ self._preserved_cookies.add(sc)
+ self._reserved_cookies.add(sc)
+ pass
+
+ @property
+ def preserved_cookies(self):
+ return set(self._preserved_cookies)
@property
def reserved_cookies(self):
--- /usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py.orig 2018-05-17 14:32:56.000000000 -0600
+++ /usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py 2018-07-03 17:59:48.709498189 -0600
@@ -4602,7 +4602,8 @@
if (virt_type not in ("lxc", "uml", "parallels", "xen") or
(virt_type == "xen" and guest.os_type == fields.VMMode.HVM)):
- guest.features.append(vconfig.LibvirtConfigGuestFeatureACPI())
+ if caps.host.cpu.arch != 'aarch64' or guest.os_loader_type == "pflash":
+ guest.features.append(vconfig.LibvirtConfigGuestFeatureACPI())
guest.features.append(vconfig.LibvirtConfigGuestFeatureAPIC())
if (virt_type in ("qemu", "kvm") and
@@ -4820,7 +4821,7 @@
hw_firmware_type = image_meta.properties.get('hw_firmware_type')
if caps.host.cpu.arch == fields.Architecture.AARCH64:
if not hw_firmware_type:
- hw_firmware_type = fields.FirmwareType.UEFI
+ hw_firmware_type = fields.FirmwareType.BIOS
if hw_firmware_type == fields.FirmwareType.UEFI:
if self._has_uefi_support():
global uefi_logged
......@@ -35,8 +35,8 @@ pc = portal.Context()
# Define *many* parameters; see the help docs in geni-lib to learn how to modify.
#
pc.defineParameter("release","OpenStack Release",
portal.ParameterType.STRING,"pike",[("pike","Pike"),("ocata","Ocata"),("newton","Newton"),("mitaka","Mitaka"),("liberty","Liberty (deprecated)"),("kilo","Kilo (deprecated)"),("juno","Juno (deprecated)")],
longDescription="We provide OpenStack Pike, Ocata, Newton, Mitaka (Ubuntu 16.04); Liberty (Ubuntu 15.10); Kilo (Ubuntu 15.04); or Juno (Ubuntu 14.10). OpenStack is installed from packages available on these distributions.")
portal.ParameterType.STRING,"queens",[("queens","Queens"),("pike","Pike"),("ocata","Ocata"),("newton","Newton"),("mitaka","Mitaka"),("liberty","Liberty (deprecated)"),("kilo","Kilo (deprecated)"),("juno","Juno (deprecated)")],
longDescription="We provide OpenStack Queens (Ubuntu 18.04), Pike, Ocata, Newton, Mitaka (Ubuntu 16.04); Liberty (Ubuntu 15.10); Kilo (Ubuntu 15.04); or Juno (Ubuntu 14.10). OpenStack is installed from packages available on these distributions.")
pc.defineParameter("computeNodeCount", "Number of compute nodes (at Site 1)",
portal.ParameterType.INTEGER, 1)
pc.defineParameter("osNodeType", "Hardware Type",
......@@ -185,6 +185,10 @@ pc.defineParameter("enableInboundSshAndIcmp","Enable Inbound SSH and ICMP",
portal.ParameterType.BOOLEAN,True,advanced=True,
longDescription="Enable inbound SSH and ICMP into your instances in the default security group, if you have security groups enabled.")
pc.defineParameter("enableNeutronLoadBalancing","Enable Neutron LBaaS",
portal.ParameterType.BOOLEAN,True,advanced=True,
longDescription="Enable Neutron LBaas for releases >= Newton.")
pc.defineParameter("enableNewSerialSupport","Enable new Juno serial consoles",
portal.ParameterType.BOOLEAN,False,advanced=True,
longDescription="Enable new serial console support added in Juno. This means you can access serial consoles via web sockets from a CLI tool (not in the dashboard yet), but the serial console log will no longer be available for viewing! Until it supports both interactivity and logging, you will have to choose. We download software for you and create a simple frontend script on your controller node, /root/setup/novaconsole.sh , that when given the name of an instance as its sole argument, will connect you to its serial console. The escape sequence is ~. (tilde,period), but make sure to use multiple tildes to escape through your ssh connection(s), so that those are not disconnected along with your console session.")
......@@ -417,7 +421,7 @@ for param in pc._parameterOrder:
pass
tourDescription = \
"This profile provides a highly-configurable OpenStack instance with a controller and one or more compute nodes (potentially at multiple Cloudlab sites) (and optionally a network manager node, in a split configuration). This profile runs x86 or ARM64 nodes. It sets up OpenStack Pike, Ocata, Newton, or Mitaka on Ubuntu 16.04 (Liberty on 15.10, Kilo on 15.04, and Juno on 14.10 are *deprecated*) according to your choice, and configures all OpenStack services, pulls in some VM disk images, and creates basic networks accessible via floating IPs. You'll be able to create instances and access them over the Internet in just a few minutes. When you click the Instantiate button, you'll be presented with a list of parameters that you can change to control what your OpenStack instance will look like; **carefully** read the parameter documentation on that page (or in the Instructions) to understand the various features available to you."
"This profile provides a highly-configurable OpenStack instance with a controller and one or more compute nodes (potentially at multiple Cloudlab sites) (and optionally a network manager node, in a split configuration). This profile runs x86 or arm64 nodes. It sets up OpenStack Queens, Pike, Ocata, Newton, or Mitaka on Ubuntu 16.04 (Liberty on 15.10, Kilo on 15.04, and Juno on 14.10 are *deprecated*) according to your choice, and configures all OpenStack services, pulls in some VM disk images, and creates basic networks accessible via floating IPs. You'll be able to create instances and access them over the Internet in just a few minutes. When you click the Instantiate button, you'll be presented with a list of parameters that you can change to control what your OpenStack instance will look like; **carefully** read the parameter documentation on that page (or in the Instructions) to understand the various features available to you."
###if not params.adminPass or len(params.adminPass) == 0:
passwdHelp = "Your OpenStack admin and instance VM password is randomly-generated by Cloudlab, and it is: `{password-adminPass}` ."
......@@ -429,7 +433,7 @@ passwdHelp += " When logging in to the Dashboard, use the `admin` user; when lo
tourInstructions = \
"""
### Basic Instructions
Once your experiment nodes have booted, and this profile's configuration scripts have finished configuring OpenStack inside your experiment, you'll be able to visit [the OpenStack Dashboard WWW interface](http://{host-%s}/horizon/auth/login/?next=/horizon/project/instances/) (approx. 5-15 minutes). If you've selected the Pike release (or newer), you can also login to [your experiment's Grafana WWW interface](http://{host-%s}:3000/dashboard/db/openstack-instance-statistics) and view OpenStack instance VM statistics once you've created some VMs. %s
Once your experiment nodes have booted, and this profile's configuration scripts have finished configuring OpenStack inside your experiment, you'll be able to visit [the OpenStack Dashboard WWW interface](http://{host-%s}/horizon/auth/login/?next=/horizon/project/instances/) (approx. 5-15 minutes). If you've selected the Pike release (or newer), you can also login to [your experiment's Grafana WWW interface](http://{host-%s}:3000/dashboard/db/openstack-instance-statistics?orgId=1) and view OpenStack instance VM statistics once you've created some VMs. %s
Please wait to login to the OpenStack dashboard until the setup scripts have completed (we've seen Dashboard issues with content not appearing if you login before configuration is complete). There are multiple ways to determine if the scripts have finished:
- First, you can watch the experiment status page: the overall State will say \"booted (startup services are still running)\" to indicate that the nodes have booted up, but the setup scripts are still running.
......@@ -596,6 +600,9 @@ elif params.release == 'ocata':
elif params.release == 'pike':
image_os = 'UBUNTU16-64'
image_tag_rel = '-P'
elif params.release == 'queens':
image_os = 'UBUNTU18-64'
image_tag_rel = '-Q'
else:
image_os = 'UBUNTU16-64'
params.fromScratch = True
......@@ -604,14 +611,14 @@ else:
pass
if params.fromScratch:
image_tag_cn = 'STD'
image_tag_nm = 'STD'
image_tag_cp = 'STD'
image_tag_cn = '-STD'
image_tag_nm = '-STD'
image_tag_cp = '-STD'
image_tag_rel = ''
else:
image_tag_cn = 'OSCN'
image_tag_nm = 'OSNM'
image_tag_cp = 'OSCP'
image_tag_cn = '-OSCN'
image_tag_nm = '-OSNM'
image_tag_cp = '-OSCP'
pass
nodes = dict({})
......@@ -661,7 +668,7 @@ controller.Site("1")
if params.controllerDiskImage:
controller.disk_image = params.controllerDiskImage
else:
controller.disk_image = "urn:publicid:IDN+%s+image+%s//%s-%s%s" % (image_urn,image_project,image_os,image_tag_cn,image_tag_rel)
controller.disk_image = "urn:publicid:IDN+%s+image+%s//%s%s%s" % (image_urn,image_project,image_os,image_tag_cn,image_tag_rel)
if firewalling and setfwdesire:
controller.Desire('firewallable','1.0')
i = 0
......@@ -701,7 +708,7 @@ if params.controllerHost != params.networkManagerHost:
if params.networkManagerDiskImage:
networkManager.disk_image = params.networkManagerDiskImage
else:
networkManager.disk_image = "urn:publicid:IDN+%s+image+%s//%s-%s%s" % (image_urn,image_project,image_os,image_tag_nm,image_tag_rel)
networkManager.disk_image = "urn:publicid:IDN+%s+image+%s//%s%s%s" % (image_urn,image_project,image_os,image_tag_nm,image_tag_rel)
if firewalling and setfwdesire:
networkManager.Desire('firewallable','1.0')
i = 0
......@@ -763,7 +770,7 @@ for (siteNumber,cpnameList) in computeNodeNamesBySite.iteritems():
if params.computeDiskImage:
cpnode.disk_image = params.computeDiskImage
else:
cpnode.disk_image = "urn:publicid:IDN+%s+image+%s//%s-%s%s" % (image_urn,image_project,image_os,image_tag_cp,image_tag_rel)
cpnode.disk_image = "urn:publicid:IDN+%s+image+%s//%s%s%s" % (image_urn,image_project,image_os,image_tag_cp,image_tag_rel)
if firewalling and setfwdesire:
cpnode.Desire('firewallable','1.0')
i = 0
......@@ -975,6 +982,9 @@ class Parameters(RSpec.Resource):
param = ET.SubElement(el,paramXML)
param.text = "DEFAULT_SECGROUP_ENABLE_SSH_ICMP=%d" % (int(params.enableInboundSshAndIcmp))
param = ET.SubElement(el,paramXML)
param.text = "USE_NEUTRON_LBAAS=%d" % (int(params.enableNeutronLoadBalancing))
param = ET.SubElement(el,paramXML)
param.text = "CEILOMETER_USE_MONGODB=%d" % (int(params.ceilometerUseMongoDB))
......
......@@ -51,7 +51,7 @@ crudini --set /etc/nova/nova.conf neutron \
auth_strategy keystone
if [ $OSVERSION -le $OSKILO ]; then
crudini --set /etc/nova/nova.conf neutron \
admin_auth_url http://$CONTROLLER:35357/v2.0
admin_auth_url http://$CONTROLLER:${KADMINPORT}/v2.0
crudini --set /etc/nova/nova.conf neutron \
admin_tenant_name service
crudini --set /etc/nova/nova.conf neutron \
......@@ -60,7 +60,7 @@ if [ $OSVERSION -le $OSKILO ]; then
admin_password ${NEUTRON_PASS}
else
crudini --set /etc/nova/nova.conf neutron \
auth_url http://$CONTROLLER:35357
auth_url http://$CONTROLLER:${KADMINPORT}
crudini --set /etc/nova/nova.conf neutron ${AUTH_TYPE_PARAM} password
crudini --set /etc/nova/nova.conf neutron ${PROJECT_DOMAIN_PARAM} default
crudini --set /etc/nova/nova.conf neutron ${USER_DOMAIN_PARAM} default
......
......@@ -73,7 +73,7 @@ if [ $OSVERSION -lt $OSKILO ]; then
crudini --set /etc/ceilometer/ceilometer.conf keystone_authtoken \
auth_uri http://${CONTROLLER}:5000/${KAPISTR}
crudini --set /etc/ceilometer/ceilometer.conf keystone_authtoken \
identity_uri http://${CONTROLLER}:35357
identity_uri http://${CONTROLLER}:${KADMINPORT}
crudini --set /etc/ceilometer/ceilometer.conf keystone_authtoken \
admin_tenant_name service
crudini --set /etc/ceilometer/ceilometer.conf keystone_authtoken \
......@@ -84,7 +84,7 @@ else
crudini --set /etc/ceilometer/ceilometer.conf keystone_authtoken \
auth_uri http://${CONTROLLER}:5000
crudini --set /etc/ceilometer/ceilometer.conf keystone_authtoken \
auth_url http://${CONTROLLER}:35357
auth_url http://${CONTROLLER}:${KADMINPORT}
if [ $OSVERSION -ge $OSMITAKA -o $KEYSTONEUSEMEMCACHE -eq 1 ]; then
crudini --set /etc/ceilometer/ceilometer.conf keystone_authtoken \
memcached_servers ${CONTROLLER}:11211
......
......@@ -128,7 +128,7 @@ if [ $OSVERSION -lt $OSKILO ]; then
crudini --set /etc/nova/nova.conf keystone_authtoken \
auth_uri http://${CONTROLLER}:5000/v2.0
crudini --set /etc/nova/nova.conf keystone_authtoken \
identity_uri http://${CONTROLLER}:35357
identity_uri http://${CONTROLLER}:${KADMINPORT}
crudini --set /etc/nova/nova.conf keystone_authtoken \
admin_tenant_name service
crudini --set /etc/nova/nova.conf keystone_authtoken \
......@@ -139,7 +139,7 @@ else
crudini --set /etc/nova/nova.conf keystone_authtoken \
auth_uri http://${CONTROLLER}:5000
crudini --set /etc/nova/nova.conf keystone_authtoken \
auth_url http://${CONTROLLER}:35357
auth_url http://${CONTROLLER}:${KADMINPORT}
crudini --set /etc/nova/nova.conf keystone_authtoken \
${AUTH_TYPE_PARAM} password
crudini --set /etc/nova/nova.conf keystone_authtoken \
......@@ -168,7 +168,7 @@ if [ $OSVERSION -ge $OSOCATA ]; then
crudini --set /etc/nova/nova.conf placement \
os_region_name $REGION
crudini --set /etc/nova/nova.conf placement \
auth_url http://${CONTROLLER}:35357/v3
auth_url http://${CONTROLLER}:${KADMINPORT}/v3
crudini --set /etc/nova/nova.conf placement \
${AUTH_TYPE_PARAM} password
crudini --set /etc/nova/nova.conf placement \
......@@ -272,6 +272,8 @@ if [ "$ARCH" = "aarch64" ] ; then
patch -d / -p0 < $DIRNAME/etc/nova-pike-aarch64-virtio-video.patch
crudini --set /etc/nova/nova-compute.conf libvirt video_type virtio
crudini --set /etc/nova/nova-compute.conf DEFAULT pointer_model ps2mouse
elif [ $OSVERSION -eq $OSQUEENS ]; then
patch -d / -p0 < $DIRNAME/etc/nova-queens-aarch64-libvirt-bios-default.patch
fi
fi
......
This diff is collapsed.
......@@ -59,7 +59,11 @@ if [ "$HOSTNAME" = "$NETWORKMANAGER" ]; then
# up (i.e. neutron-ovs-cleanup; see setup-ovs-node.sh).
echo $MYIP `hostname` >> /etc/hosts.tmp
cp -p /etc/hosts $OURDIR/hosts.orig
cat $OURDIR/hosts.orig >> /etc/hosts.tmp
cp -p /etc/hosts $OURDIR/hosts.stripped
for node in $NODES ; do
sed -i -e "s/[ ]$node\$//g" $OURDIR/hosts.stripped
done
cat $OURDIR/hosts.stripped >> /etc/hosts.tmp
mv /etc/hosts.tmp /etc/hosts
for node in $NODES
do
......@@ -75,10 +79,10 @@ if [ "$HOSTNAME" = "$NETWORKMANAGER" ]; then
#$OURDIR/data-hosts $OURDIR/data-netmask \
#$fqdn:$OURDIR
scp -p -o StrictHostKeyChecking=no \
$OURDIR/mgmt-hosts $fqdn:$OURDIR
$OURDIR/mgmt-hosts $OURDIR/hosts.stripped $fqdn:$OURDIR
# For now, just insert the new hosts in front of the existing ones.
# setup-{ovs,linuxbridge}-node.sh may do differently.
$SSH $fqdn "cp -p /etc/hosts $OURDIR/hosts.orig ; cat $OURDIR/mgmt-hosts > /etc/hosts.tmp ; cat $OURDIR/hosts.orig >> /etc/hosts.tmp ; mv /etc/hosts.tmp /etc/hosts"
$SSH $fqdn "cp -p /etc/hosts $OURDIR/hosts.orig ; cat $OURDIR/mgmt-hosts > /etc/hosts.tmp ; cat $OURDIR/hosts.stripped >> /etc/hosts.tmp ; mv /etc/hosts.tmp /etc/hosts"
done
echo "*** Setting up the Management Network"
......
......@@ -118,6 +118,8 @@ LINUXBRIDGE_STATIC=0
# control net DNS server). The local domain will also be searched prior
# to the cluster's domain.
USE_DESIGNATE_AS_RESOLVER=1
# If set to 1, and if OSRELEASE >= OSNEWTON, then setup Neutron LBaaS.
USE_NEUTRON_LBAAS=1
# We are not currently using the ceilometer stats, and they do not work
# as of Pike due to the switch to Gnocchi as the measurement DB.
ENABLE_OPENSTACK_SLOTHD=0
......@@ -155,11 +157,35 @@ NEWNODELIST=""
# We might store any missing nodes here
OLDNODELIST=""
#
# Setup apt-get to not prompt us
#
if [ ! -e $OURDIR/apt-configured ]; then
echo "force-confdef" > /etc/dpkg/dpkg.cfg.d/cloudlab
echo "force-confold" >> /etc/dpkg/dpkg.cfg.d/cloudlab
touch $OURDIR/apt-configured
fi
export DEBIAN_FRONTEND=noninteractive
# -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef"
DPKGOPTS=''
APTGETINSTALLOPTS='-y'
APTGETINSTALL="apt-get $DPKGOPTS install $APTGETINSTALLOPTS"
# Don't install/upgrade packages if this is not set
if [ ${DO_APT_INSTALL} -eq 0 ]; then
APTGETINSTALL="/bin/true ${APTGETINSTALL}"
fi
##
## Detect if this was a geni experiment
##
grep GENIUSER $SETTINGS
if [ ! $? -eq 0 ]; then
which python
if [ ! $? -eq 0 ]; then
# We need python to continue; install it.
apt-get update
apt-get $DPKGOPTS install $APTGETINSTALLOPTS python
fi
geni-get slice_urn >/dev/null 2>&1
if [ $? -eq 0 ]; then
GENIUSER=1
......@@ -186,13 +212,13 @@ fi
if [ $GENIUSER -eq 1 ]; then
dpkg -s python-m2crypto >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
apt-get install python-m2crypto
apt-get $DPKGOPTS install $APTGETINSTALLOPTS python-m2crypto
# Keep trying again with updated cache forever;
# we must have this package.
success=$?
while [ ! $success -eq 0 ]; do
apt-get update
apt-get install python-m2crypto
apt-get $DPKGOPTS install $APTGETINSTALLOPTS python-m2crypto
success=$?
done
fi
......@@ -312,6 +338,7 @@ OSMITAKA=13
OSNEWTON=14
OSOCATA=15
OSPIKE=16
OSQUEENS=17
. /etc/lsb-release
#
......@@ -326,6 +353,7 @@ if [ ! "x$OSRELEASE" = "x" ]; then
if [ $OSCODENAME = "newton" ]; then OSVERSION=$OSNEWTON ; fi
if [ $OSCODENAME = "ocata" ]; then OSVERSION=$OSOCATA ; fi
if [ $OSCODENAME = "pike" ]; then OSVERSION=$OSPIKE ; fi
if [ $OSCODENAME = "queens" ]; then OSVERSION=$OSQUEENS ; fi
#
# We only use cloudarchive for LTS images!
......@@ -347,6 +375,7 @@ else
OSCODENAME="juno"
OSVERSION=$OSJUNO
fi
DISTRIB_MAJOR=`echo $DISTRIB_RELEASE | cut -d. -f1`
#
# Default memcached fully on for Mitaka or greater. Too slow without it.
......@@ -361,6 +390,17 @@ else
REGION="RegionOne"
fi
#
# See which keystone port has the admin capabilities. This changed in
# Queens to fully drop 35357 because it's now irrelevant and not
# configured by default.
#
if [ $OSVERSION -ge $OSQUEENS ]; then
KADMINPORT=5000
else
KADMINPORT=35357
fi
#
# Figure out if we got told to use keystone v2 or v3, or what our
# default should be if not.
......@@ -655,19 +695,6 @@ if [ ! $? -eq 0 ]; then
echo "MIRRORSETUP=1" >> $SETTINGS
fi
# Setup apt-get to not prompt us
echo "force-confdef" > /etc/dpkg/dpkg.cfg.d/cloudlab
echo "force-confold" >> /etc/dpkg/dpkg.cfg.d/cloudlab
export DEBIAN_FRONTEND=noninteractive
# -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef"
DPKGOPTS=''
APTGETINSTALLOPTS='-y'
APTGETINSTALL="apt-get $DPKGOPTS install $APTGETINSTALLOPTS"
# Don't install/upgrade packages if this is not set
if [ ${DO_APT_INSTALL} -eq 0 ]; then
APTGETINSTALL="/bin/true ${APTGETINSTALL}"
fi
if [ ! -f $OURDIR/apt-updated -a "${DO_APT_UPDATE}" = "1" ]; then
#
# Attempt to handle old EOL releases; so far only need to handle utopic
......@@ -1127,6 +1154,7 @@ if [ ! -e $OURDIR/info.mgmt ]; then
MGMTMAC=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/^.* VMAC=\([0-9a-f:\.]*\) .* LAN=${MGMTLAN}.*\$/\1/p"`
MGMT_NETWORK_INTERFACE=`/usr/local/etc/emulab/findif -m $MGMTMAC`
MGMTVLANDEV=`ip link show ${MGMT_NETWORK_INTERFACE} | sed -n -e "s/^.*${MGMT_NETWORK_INTERFACE}\@\([0-9a-zA-Z_]*\): .*\$/\1/p"`
MGMTVLANTAG=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/^.* LAN=${MGMTLAN} VTAG=\([0-9]*\).*\$/\1/p"`
else
MGMTVLAN=0
MGMTMAC=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/.* MAC=\([0-9a-f:\.]*\) .* LAN=${MGMTLAN}/\1/p"`
......@@ -1141,6 +1169,7 @@ if [ ! -e $OURDIR/info.mgmt ]; then
echo "MGMTMAC='$MGMTMAC'" >> $OURDIR/info.mgmt
echo "MGMT_NETWORK_INTERFACE='$MGMT_NETWORK_INTERFACE'" >> $OURDIR/info.mgmt
echo "MGMTVLANDEV='$MGMTVLANDEV'" >> $OURDIR/info.mgmt
echo "MGMTVLANTAG='$MGMTVLANTAG'" >> $OURDIR/info.mgmt
else
. $OURDIR/info.mgmt
fi
......@@ -1156,6 +1185,7 @@ for lan in $DATAFLATLANS $DATAOTHERLANS ; do
DATAIP=`cat $OURDIR/data-hosts.$lan | grep -E "$NODEID$" | sed -n -e 's/^\([0-9]*.[0-9]*.[0-9]*.[0-9]*\).*$/\1/p'`
DATANETMASK=`cat $OURDIR/data-netmask.$lan`
DATAPREFIX=`netmask2prefix $DATANETMASK`
cat ${BOOTDIR}/tmcc/ifconfig | grep "IFACETYPE=vlan" | grep "${lan}"
if [ $? = 0 ]; then
DATAVLAN=1
......@@ -1176,6 +1206,7 @@ for lan in $DATAFLATLANS $DATAOTHERLANS ; do
echo "DATABRIDGE=br-${lan}" >> $OURDIR/info.$lan
echo "DATAIP=${DATAIP}" >> $OURDIR/info.$lan
echo "DATANETMASK=${DATANETMASK}" >> $OURDIR/info.$lan
echo "DATAPREFIX=${DATAPREFIX}" >> $OURDIR/info.$lan
echo "DATAVLAN=${DATAVLAN}" >> $OURDIR/info.$lan
echo "DATAVLANTAG=${DATAVLANTAG}" >> $OURDIR/info.$lan
echo "DATAVLANDEV=${DATAVLANDEV}" >> $OURDIR/info.$lan
......
......@@ -51,9 +51,10 @@ if [ ! -f $OURDIR/ctlnet.vars ]; then
ctlip="$MYIP"
ctlmac=`ip -o link show ${EXTERNAL_NETWORK_INTERFACE} | sed -n -e 's/^.*link\/ether \([0-9a-fA-F:]*\) .*$/\1/p'`
ctlstrippedmac=`echo $ctlmac | sed -e 's/://g'`
ctlnetmask=`ifconfig ${EXTERNAL_NETWORK_INTERFACE} | sed -n -e 's/^.*Mask:\([0-9]*.[0-9]*.[0-9]*.[0-9]*\).*$/\1/p'`
ctlnetmask=`ifconfig ${EXTERNAL_NETWORK_INTERFACE} | sed -n -e 's/^.*mask[: ]\([0-9]*.[0-9]*.[0-9]*.[0-9]*\).*$/\1/ip'`
ctlgw=`ip route show default | sed -n -e 's/^default via \([0-9]*.[0-9]*.[0-9]*.[0-9]*\).*$/\1/p'`
ctlnet=`ip route show dev ${EXTERNAL_NETWORK_INTERFACE} | sed -n -e 's/^\([0-9]*.[0-9]*.[0-9]*.[0-9]*\/[0-9]*\) .*$/\1/p'`
ctlprefix=`echo $ctlnet | cut -d/ -f2`
echo "ctlip=\"$ctlip\"" > $OURDIR/ctlnet.vars
echo "ctlmac=\"$ctlmac\"" >> $OURDIR/ctlnet.vars
......@@ -61,6 +62,7 @@ if [ ! -f $OURDIR/ctlnet.vars ]; then
echo "ctlnetmask=\"$ctlnetmask\"" >> $OURDIR/ctlnet.vars
echo "ctlgw=\"$ctlgw\"" >> $OURDIR/ctlnet.vars
echo "ctlnet=\"$ctlnet\"" >> $OURDIR/ctlnet.vars
echo "ctlprefix=\"$ctlprefix\"" >> $OURDIR/ctlnet.vars
else
. $OURDIR/ctlnet.vars
fi
......@@ -83,14 +85,15 @@ route add default gw $ctlgw
#
# Make the configuration for the $EXTERNAL_NETWORK_INTERFACE be static.
#
DNSDOMAIN=`cat /etc/resolv.conf | grep search | head -1 | awk '{ print $2 }'`
DNSDOMAIN=`hostname | cut -d. -f4-100`
DNSSERVER=`cat /etc/resolv.conf | grep nameserver | head -1 | awk '{ print $2 }'`
#
# We need to blow away the Emulab config -- no more dhcp
# This would definitely break experiment modify, of course
#
cat <<EOF > /etc/network/interfaces
if [ $DISTRIB_MAJOR -lt 18 ]; then
cat <<EOF > /etc/network/interfaces
#
# Openstack Network Node in Cloudlab/Emulab/Apt/Federation
#
......@@ -114,6 +117,68 @@ iface ${EXTERNAL_NETWORK_BRIDGE} inet static
up echo "${EXTERNAL_NETWORK_BRIDGE}" > /var/run/cnet
up echo "${EXTERNAL_NETWORK_BRIDGE}" > /var/emulab/boot/controlif
EOF
else
mv /etc/udev/rules.d/99-emulab-networkd.rules \
/etc/udev/rules.d/99-emulab-networkd.rules.NO
systemctl disable emulab-udev-settle.service
cat <<EOF >/etc/systemd/system/testbed-pre-static-control-network.service
[Unit]
Description=Testbed Static Control Network Services
After=network.target network-online.target local-fs.target
Wants=network.target
Before=testbed.service
Before=pubsubd.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=$OURDIR/testbed-pre-static-control-network.sh
StandardOutput=journal+console
StandardError=journal+console
[Install]
WantedBy=multi-user.target
WantedBy=testbed.service
WantedBy=pubsubd.service
EOF
cat <<EOF >$OURDIR/testbed-pre-static-control-network.sh
#!/bin/sh
#
# These are just the things we cannot do via hook from systemd-networkd,
# that were previously done in /etc/network/interfaces via "up" hook.
#
echo "${EXTERNAL_NETWORK_BRIDGE}" > /var/run/cnet
echo "${EXTERNAL_NETWORK_BRIDGE}" > /var/emulab/boot/controlif
EOF
chmod 755 $OURDIR/testbed-pre-static-control-network.sh
systemctl daemon-reload
cat <<EOF >/etc/systemd/network/${EXTERNAL_NETWORK_BRIDGE}.netdev
[NetDev]
Name=${EXTERNAL_NETWORK_BRIDGE}
Kind=bridge
EOF
cat <<EOF >/etc/systemd/network/${EXTERNAL_NETWORK_INTERFACE}.network
[Match]
Name=${EXTERNAL_NETWORK_INTERFACE}
[Network]
Bridge=${EXTERNAL_NETWORK_BRIDGE}
EOF
cat <<EOF >/etc/systemd/network/${EXTERNAL_NETWORK_BRIDGE}.network
[Match]
Name=${EXTERNAL_NETWORK_BRIDGE}
[Network]
Description=OpenStack External Network Bridge
DHCP=no
Address=$ctlip/$ctlprefix
Gateway=$ctlgw
DNS=$DNSSERVER
Domains=$DNSDOMAIN
IPForward=yes
EOF
fi
# Also restart slothd so it listens on the new control iface.
echo "${EXTERNAL_NETWORK_BRIDGE}" > /var/run/cnet
......@@ -127,7 +192,8 @@ sleep 1
# Add the management network config if necessary (if not, it's already a VPN)
#
if [ ! -z "$MGMTLAN" ]; then
cat <<EOF >> /etc/network/interfaces
if [ $DISTRIB_MAJOR -lt 18 ]; then
cat <<EOF >> /etc/network/interfaces
auto ${MGMT_NETWORK_INTERFACE}
iface ${MGMT_NETWORK_INTERFACE} inet static
......@@ -136,10 +202,53 @@ iface ${MGMT_NETWORK_INTERFACE} inet static
up mkdir -p /var/run/emulab
up echo "${MGMT_NETWORK_INTERFACE} $MGMTIP $MGMTMAC" > /var/run/emulab/interface-done-$MGMTMAC
EOF
else
cat <<EOF >/etc/systemd/network/${MGMT_NETWORK_INTERFACE}.network
[Match]
Name=${MGMT_NETWORK_INTERFACE}
[Network]
Description=OpenStack Management Network
DHCP=no
Address=$MGMTIP/$MGMTPREFIX
IPForward=yes
EOF
cat <<EOF >>$OURDIR/testbed-pre-static-control-network.sh
mkdir -p /var/run/emulab
echo "${MGMT_NETWORK_INTERFACE} $MGMTIP $MGMTMAC" > /var/run/emulab/interface-done-$MGMTMAC
EOF
fi
if [ -n "$MGMTVLANDEV" ]; then
cat <<EOF >> /etc/network/interfaces
if [ $DISTRIB_MAJOR -lt 18 ]; then
cat <<EOF >> /etc/network/interfaces
vlan-raw-device ${MGMTVLANDEV}
EOF
else
cat <<EOF >/etc/systemd/network/${MGMT_NETWORK_INTERFACE}.netdev
[NetDev]
Name=${MGMT_NETWORK_INTERFACE}
Kind=vlan
[VLAN]
Id=$MGMTVLANTAG
EOF
if [ ! -e /etc/systemd/network/${MGMTVLANDEV}.network ]; then
cat <<EOF >/etc/systemd/network/${MGMTVLANDEV}.network
[Match]
Name=${MGMTVLANDEV}
[Network]
DHCP=no
VLAN=${MGMT_NETWORK_INTERFACE}
EOF
else
cat <<EOF >>/etc/systemd/network/${MGMTVLANDEV}.network
VLAN=${MGMT_NETWORK_INTERFACE}
EOF
fi
fi
fi
fi
......@@ -150,6 +259,11 @@ for lan in $DATAFLATLANS ; do
# suck in the vars we'll use to configure this one
. $OURDIR/info.$lan
NETINTVLANSTR=""
if [ -n "$DATAVLANDEV" ]; then
NETINTVLANSTR="vlan-raw-device ${DATAVLANDEV}"
fi
if [ $LINUXBRIDGE_STATIC -eq 1 ]; then
brctl addbr ${DATABRIDGE}
brctl addif ${DATABRIDGE} ${DATADEV}
......@@ -158,11 +272,13 @@ for lan in $DATAFLATLANS ; do
# XXX!
#route add -net 10.0.0.0/8 dev ${DATA_NETWORK_BRIDGE}
cat <<EOF >> /etc/network/interfaces
if [ $DISTRIB_MAJOR -lt 18 ]; then
cat <<EOF >> /etc/network/interfaces
auto ${DATADEV}
iface ${DATADEV} inet static
address 0.0.0.0
$NETINTVLANSTR
auto ${DATABRIDGE}
iface ${DATABRIDGE} inet static
......@@ -172,22 +288,87 @@ iface ${DATABRIDGE} inet static
up mkdir -p /var/run/emulab
up echo "${DATABRIDGE} $DATAIP $DATAMAC" > /var/run/emulab/interface-done-$DATAMAC
EOF
else
cat <<EOF >/etc/systemd/network/${DATABRIDGE}.netdev
[NetDev]
Name=${DATABRIDGE}
Kind=bridge
EOF
cat <<EOF >/etc/systemd/network/${DATADEV}.network
[Match]
Name=${DATADEV}
[Network]
Bridge=${DATABRIDGE}
EOF
cat <<EOF >/etc/systemd/network/${DATABRIDGE}.network
[Match]
Name=${DATABRIDGE}
[Network]
Description=OpenStack Network Bridge
DHCP=no
Address=$DATAIP/$DATAPREFIX
IPForward=yes
EOF