From 3ff5b9114e07349bb4a4b5578394bd799950dcf6 Mon Sep 17 00:00:00 2001 From: Narinder Gupta Date: Sat, 7 Nov 2015 00:38:58 -0600 Subject: added ubuntu charm for local deployment charm to configure the network according to the labs. Change-Id: I103b6dc243f025a4916d1057c247d01ee8f175ee --- ci/01-deploybundle.sh | 43 +++- ci/bundles.yaml | 269 ++++++++++++++++++++ ci/deployment.yaml | 208 +++++++++++++++ ci/maas/intel/pod5/deployment.yaml | 44 +++- ci/maas/intel/pod5/environment.yaml | 36 --- ci/maas/intel/pod5/interfaces.host | 36 +++ ci/maas/intel/pod5/lxc-add-more-interfaces | 52 ++++ ci/maas/intel/pod6/deployment.yaml | 54 ++-- ci/maas/intel/pod6/interfaces.host | 33 +++ ci/maas/intel/pod6/lxc-add-more-interfaces | 52 ++++ ci/maas/orange/pod2/compute-interfaces.host | 23 ++ ci/maas/orange/pod2/control-interfaces.host | 23 ++ ci/maas/orange/pod2/deployment.yaml | 2 + ci/maas/orange/pod2/interfaces.host | 36 +++ ci/maas/orange/pod2/lxc-add-more-interfaces | 43 ++++ ci/odl/01-deploybundle.sh | 46 ++-- ci/odl/juju-deployer/ovs-odl-ha.yaml | 10 +- ci/trusty/ubuntu-nodes-compute/README | 3 + ci/trusty/ubuntu-nodes-compute/copyright | 17 ++ ci/trusty/ubuntu-nodes-compute/hooks/install | 30 +++ ci/trusty/ubuntu-nodes-compute/icon.svg | 279 +++++++++++++++++++++ .../ubuntu-nodes-compute/lxc/add-more-interface | 52 ++++ .../ubuntu-nodes-compute/lxc/add-more-interfaces | 52 ++++ .../lxc/ubuntu-cloud.trusty.conf | 2 + ci/trusty/ubuntu-nodes-compute/metadata.yaml | 7 + .../ubuntu-nodes-compute/network/interfaces.host | 36 +++ ci/trusty/ubuntu-nodes-compute/revision | 1 + ci/trusty/ubuntu-nodes-controller/README | 3 + ci/trusty/ubuntu-nodes-controller/copyright | 17 ++ ci/trusty/ubuntu-nodes-controller/hooks/install | 30 +++ ci/trusty/ubuntu-nodes-controller/icon.svg | 279 +++++++++++++++++++++ .../ubuntu-nodes-controller/lxc/add-more-interface | 52 ++++ .../lxc/add-more-interfaces | 52 ++++ .../lxc/ubuntu-cloud.trusty.conf | 2 + ci/trusty/ubuntu-nodes-controller/metadata.yaml | 7 + .../network/interfaces.host | 36 +++ ci/trusty/ubuntu-nodes-controller/revision | 1 + 37 files changed, 1874 insertions(+), 94 deletions(-) create mode 100644 ci/bundles.yaml create mode 100755 ci/deployment.yaml delete mode 100644 ci/maas/intel/pod5/environment.yaml create mode 100644 ci/maas/intel/pod5/interfaces.host create mode 100755 ci/maas/intel/pod5/lxc-add-more-interfaces create mode 100644 ci/maas/intel/pod6/interfaces.host create mode 100755 ci/maas/intel/pod6/lxc-add-more-interfaces create mode 100644 ci/maas/orange/pod2/compute-interfaces.host create mode 100644 ci/maas/orange/pod2/control-interfaces.host create mode 100644 ci/maas/orange/pod2/interfaces.host create mode 100755 ci/maas/orange/pod2/lxc-add-more-interfaces create mode 100644 ci/trusty/ubuntu-nodes-compute/README create mode 100644 ci/trusty/ubuntu-nodes-compute/copyright create mode 100755 ci/trusty/ubuntu-nodes-compute/hooks/install create mode 100644 ci/trusty/ubuntu-nodes-compute/icon.svg create mode 100755 ci/trusty/ubuntu-nodes-compute/lxc/add-more-interface create mode 100755 ci/trusty/ubuntu-nodes-compute/lxc/add-more-interfaces create mode 100644 ci/trusty/ubuntu-nodes-compute/lxc/ubuntu-cloud.trusty.conf create mode 100644 ci/trusty/ubuntu-nodes-compute/metadata.yaml create mode 100644 ci/trusty/ubuntu-nodes-compute/network/interfaces.host create mode 100644 ci/trusty/ubuntu-nodes-compute/revision create mode 100644 ci/trusty/ubuntu-nodes-controller/README create mode 100644 ci/trusty/ubuntu-nodes-controller/copyright create mode 100755 ci/trusty/ubuntu-nodes-controller/hooks/install create mode 100644 ci/trusty/ubuntu-nodes-controller/icon.svg create mode 100755 ci/trusty/ubuntu-nodes-controller/lxc/add-more-interface create mode 100755 ci/trusty/ubuntu-nodes-controller/lxc/add-more-interfaces create mode 100644 ci/trusty/ubuntu-nodes-controller/lxc/ubuntu-cloud.trusty.conf create mode 100644 ci/trusty/ubuntu-nodes-controller/metadata.yaml create mode 100644 ci/trusty/ubuntu-nodes-controller/network/interfaces.host create mode 100644 ci/trusty/ubuntu-nodes-controller/revision diff --git a/ci/01-deploybundle.sh b/ci/01-deploybundle.sh index 9de9aa22..fee0a515 100755 --- a/ci/01-deploybundle.sh +++ b/ci/01-deploybundle.sh @@ -8,7 +8,6 @@ case "$1" in ;; 'ha' ) cp odl/juju-deployer/ovs-odl-ha.yaml ./bundles.yaml - juju-deployer -d -r 13 -c bundles.yaml openstack-phase1 ;; 'tip' ) cp odl/juju-deployer/ovs-odl-tip.yaml ./bundles.yaml @@ -20,13 +19,49 @@ esac case "$3" in 'orangepod2' ) + cp maas/orange/pod2/control-interfaces.host trusty/ubuntu-nodes-controller/network/interfaces.host + cp maas/orange/pod2/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces + cp maas/orange/pod2/compute-interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host + cp maas/orange/pod2/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces sed -i -- 's/10.4.1.1/192.168.2.2/g' ./bundles.yaml + sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.12.0\/24/g' ./bundles.yaml + ;; + 'intelpod6' ) + cp maas/intel/pod6/interfaces.host trusty/ubuntu-nodes-controller/network/interfaces.host + cp maas/intel/pod6/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces + cp maas/intel/pod6/interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host + cp maas/intel/pod6/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces + sed -i -- 's/10.4.1.1/10.4.1.2/g' ./bundles.yaml + sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.4.9.0\/24/g' ./bundles.yaml + ;; + 'intelpod5' ) + cp maas/intel/pod5/interfaces.host trusty/ubuntu-nodes-controller/network/interfaces.host + cp maas/intel/pod5/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces + cp maas/intel/pod5/interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host + cp maas/intel/pod5/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces + sed -i -- 's/10.4.1.1/10.4.1.2/g' ./bundles.yaml + sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.4.9.0\/24/g' ./bundles.yaml ;; esac echo "... Deployment Started ...." - -#case openstack kilo with odl -juju-deployer -d -r 13 -c bundles.yaml trusty-"$2" +case "$1" in + 'nonha' ) + juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes + juju-deployer -vW -d -c bundles.yaml trusty-"$2" + ;; + 'ha' ) + juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes + juju-deployer -vW -d -c bundles.yaml trusty-"$2" + ;; + 'tip' ) + juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes + juju-deployer -vW -d -c bundles.yaml trusty-"$2" + ;; + * ) + juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes + juju-deployer -vW -d -c bundles.yaml trusty-"$2" + ;; +esac echo "... Deployment finished ...." diff --git a/ci/bundles.yaml b/ci/bundles.yaml new file mode 100644 index 00000000..8af86f82 --- /dev/null +++ b/ci/bundles.yaml @@ -0,0 +1,269 @@ +# vim: set ts=2 et: +openstack-phase1: + series: trusty + services: + nodes-api: + charm: "local:trusty/ubuntu-nodes-controller" + num_units: 3 + constraints: tags=control + nodes-compute: + charm: "local:trusty/ubuntu-nodes-controller" + num_units: 1 + constraints: tags=compute + "ntp": + charm: "cs:trusty/ntp" + relations: + - - "ntp:juju-info" + - "nodes-api:juju-info" + - - "ntp:juju-info" + - "nodes-compute:juju-info" +openstack-phase2: + inherits: openstack-phase1 + services: + "percona-cluster": + charm: "cs:trusty/percona-cluster" + num_units: 3 + options: + "dataset-size": 2G + "lp1366997-workaround": true + "max-connections": 10000 + "root-password": 293rhc395m + "sst-password": 127rc14t51 + vip: 10.4.1.25 + to: + - "lxc:nodes-api=0" + - "lxc:nodes-api=1" + - "lxc:nodes-api=2" + "hacluster-keystone": + charm: "cs:trusty/hacluster" + options: + corosync_key: | + 'QisjNpoKHLkvyc3PEdDHP5VZjgD0kOk9t0ABPWmCELlu5AgWgnW6bJd34BVXO7VhW+3ZwNQM3W+bZ3pl28ftY4ki4N/S0KLFNia5egFgiA3AH2QXLnokS7OYXuu6GMJJ1S5mDe6P5zU+tfJe/Mebq24u7CgR0gAvohSPRdDTwdY=' + "hacluster-horizon": + charm: "cs:trusty/hacluster" + options: + corosync_key: | + 'aCVPHw6XYne+Hxv0WPiM3+yEfeIxs0Ly0EMKB494Rdzjf5rE52GcXqqxuvIa/nXJ4GCR+UdKk9FEwcASfYkeu3HDWUld9uTE6pOc+ibWYnybNH7VBfEHW8h9YmQKs3HD2T3wlTcS2irU4CUW7/IKNok4etYdM3iFn1K2ReSGXEI=' + "hacluster-nova": + charm: "cs:trusty/hacluster" + options: + corosync_key: | + 'gel86qmEze8dYKYbfqIgRpqapJpKtdYL2hxC1y5nWYBPq7EMf6V8mF01IjeUkSRs14CUDrsPpT4PWeom7EOY2fleuLx/aIuqQUfEDkhf/gvaz7BaU4hrmTCoDBK7/HvEwY+/wu4qkEeckzSRPsm9MYzqnLRshh8yjZJ70xU/mmk=' + "hacluster-neutron": + charm: "cs:trusty/hacluster" + options: + corosync_key: | + 'KNhb4++3jlllbnscS5D3qdzOJDsQPEeZ7zOLZJHbkKrRjX9gRCijVVOiv2JCvq03HqQ7LIufQzWGl9Za8qh0f6QmQ3XhFh/Cb/3WaYFj+tEf0zArWv+8miswmM1z4eyTSrTWBq0dTgx1z96wjBxP5HV0+1LWW+3Ei4oZWyRGeR0=' + "hacluster-glance": + charm: "cs:trusty/hacluster" + options: + corosync_key: | + 'el1dd8107J5mwQDPS7tEJPZrr0XFfL95+Tku/QG90W5Q5f5SP4W8TRfKvddGmZWZl2lVd1neG5WqaHa1mq/aScJpoflzVAJCvshN7Gd2AjHhLNNugeI8S90j/7wrKUhqiCAlkKaeri2xs5bB5PZ7Z9AHuNZL7SW1al8lxrKhUFI=' + "rabbitmq-server": + charm: "cs:trusty/rabbitmq-server" + num_units: 3 + options: + management_plugin: true + to: + - "lxc:nodes-api=0" + - "lxc:nodes-api=1" + - "lxc:nodes-api=2" + "keystone": + charm: "cs:trusty/keystone" + num_units: 3 + options: + "admin-password": openstack + "admin-token": admin + vip: 10.4.1.23 + to: + - "lxc:nodes-api=0" + - "lxc:nodes-api=1" + - "lxc:nodes-api=2" + "openstack-dashboard": + charm: "cs:trusty/openstack-dashboard" + num_units: 3 + options: + secret: admin + vip: 10.4.1.21 + webroot: / + to: + - "lxc:nodes-api=0" + - "lxc:nodes-api=1" + - "lxc:nodes-api=2" + "nova-compute": + branch: "lp:~openstack-charmers/charms/trusty/nova-compute/next" + num_units: 4 + options: + "enable-live-migration": true + "enable-resize": true + "migration-auth-type": ssh + to: + - "nodes-compute=0" +# - "nodes-compute=1" + - "nodes-api=0" + - "nodes-api=1" + - "nodes-api=2" + "nova-cloud-controller": + charm: "cs:trusty/nova-cloud-controller" + num_units: 3 + options: + "console-access-protocol": novnc + "network-manager": Neutron + "quantum-security-groups": "yes" + "service-guard": true + vip: 10.4.1.26 + to: + - "lxc:nodes-api=0" + - "lxc:nodes-api=1" + - "lxc:nodes-api=2" + "neutron-api": + branch: lp:~openstack-charmers/charms/trusty/neutron-api/next + num_units: 3 + options: + neutron-security-groups: False + manage-neutron-plugin-legacy-mode: False + vip: 10.4.1.27 + to: + - "lxc:nodes-api=0" + - "lxc:nodes-api=1" + - "lxc:nodes-api=2" + neutron-gateway: + branch: lp:~narindergupta/charms/trusty/neutron-gateway/ovs-odl +# num_units: 3 +# constraints: tags=gateway + options: + "ext-port": "00:1e:67:cf:bb:53" + plugin: ovs-odl +# instance-mtu: 1400 + to: + - "nodes-api=0" + odl-controller: + branch: lp:~narindergupta/charms/trusty/odl-controller/liberty + options: + install-url: "https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.4-Helium-SR4/distribution-karaf-0.2.4-Helium-SR4.tar.gz" +# install-url: "https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.3.2-Lithium-SR2/distribution-karaf-0.3.2-Lithium-SR2.tar.gz" + to: lxc:nodes-api=1 + "glance": + charm: "cs:trusty/glance" + num_units: 3 + options: + vip: 10.4.1.22 + to: + - "lxc:nodes-api=0" + - "lxc:nodes-api=1" + - "lxc:nodes-api=2" + neutron-api-odl: + branch: lp:~narindergupta/charms/trusty/neutron-api-odl/liberty + options: + overlay-network-type: 'vxlan gre' + security-groups: true + openvswitch-odl: + branch: lp:~openstack-charmers/charms/trusty/openvswitch-odl/trunk + relations: + - - "glance:ha" + - "hacluster-glance:ha" + - - "keystone:ha" + - "hacluster-keystone:ha" + - - "neutron-api:ha" + - "hacluster-neutron:ha" + - - "nova-cloud-controller:ha" + - "hacluster-nova:ha" + - - "openstack-dashboard:ha" + - "hacluster-horizon:ha" + - - "nova-compute:amqp" + - "rabbitmq-server:amqp" + - - "neutron-gateway:amqp" + - "rabbitmq-server:amqp" + - - "nova-cloud-controller:identity-service" + - "keystone:identity-service" + - - "glance:identity-service" + - "keystone:identity-service" + - - "neutron-api:identity-service" + - "keystone:identity-service" + - - "neutron-api:amqp" + - "rabbitmq-server:amqp" + - - "neutron-gateway:neutron-plugin-api" + - "neutron-api:neutron-plugin-api" + - - "glance:amqp" + - "rabbitmq-server:amqp" + - - "nova-cloud-controller:image-service" + - "glance:image-service" + - - "nova-compute:image-service" + - "glance:image-service" + - - "nova-cloud-controller:cloud-compute" + - "nova-compute:cloud-compute" + - - "nova-cloud-controller:amqp" + - "rabbitmq-server:amqp" + - - "nova-cloud-controller:quantum-network-service" + - "neutron-gateway:quantum-network-service" + - - "openstack-dashboard:identity-service" + - "keystone:identity-service" + - - "nova-cloud-controller:neutron-api" + - "neutron-api:neutron-api" + - - "neutron-gateway:shared-db" + - "percona-cluster:shared-db" + - - "glance:shared-db" + - "percona-cluster:shared-db" + - - "keystone:shared-db" + - "percona-cluster:shared-db" + - - "nova-cloud-controller:shared-db" + - "percona-cluster:shared-db" + - - "neutron-api:shared-db" + - "percona-cluster:shared-db" + - - "neutron-api:neutron-plugin-api-subordinate" + - "neutron-api-odl:neutron-plugin-api-subordinate" + - - "nova-compute:neutron-plugin" + - "openvswitch-odl:neutron-plugin" + - - "neutron-gateway" + - "openvswitch-odl" + - - "openvswitch-odl:ovsdb-manager" + - "odl-controller:ovsdb-manager" + - - "neutron-api-odl:odl-controller" + - "odl-controller:controller-api" +trusty-liberty-nodes: + inherits: openstack-phase1 + overrides: + series: trusty + +trusty-liberty: + inherits: openstack-phase2 + overrides: + cluster_count: 3 + os-data-network: 10.4.9.0/24 + region: Canonical + source: "cloud:trusty-liberty" + "openstack-origin": "cloud:trusty-liberty" + series: trusty + +trusty-kilo-nodes: + inherits: openstack-phase1 + overrides: + series: trusty + +trusty-kilo: + inherits: openstack-phase2 + overrides: + cluster_count: 3 + os-data-network: 10.4.9.0/24 + region: Canonical + source: "cloud:trusty-kilo" + "openstack-origin": "cloud:trusty-kilo" + series: trusty + + +trusty-juno-nodes: + inherits: openstack-phase1 + overrides: + series: trusty + +trusty-juno: + inherits: openstack-phase2 + overrides: + cluster_count: 3 + os-data-network: 10.4.9.0/24 + region: Canonical + source: "cloud:trusty-juno" + "openstack-origin": "cloud:trusty-juno" + series: trusty + + diff --git a/ci/deployment.yaml b/ci/deployment.yaml new file mode 100755 index 00000000..46857c91 --- /dev/null +++ b/ci/deployment.yaml @@ -0,0 +1,208 @@ +# This file defines the deployment for the MAAS environment which is to be +# deployed and automated. +demo-maas: + maas: + # Defines the general setup for the MAAS environment, including the + # username and password for the host as well as the MAAS server. + user: ubuntu + password: ubuntu + + # Contains the virtual machine parameters for creating the MAAS virtual + # server. Here you can configure the name of the virsh domain, the + # parameters for how the network is attached. + name: opnfv-maas-intel + interfaces: ['bridge=brAdm,model=virtio','bridge=brData,model=virtio','bridge=brPublic,model=virtio'] + memory: 4096 + vcpus: 4 + arch: amd64 + pool: default + disk_size: 160G + + # Apt http proxy setting(s) + apt_http_proxy: + + apt_sources: + - ppa:maas/stable + - ppa:juju/stable + + # Virsh power settings + # Specifies the uri and keys to use for virsh power control of the + # juju virtual machine. If the uri is omitted, the value for the + # --remote is used. If no power settings are desired, then do not + # supply the virsh block. + virsh: + rsa_priv_key: /home/ubuntu/.ssh/id_rsa + rsa_pub_key: /home/ubuntu/.ssh/id_rsa.pub + uri: qemu+ssh://ubuntu@10.4.1.1/system + + # Defines the IP Address that the configuration script will use to + # to access the MAAS controller via SSH. + ip_address: 10.4.1.2 + + # This section allows the user to set a series of options on the + # MAAS server itself. The list of config options can be found in + # the upstream MAAS documentation: + # - http://maas.ubuntu.com/docs/api.html#maas-server + settings: + main_archive: http://us.archive.ubuntu.com/ubuntu + upstream_dns: 10.4.0.2 + maas_name: intelpod5 + # kernel_opts: "console=tty0 console=ttyS1,115200n8" + # ntp_server: ntp.ubuntu.com + + # This section is used to define the networking parameters for when + # the node first comes up. It is fed into the meta-data cloud-init + # configuration and is used to configure the networking piece of the + # service. The contents of this section are written directly to the + # /etc/network/interfaces file. + # + # Please note, this is slightly different than the + # node-group-interfaces section below. This will configure the + # machine's networking params, and the node-group-interfaces will + # configure the maas node-group interfaces which is used for + # controlling the dhcp, dns, etc. + network_config: | + auto lo + iface lo inet loopback + + auto eth0 + iface eth0 inet static + address 10.4.1.2 + netmask 255.255.248.0 + network 10.4.0.0 + broadcast 10.4.7.255 + gateway 10.4.0.1 + dns-nameservers 10.4.0.2 127.0.0.1 + + auto eth1 + iface eth1 inet static + address 10.4.9.2 + netmask 255.255.248.0 + network 10.4.8.0 + broadcast 10.4.15.255 + + #auto lo + #iface lo inet loopback + + #auto eth0 + #iface eth0 inet static + # address 192.168.122.2 + # netmask 255.255.248.0 + # network 192.168.122.0 + # broadcast 192.168.122.255 + # gateway 192.168.122.1 + # dns-nameservers 192.168.122.1 127.0.0.1 + + # The node-group-interfaces section is used to configure the MAAS + # network interfaces. Basic configuration is supported, such as which + # device should be bound, the range of IP addresses, etc. + # Note: this may contain the special identifiers: + # ${maas_net} - the first 3 octets of the ipv4 address + # ${maas_ip} - the ip address of the MAAS controller + node_group_ifaces: + - device: eth0 + ip: 10.4.1.2 + subnet_mask: 255.255.248.0 + broadcast_ip: 10.4.7.255 + router_ip: 10.4.0.1 + static_range: + low: 10.4.2.20 + high: 10.4.2.254 + dynamic_range: + low: 10.4.1.50 + high: 10.4.1.254 + + # Defines the physical nodes which are added to the MAAS cluster + # controller upon startup of the node. + nodes: + - name: node5-compute + tags: compute + architecture: amd64/generic + mac_addresses: + - "00:1e:67:e0:0a:4a" + - "00:1e:67:e0:0a:4b" + - "00:1e:67:d0:9a:10" + - "00:1e:67:d0:9a:11" + power: + type: ipmi + address: 10.4.7.5 + user: root + pass: root + driver: LAN_2_0 +# sticky_ip_address: +# mac_address: "38:63:bb:43:b8:9c" +# requested_address: 192.168.122.5 + + - name: node4-control + tags: control + architecture: amd64/generic + mac_addresses: + - "00:1e:67:e0:08:b0" + - "00:1e:67:e0:08:b1" + - "00:1e:67:d0:99:ee" + - "00:1e:67:d0:99:ef" + power: + type: ipmi + address: 10.4.7.4 + user: root + pass: root + driver: LAN_2_0 +# sticky_ip_address: +# mac_address: "38:63:bb:43:b8:9c" +# requested_address: 192.168.122.5 + + - name: node3-control + tags: control + architecture: amd64/generic + mac_addresses: + - "00:1e:67:e0:08:7e" + - "00:1e:67:e0:08:7f" + - "00:1e:67:c2:23:d8" + - "00:1e:67:c2:23:d9" + power: + type: ipmi + address: 10.4.7.3 + user: root + pass: root + driver: LAN_2_0 +# sticky_ip_address: +# mac_address: "38:63:bb:43:b8:9c" +# requested_address: 192.168.122.5 + + - name: node2-control + tags: control + architecture: amd64/generic + mac_addresses: + - "00:1e:67:cf:b8:92" + - "00:1e:67:cf:b8:93" + - "00:1e:67:d0:9b:0c" + - "00:1e:67:d0:9b:0d" + power: + type: ipmi + address: 10.4.7.2 + user: root + pass: root + driver: LAN_2_0 +# sticky_ip_address: +# mac_address: "38:63:bb:43:b8:9c" +# requested_address: 192.168.122.5 + +# - name: jenkins-slave +# tags: jenkins-slave +# architecture: amd64/generic +# mac_addresses: +# - "52:54:00:f0:5c:53" +# power: +# type: virsh +# address: qemu+ssh://ubuntu@10.4.1.1/system + + # Contains the virtual machine parameters for creating the Juju bootstrap + # node virtual machine + juju-bootstrap: + name: bootstrap + interfaces: ['bridge=brAdm,model=virtio'] + memory: 4096 + vcpus: 4 + arch: amd64 + pool: default + disk_size: 120G diff --git a/ci/maas/intel/pod5/deployment.yaml b/ci/maas/intel/pod5/deployment.yaml index a44d7a45..bacf6aa5 100755 --- a/ci/maas/intel/pod5/deployment.yaml +++ b/ci/maas/intel/pod5/deployment.yaml @@ -11,9 +11,9 @@ demo-maas: # server. Here you can configure the name of the virsh domain, the # parameters for how the network is attached. name: opnfv-maas-intel - interfaces: ['bridge=br0,model=virtio'] + interfaces: ['bridge=brAdm,model=virtio','bridge=brData,model=virtio','bridge=brPublic,model=virtio'] memory: 4096 - vcpus: 2 + vcpus: 4 arch: amd64 pool: default disk_size: 160G @@ -74,6 +74,19 @@ demo-maas: gateway 10.4.0.1 dns-nameservers 10.4.0.2 127.0.0.1 + auto eth1 + iface eth1 inet static + address 10.4.9.2 + netmask 255.255.248.0 + network 10.4.8.0 + broadcast 10.4.15.255 + + auto eth2 + iface eth2 inet static + address 10.2.65.3 + netmask 255.255.255.0 + network 10.2.65.0 + broadcast 10.2.65.255 #auto lo #iface lo inet loopback @@ -104,7 +117,28 @@ demo-maas: dynamic_range: low: 10.4.1.50 high: 10.4.1.254 - + - device: eth1 + ip: 10.4.9.2 + subnet_mask: 255.255.255.0 + broadcast_ip: 10.4.9.255 + management: 1 + static_range: + low: 10.4.9.20 + high: 10.4.9.100 + dynamic_range: + low: 10.4.9.101 + high: 10.4.9.200 + - device: eth2 + ip: 10.2.65.3 + subnet_mask: 255.255.255.0 + broadcast_ip: 10.2.65.255 + management: 1 + static_range: + low: 10.2.65.20 + high: 10.2.65.100 + dynamic_range: + low: 10.2.65.101 + high: 10.2.65.200 # Defines the physical nodes which are added to the MAAS cluster # controller upon startup of the node. nodes: @@ -193,9 +227,9 @@ demo-maas: # node virtual machine juju-bootstrap: name: bootstrap - interfaces: ['bridge=br0,model=virtio'] + interfaces: ['bridge=brAdm,model=virtio','bridge=brData,model=virtio','bridge=brPublic,model=virtio'] memory: 4096 - vcpus: 2 + vcpus: 4 arch: amd64 pool: default disk_size: 120G diff --git a/ci/maas/intel/pod5/environment.yaml b/ci/maas/intel/pod5/environment.yaml deleted file mode 100644 index e5b539ca..00000000 --- a/ci/maas/intel/pod5/environment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -default: demo-maas -environments: - # https://juju.ubuntu.com/docs/config-maas.html - maas: - type: maas - - # maas-server specifies the location of the MAAS server. It must - # specify the base path. - # - maas-server: 'http://10.4.1.1/MAAS/' - - # maas-oauth holds the OAuth credentials from MAAS. - # - maas-oauth: 'c6tcQz4tyS3ALajCtF:sqcWhw8MkxTjUDLZrm:hBhszBLv5EqrY8h6yktFXWUT5825ShvE' - - # maas-server bootstrap ssh connection options - # - - # bootstrap-timeout time to wait contacting a state server, in seconds. - bootstrap-timeout: 1800 - admin-secret: admin - - # Whether or not to refresh the list of available updates for an - # OS. The default option of true is recommended for use in - # production systems, but disabling this can speed up local - # deployments for development or testing. - # - enable-os-refresh-update: false - - # Whether or not to perform OS upgrades when machines are - # provisioned. The default option of true is recommended for use - # in production systems, but disabling this can speed up local - # deployments for development or testing. - # - enable-os-upgrade: false - diff --git a/ci/maas/intel/pod5/interfaces.host b/ci/maas/intel/pod5/interfaces.host new file mode 100644 index 00000000..9377814c --- /dev/null +++ b/ci/maas/intel/pod5/interfaces.host @@ -0,0 +1,36 @@ +#### original juju generated part #### +auto lo + +# Primary interface (defining the default route) +iface eth0 inet manual + +# Bridge to use for LXC/KVM containers +auto juju-br0 +iface juju-br0 inet dhcp + bridge_ports eth0 +###################################### + +auto eth2 +iface eth2 inet manual + +auto eth2.721 +iface eth2.721 inet manual + +auto brData +iface brData inet dhcp + bridge_ports eth2.721 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + +# The public network interface +auto eth2.724 +iface eth2.724 inet manual + +auto brPublic +iface brPublic inet dhcp + bridge_ports eth2.724 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + diff --git a/ci/maas/intel/pod5/lxc-add-more-interfaces b/ci/maas/intel/pod5/lxc-add-more-interfaces new file mode 100755 index 00000000..c9bca9fd --- /dev/null +++ b/ci/maas/intel/pod5/lxc-add-more-interfaces @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e +set -u + +cat <> "$LXC_CONFIG_FILE" + +## added by juju charm +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brData +lxc.network.name = eth1 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') + +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brPublic +lxc.network.name = eth2 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') +EOF + +USERDATA="$LXC_ROOTFS_PATH/var/lib/cloud/seed/nocloud-net/user-data" + +additional_interfaces=" +- | + cat <> /etc/network/interfaces.d/additional-interfaces + ## added by juju charm + ## those interfaces will be brought up by the upstart job as /etc/init/additional-interfaces.conf + ## LP: #1483932 + auto eth1 + iface eth1 inet dhcp + + auto eth2 + iface eth2 inet dhcp + EOF +- machine_agent=\$(hostname | sed -e 's/^juju-/jujud-/') +- | + cat < /etc/init/additional-interfaces.conf + ## added by juju charm + ## LP: #1483932 + start on started \${machine_agent} + + script + sleep 10 + ifup -a -i /etc/network/interfaces.d/additional-interfaces + end script + EOF +" +additional_interfaces=$(echo "$additional_interfaces" | sed -e 's/$/\\n/' | tr -d '\n') + +sed -i.orig -e "s@^runcmd:@\0$additional_interfaces@" \ + "$USERDATA" diff --git a/ci/maas/intel/pod6/deployment.yaml b/ci/maas/intel/pod6/deployment.yaml index 74c1a004..523f3dd3 100755 --- a/ci/maas/intel/pod6/deployment.yaml +++ b/ci/maas/intel/pod6/deployment.yaml @@ -13,7 +13,7 @@ demo-maas: name: opnfv-maas-intel interfaces: ['bridge=brAdm,model=virtio', 'bridge=brData,model=virtio', 'bridge=brPublic,model=virtio'] memory: 4096 - vcpus: 2 + vcpus: 4 arch: amd64 pool: default disk_size: 160G @@ -79,10 +79,10 @@ demo-maas: address 10.4.9.2 netmask 255.255.248.0 -# auto eth2 -# iface eth2 inet static -# address 10.2.66.3 -# netmask 255.255.255.0 + auto eth2 + iface eth2 inet static + address 10.2.66.3 + netmask 255.255.255.0 #auto lo #iface lo inet loopback @@ -114,26 +114,28 @@ demo-maas: dynamic_range: low: 10.4.1.50 high: 10.4.1.254 -# - device: eth1 -# ip: 10.4.9.2 -# subnet_mask: 255.255.248.0 -# broadcast_ip: 10.4.15.255 -# static_range: -# low: 10.4.9.20 -# high: 10.4.9.150 -# dynamic_range: -# low: 10.4.9.151 -# high: 10.4.9.200 -# - device: eth2 -# ip: 10.2.66.3 -# subnet_mask: 255.255.255.0 -# broadcast_ip: 10.2.66.255 -# static_range: -# low: 10.2.66.20 -# high: 10.2.66.150 -# dynamic_range: -# low: 10.2.66.151 -# high: 10.2.66.200 + - device: eth1 + ip: 10.4.9.2 + subnet_mask: 255.255.255.0 + broadcast_ip: 10.4.9.255 + management: 1 + static_range: + low: 10.4.9.20 + high: 10.4.9.150 + dynamic_range: + low: 10.4.9.151 + high: 10.4.9.200 + - device: eth2 + ip: 10.2.66.3 + subnet_mask: 255.255.255.0 + broadcast_ip: 10.2.66.255 + management: 1 + static_range: + low: 10.2.66.20 + high: 10.2.66.150 + dynamic_range: + low: 10.2.66.151 + high: 10.2.66.200 # Defines the physical nodes which are added to the MAAS cluster # controller upon startup of the node. @@ -243,7 +245,7 @@ demo-maas: name: bootstrap interfaces: ['bridge=brAdm,model=virtio', 'bridge=brData,model=virtio', 'bridge=brPublic,model=virtio'] memory: 4096 - vcpus: 2 + vcpus: 4 arch: amd64 pool: default disk_size: 120G diff --git a/ci/maas/intel/pod6/interfaces.host b/ci/maas/intel/pod6/interfaces.host new file mode 100644 index 00000000..86cdd056 --- /dev/null +++ b/ci/maas/intel/pod6/interfaces.host @@ -0,0 +1,33 @@ +#### original juju generated part #### +auto lo + +# Primary interface (defining the default route) +iface eth0 inet manual + +# Bridge to use for LXC/KVM containers +auto juju-br0 +iface juju-br0 inet dhcp + bridge_ports eth0 +###################################### + +auto eth1 +iface eth1 inet manual + +auto brData +iface brData inet dhcp + bridge_ports eth1 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + +# The public network interface +auto eth2 +iface eth2 inet manual + +auto brPublic +iface brPublic inet dhcp + bridge_ports eth2 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + diff --git a/ci/maas/intel/pod6/lxc-add-more-interfaces b/ci/maas/intel/pod6/lxc-add-more-interfaces new file mode 100755 index 00000000..c9bca9fd --- /dev/null +++ b/ci/maas/intel/pod6/lxc-add-more-interfaces @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e +set -u + +cat <> "$LXC_CONFIG_FILE" + +## added by juju charm +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brData +lxc.network.name = eth1 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') + +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brPublic +lxc.network.name = eth2 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') +EOF + +USERDATA="$LXC_ROOTFS_PATH/var/lib/cloud/seed/nocloud-net/user-data" + +additional_interfaces=" +- | + cat <> /etc/network/interfaces.d/additional-interfaces + ## added by juju charm + ## those interfaces will be brought up by the upstart job as /etc/init/additional-interfaces.conf + ## LP: #1483932 + auto eth1 + iface eth1 inet dhcp + + auto eth2 + iface eth2 inet dhcp + EOF +- machine_agent=\$(hostname | sed -e 's/^juju-/jujud-/') +- | + cat < /etc/init/additional-interfaces.conf + ## added by juju charm + ## LP: #1483932 + start on started \${machine_agent} + + script + sleep 10 + ifup -a -i /etc/network/interfaces.d/additional-interfaces + end script + EOF +" +additional_interfaces=$(echo "$additional_interfaces" | sed -e 's/$/\\n/' | tr -d '\n') + +sed -i.orig -e "s@^runcmd:@\0$additional_interfaces@" \ + "$USERDATA" diff --git a/ci/maas/orange/pod2/compute-interfaces.host b/ci/maas/orange/pod2/compute-interfaces.host new file mode 100644 index 00000000..28c22feb --- /dev/null +++ b/ci/maas/orange/pod2/compute-interfaces.host @@ -0,0 +1,23 @@ +#### original juju generated part #### +auto lo + +# Primary interface (defining the default route) +iface eth0 inet manual + +# Bridge to use for LXC/KVM containers +auto juju-br0 +iface juju-br0 inet dhcp + bridge_ports eth0 +###################################### + +#data network for VM on openstack +auto eth5 +iface eth5 inet manual + +auto brData +iface brData inet dhcp + bridge_ports eth5 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + diff --git a/ci/maas/orange/pod2/control-interfaces.host b/ci/maas/orange/pod2/control-interfaces.host new file mode 100644 index 00000000..ba8b29cb --- /dev/null +++ b/ci/maas/orange/pod2/control-interfaces.host @@ -0,0 +1,23 @@ +#### original juju generated part #### +auto lo + +# Primary interface (defining the default route) +iface eth0 inet manual + +# Bridge to use for LXC/KVM containers +auto juju-br0 +iface juju-br0 inet dhcp + bridge_ports eth0 +###################################### + +#data network for VM on openstack +auto eth3 +iface eth3 inet manual + +auto brData +iface brData inet dhcp + bridge_ports eth3 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + diff --git a/ci/maas/orange/pod2/deployment.yaml b/ci/maas/orange/pod2/deployment.yaml index 86a3c144..9541a002 100755 --- a/ci/maas/orange/pod2/deployment.yaml +++ b/ci/maas/orange/pod2/deployment.yaml @@ -122,6 +122,7 @@ demo-maas: ip: 192.168.12.5 subnet_mask: 255.255.255.0 broadcast_ip: 192.168.12.255 + management: 1 static_range: low: 192.168.12.50 high: 192.168.12.150 @@ -132,6 +133,7 @@ demo-maas: ip: 192.168.22.5 subnet_mask: 255.255.255.0 broadcast_ip: 192.168.22.255 + management: 1 static_range: low: 192.168.22.50 high: 192.168.22.150 diff --git a/ci/maas/orange/pod2/interfaces.host b/ci/maas/orange/pod2/interfaces.host new file mode 100644 index 00000000..9377814c --- /dev/null +++ b/ci/maas/orange/pod2/interfaces.host @@ -0,0 +1,36 @@ +#### original juju generated part #### +auto lo + +# Primary interface (defining the default route) +iface eth0 inet manual + +# Bridge to use for LXC/KVM containers +auto juju-br0 +iface juju-br0 inet dhcp + bridge_ports eth0 +###################################### + +auto eth2 +iface eth2 inet manual + +auto eth2.721 +iface eth2.721 inet manual + +auto brData +iface brData inet dhcp + bridge_ports eth2.721 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + +# The public network interface +auto eth2.724 +iface eth2.724 inet manual + +auto brPublic +iface brPublic inet dhcp + bridge_ports eth2.724 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + diff --git a/ci/maas/orange/pod2/lxc-add-more-interfaces b/ci/maas/orange/pod2/lxc-add-more-interfaces new file mode 100755 index 00000000..a22901a0 --- /dev/null +++ b/ci/maas/orange/pod2/lxc-add-more-interfaces @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e +set -u + +cat <> "$LXC_CONFIG_FILE" + +## added by juju charm +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brData +lxc.network.name = eth1 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') +EOF + +USERDATA="$LXC_ROOTFS_PATH/var/lib/cloud/seed/nocloud-net/user-data" + +additional_interfaces=" +- | + cat <> /etc/network/interfaces.d/additional-interfaces + ## added by juju charm + ## those interfaces will be brought up by the upstart job as /etc/init/additional-interfaces.conf + ## LP: #1483932 + auto eth1 + iface eth1 inet dhcp + EOF +- machine_agent=\$(hostname | sed -e 's/^juju-/jujud-/') +- | + cat < /etc/init/additional-interfaces.conf + ## added by juju charm + ## LP: #1483932 + start on started \${machine_agent} + + script + sleep 10 + ifup -a -i /etc/network/interfaces.d/additional-interfaces + end script + EOF +" +additional_interfaces=$(echo "$additional_interfaces" | sed -e 's/$/\\n/' | tr -d '\n') + +sed -i.orig -e "s@^runcmd:@\0$additional_interfaces@" \ + "$USERDATA" diff --git a/ci/odl/01-deploybundle.sh b/ci/odl/01-deploybundle.sh index 4fdfe808..fee0a515 100755 --- a/ci/odl/01-deploybundle.sh +++ b/ci/odl/01-deploybundle.sh @@ -19,39 +19,49 @@ esac case "$3" in 'orangepod2' ) + cp maas/orange/pod2/control-interfaces.host trusty/ubuntu-nodes-controller/network/interfaces.host + cp maas/orange/pod2/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces + cp maas/orange/pod2/compute-interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host + cp maas/orange/pod2/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces sed -i -- 's/10.4.1.1/192.168.2.2/g' ./bundles.yaml + sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.12.0\/24/g' ./bundles.yaml ;; 'intelpod6' ) + cp maas/intel/pod6/interfaces.host trusty/ubuntu-nodes-controller/network/interfaces.host + cp maas/intel/pod6/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces + cp maas/intel/pod6/interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host + cp maas/intel/pod6/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces sed -i -- 's/10.4.1.1/10.4.1.2/g' ./bundles.yaml - sed -i -- 's/#os-data-network/os-data-network/g' ./bundles.yaml + sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.4.9.0\/24/g' ./bundles.yaml ;; 'intelpod5' ) + cp maas/intel/pod5/interfaces.host trusty/ubuntu-nodes-controller/network/interfaces.host + cp maas/intel/pod5/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces + cp maas/intel/pod5/interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host + cp maas/intel/pod5/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces sed -i -- 's/10.4.1.1/10.4.1.2/g' ./bundles.yaml - sed -i -- 's/#os-data-network/os-data-network/g' ./bundles.yaml + sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.4.9.0\/24/g' ./bundles.yaml ;; esac echo "... Deployment Started ...." case "$1" in + 'nonha' ) + juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes + juju-deployer -vW -d -c bundles.yaml trusty-"$2" + ;; 'ha' ) juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes - case "$3" in - 'orangepod2' ) - juju run --service nodes-api 'sudo ifup eth3' - juju run --service nodes-compute 'sudo ifup eth5' - ;; - 'intelpod6' ) - juju run --service nodes-api 'sudo ifup eth1' - juju run --service nodes-compute 'sudo ifup eth1' - ;; - 'intelpod5' ) - juju run --service nodes-api 'sudo ifup eth1' - juju run --service nodes-compute 'sudo ifup eth1' - ;; - esac + juju-deployer -vW -d -c bundles.yaml trusty-"$2" + ;; + 'tip' ) + juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes + juju-deployer -vW -d -c bundles.yaml trusty-"$2" + ;; + * ) + juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes + juju-deployer -vW -d -c bundles.yaml trusty-"$2" ;; esac -juju-deployer -vW -d -c bundles.yaml trusty-"$2" - echo "... Deployment finished ...." diff --git a/ci/odl/juju-deployer/ovs-odl-ha.yaml b/ci/odl/juju-deployer/ovs-odl-ha.yaml index 35372d68..27a10d6f 100644 --- a/ci/odl/juju-deployer/ovs-odl-ha.yaml +++ b/ci/odl/juju-deployer/ovs-odl-ha.yaml @@ -3,11 +3,11 @@ openstack-phase1: series: trusty services: nodes-api: - branch: "lp:charms/trusty/ubuntu" + charm: "local:trusty/ubuntu-nodes-controller" num_units: 3 constraints: tags=control nodes-compute: - branch: "lp:charms/trusty/ubuntu" + charm: "local:trusty/ubuntu-nodes-compute" num_units: 1 constraints: tags=compute "ntp": @@ -132,7 +132,7 @@ openstack-phase2: # num_units: 3 # constraints: tags=gateway options: -# "ext-port": eth1 +# "ext-port": "eth1" plugin: ovs-odl # instance-mtu: 1400 to: @@ -141,9 +141,9 @@ openstack-phase2: branch: lp:~narindergupta/charms/trusty/odl-controller/liberty options: install-url: "https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.4-Helium-SR4/distribution-karaf-0.2.4-Helium-SR4.tar.gz" - # to: lxc:nodes-api=1 +# install-url: "https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.3.2-Lithium-SR2/distribution-karaf-0.3.2-Lithium-SR2.tar.gz" to: - - "nodes-api=0" + - "lxc:nodes-api=1" "glance": charm: "cs:trusty/glance" num_units: 3 diff --git a/ci/trusty/ubuntu-nodes-compute/README b/ci/trusty/ubuntu-nodes-compute/README new file mode 100644 index 00000000..1a73633f --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/README @@ -0,0 +1,3 @@ +You need to edit: + * network/interfaces.host + * lxc/add-more-interfaces diff --git a/ci/trusty/ubuntu-nodes-compute/copyright b/ci/trusty/ubuntu-nodes-compute/copyright new file mode 100644 index 00000000..43e04d48 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/copyright @@ -0,0 +1,17 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: * +Copyright: Copyright 2012, Canonical Ltd., All Rights Reserved. +License: GPL-3 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . diff --git a/ci/trusty/ubuntu-nodes-compute/hooks/install b/ci/trusty/ubuntu-nodes-compute/hooks/install new file mode 100755 index 00000000..17265f56 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/hooks/install @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e +set -u + +## install lxc pre-configuration to setup multiple interfaces +status-set maintenance "setting up lxc clone hook" || true +mkdir -p /usr/local/share/lxc/hooks/ +install -m 755 lxc/add-more-interfaces /usr/local/share/lxc/hooks/ + +dpkg-divert --local \ + --divert /usr/share/lxc/config/ubuntu-cloud.trusty.conf.ubuntu.orig \ + --add /usr/share/lxc/config/ubuntu-cloud.trusty.conf +mkdir -p /usr/share/lxc/config/ +install -m 644 lxc/ubuntu-cloud.trusty.conf /usr/share/lxc/config/ + +## network interfaces +status-set maintenance "setting up network interfaces" || true +apt-get update || true +apt-get install -y ifenslave ethtool bridge-utils vlan + +if ! grep -q 8021q /etc/modules; then + echo 8021q >> /etc/modules +fi + +## write /etc/network/interfaces for the host +install -m 644 network/interfaces.host /etc/network/interfaces +ifup -a + +status-set active || true diff --git a/ci/trusty/ubuntu-nodes-compute/icon.svg b/ci/trusty/ubuntu-nodes-compute/icon.svg new file mode 100644 index 00000000..a5576ed2 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/icon.svg @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/ci/trusty/ubuntu-nodes-compute/lxc/add-more-interface b/ci/trusty/ubuntu-nodes-compute/lxc/add-more-interface new file mode 100755 index 00000000..c9bca9fd --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/lxc/add-more-interface @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e +set -u + +cat <> "$LXC_CONFIG_FILE" + +## added by juju charm +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brData +lxc.network.name = eth1 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') + +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brPublic +lxc.network.name = eth2 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') +EOF + +USERDATA="$LXC_ROOTFS_PATH/var/lib/cloud/seed/nocloud-net/user-data" + +additional_interfaces=" +- | + cat <> /etc/network/interfaces.d/additional-interfaces + ## added by juju charm + ## those interfaces will be brought up by the upstart job as /etc/init/additional-interfaces.conf + ## LP: #1483932 + auto eth1 + iface eth1 inet dhcp + + auto eth2 + iface eth2 inet dhcp + EOF +- machine_agent=\$(hostname | sed -e 's/^juju-/jujud-/') +- | + cat < /etc/init/additional-interfaces.conf + ## added by juju charm + ## LP: #1483932 + start on started \${machine_agent} + + script + sleep 10 + ifup -a -i /etc/network/interfaces.d/additional-interfaces + end script + EOF +" +additional_interfaces=$(echo "$additional_interfaces" | sed -e 's/$/\\n/' | tr -d '\n') + +sed -i.orig -e "s@^runcmd:@\0$additional_interfaces@" \ + "$USERDATA" diff --git a/ci/trusty/ubuntu-nodes-compute/lxc/add-more-interfaces b/ci/trusty/ubuntu-nodes-compute/lxc/add-more-interfaces new file mode 100755 index 00000000..c9bca9fd --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/lxc/add-more-interfaces @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e +set -u + +cat <> "$LXC_CONFIG_FILE" + +## added by juju charm +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brData +lxc.network.name = eth1 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') + +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brPublic +lxc.network.name = eth2 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') +EOF + +USERDATA="$LXC_ROOTFS_PATH/var/lib/cloud/seed/nocloud-net/user-data" + +additional_interfaces=" +- | + cat <> /etc/network/interfaces.d/additional-interfaces + ## added by juju charm + ## those interfaces will be brought up by the upstart job as /etc/init/additional-interfaces.conf + ## LP: #1483932 + auto eth1 + iface eth1 inet dhcp + + auto eth2 + iface eth2 inet dhcp + EOF +- machine_agent=\$(hostname | sed -e 's/^juju-/jujud-/') +- | + cat < /etc/init/additional-interfaces.conf + ## added by juju charm + ## LP: #1483932 + start on started \${machine_agent} + + script + sleep 10 + ifup -a -i /etc/network/interfaces.d/additional-interfaces + end script + EOF +" +additional_interfaces=$(echo "$additional_interfaces" | sed -e 's/$/\\n/' | tr -d '\n') + +sed -i.orig -e "s@^runcmd:@\0$additional_interfaces@" \ + "$USERDATA" diff --git a/ci/trusty/ubuntu-nodes-compute/lxc/ubuntu-cloud.trusty.conf b/ci/trusty/ubuntu-nodes-compute/lxc/ubuntu-cloud.trusty.conf new file mode 100644 index 00000000..b7636b58 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/lxc/ubuntu-cloud.trusty.conf @@ -0,0 +1,2 @@ +## added by juju charm +lxc.hook.clone = /usr/local/share/lxc/hooks/add-more-interfaces diff --git a/ci/trusty/ubuntu-nodes-compute/metadata.yaml b/ci/trusty/ubuntu-nodes-compute/metadata.yaml new file mode 100644 index 00000000..8a57c088 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/metadata.yaml @@ -0,0 +1,7 @@ +name: ubuntu-nodes-controller +summary: A pristine Ubuntu Server +maintainer: Charmers +description: | + This simply deploys Ubuntu Server. +tags: + - misc diff --git a/ci/trusty/ubuntu-nodes-compute/network/interfaces.host b/ci/trusty/ubuntu-nodes-compute/network/interfaces.host new file mode 100644 index 00000000..9377814c --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/network/interfaces.host @@ -0,0 +1,36 @@ +#### original juju generated part #### +auto lo + +# Primary interface (defining the default route) +iface eth0 inet manual + +# Bridge to use for LXC/KVM containers +auto juju-br0 +iface juju-br0 inet dhcp + bridge_ports eth0 +###################################### + +auto eth2 +iface eth2 inet manual + +auto eth2.721 +iface eth2.721 inet manual + +auto brData +iface brData inet dhcp + bridge_ports eth2.721 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + +# The public network interface +auto eth2.724 +iface eth2.724 inet manual + +auto brPublic +iface brPublic inet dhcp + bridge_ports eth2.724 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + diff --git a/ci/trusty/ubuntu-nodes-compute/revision b/ci/trusty/ubuntu-nodes-compute/revision new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/ci/trusty/ubuntu-nodes-compute/revision @@ -0,0 +1 @@ +1 diff --git a/ci/trusty/ubuntu-nodes-controller/README b/ci/trusty/ubuntu-nodes-controller/README new file mode 100644 index 00000000..1a73633f --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/README @@ -0,0 +1,3 @@ +You need to edit: + * network/interfaces.host + * lxc/add-more-interfaces diff --git a/ci/trusty/ubuntu-nodes-controller/copyright b/ci/trusty/ubuntu-nodes-controller/copyright new file mode 100644 index 00000000..43e04d48 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/copyright @@ -0,0 +1,17 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: * +Copyright: Copyright 2012, Canonical Ltd., All Rights Reserved. +License: GPL-3 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . diff --git a/ci/trusty/ubuntu-nodes-controller/hooks/install b/ci/trusty/ubuntu-nodes-controller/hooks/install new file mode 100755 index 00000000..17265f56 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/hooks/install @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e +set -u + +## install lxc pre-configuration to setup multiple interfaces +status-set maintenance "setting up lxc clone hook" || true +mkdir -p /usr/local/share/lxc/hooks/ +install -m 755 lxc/add-more-interfaces /usr/local/share/lxc/hooks/ + +dpkg-divert --local \ + --divert /usr/share/lxc/config/ubuntu-cloud.trusty.conf.ubuntu.orig \ + --add /usr/share/lxc/config/ubuntu-cloud.trusty.conf +mkdir -p /usr/share/lxc/config/ +install -m 644 lxc/ubuntu-cloud.trusty.conf /usr/share/lxc/config/ + +## network interfaces +status-set maintenance "setting up network interfaces" || true +apt-get update || true +apt-get install -y ifenslave ethtool bridge-utils vlan + +if ! grep -q 8021q /etc/modules; then + echo 8021q >> /etc/modules +fi + +## write /etc/network/interfaces for the host +install -m 644 network/interfaces.host /etc/network/interfaces +ifup -a + +status-set active || true diff --git a/ci/trusty/ubuntu-nodes-controller/icon.svg b/ci/trusty/ubuntu-nodes-controller/icon.svg new file mode 100644 index 00000000..a5576ed2 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/icon.svg @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/ci/trusty/ubuntu-nodes-controller/lxc/add-more-interface b/ci/trusty/ubuntu-nodes-controller/lxc/add-more-interface new file mode 100755 index 00000000..c9bca9fd --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/lxc/add-more-interface @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e +set -u + +cat <> "$LXC_CONFIG_FILE" + +## added by juju charm +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brData +lxc.network.name = eth1 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') + +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brPublic +lxc.network.name = eth2 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') +EOF + +USERDATA="$LXC_ROOTFS_PATH/var/lib/cloud/seed/nocloud-net/user-data" + +additional_interfaces=" +- | + cat <> /etc/network/interfaces.d/additional-interfaces + ## added by juju charm + ## those interfaces will be brought up by the upstart job as /etc/init/additional-interfaces.conf + ## LP: #1483932 + auto eth1 + iface eth1 inet dhcp + + auto eth2 + iface eth2 inet dhcp + EOF +- machine_agent=\$(hostname | sed -e 's/^juju-/jujud-/') +- | + cat < /etc/init/additional-interfaces.conf + ## added by juju charm + ## LP: #1483932 + start on started \${machine_agent} + + script + sleep 10 + ifup -a -i /etc/network/interfaces.d/additional-interfaces + end script + EOF +" +additional_interfaces=$(echo "$additional_interfaces" | sed -e 's/$/\\n/' | tr -d '\n') + +sed -i.orig -e "s@^runcmd:@\0$additional_interfaces@" \ + "$USERDATA" diff --git a/ci/trusty/ubuntu-nodes-controller/lxc/add-more-interfaces b/ci/trusty/ubuntu-nodes-controller/lxc/add-more-interfaces new file mode 100755 index 00000000..c9bca9fd --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/lxc/add-more-interfaces @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e +set -u + +cat <> "$LXC_CONFIG_FILE" + +## added by juju charm +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brData +lxc.network.name = eth1 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') + +lxc.network.type = veth +lxc.network.flags = up +lxc.network.link = brPublic +lxc.network.name = eth2 +lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//') +EOF + +USERDATA="$LXC_ROOTFS_PATH/var/lib/cloud/seed/nocloud-net/user-data" + +additional_interfaces=" +- | + cat <> /etc/network/interfaces.d/additional-interfaces + ## added by juju charm + ## those interfaces will be brought up by the upstart job as /etc/init/additional-interfaces.conf + ## LP: #1483932 + auto eth1 + iface eth1 inet dhcp + + auto eth2 + iface eth2 inet dhcp + EOF +- machine_agent=\$(hostname | sed -e 's/^juju-/jujud-/') +- | + cat < /etc/init/additional-interfaces.conf + ## added by juju charm + ## LP: #1483932 + start on started \${machine_agent} + + script + sleep 10 + ifup -a -i /etc/network/interfaces.d/additional-interfaces + end script + EOF +" +additional_interfaces=$(echo "$additional_interfaces" | sed -e 's/$/\\n/' | tr -d '\n') + +sed -i.orig -e "s@^runcmd:@\0$additional_interfaces@" \ + "$USERDATA" diff --git a/ci/trusty/ubuntu-nodes-controller/lxc/ubuntu-cloud.trusty.conf b/ci/trusty/ubuntu-nodes-controller/lxc/ubuntu-cloud.trusty.conf new file mode 100644 index 00000000..b7636b58 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/lxc/ubuntu-cloud.trusty.conf @@ -0,0 +1,2 @@ +## added by juju charm +lxc.hook.clone = /usr/local/share/lxc/hooks/add-more-interfaces diff --git a/ci/trusty/ubuntu-nodes-controller/metadata.yaml b/ci/trusty/ubuntu-nodes-controller/metadata.yaml new file mode 100644 index 00000000..8a57c088 --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/metadata.yaml @@ -0,0 +1,7 @@ +name: ubuntu-nodes-controller +summary: A pristine Ubuntu Server +maintainer: Charmers +description: | + This simply deploys Ubuntu Server. +tags: + - misc diff --git a/ci/trusty/ubuntu-nodes-controller/network/interfaces.host b/ci/trusty/ubuntu-nodes-controller/network/interfaces.host new file mode 100644 index 00000000..9377814c --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/network/interfaces.host @@ -0,0 +1,36 @@ +#### original juju generated part #### +auto lo + +# Primary interface (defining the default route) +iface eth0 inet manual + +# Bridge to use for LXC/KVM containers +auto juju-br0 +iface juju-br0 inet dhcp + bridge_ports eth0 +###################################### + +auto eth2 +iface eth2 inet manual + +auto eth2.721 +iface eth2.721 inet manual + +auto brData +iface brData inet dhcp + bridge_ports eth2.721 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + +# The public network interface +auto eth2.724 +iface eth2.724 inet manual + +auto brPublic +iface brPublic inet dhcp + bridge_ports eth2.724 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + diff --git a/ci/trusty/ubuntu-nodes-controller/revision b/ci/trusty/ubuntu-nodes-controller/revision new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/ci/trusty/ubuntu-nodes-controller/revision @@ -0,0 +1 @@ +1 -- cgit 1.2.3-korg