From d7594dc920fc00fb99353d92dc95f4e0fec2cf6d Mon Sep 17 00:00:00 2001 From: VanderChen Date: Mon, 18 Apr 2022 16:07:01 +0800 Subject: [PATCH 01/10] Add LXD yaml file for DPM --- services/data_plane_manager/lxd.yaml | 207 +++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 services/data_plane_manager/lxd.yaml diff --git a/services/data_plane_manager/lxd.yaml b/services/data_plane_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/data_plane_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file From 347505271d554493aa0bc46b9bf2812df53a558e Mon Sep 17 00:00:00 2001 From: VanderChen Date: Tue, 26 Apr 2022 00:38:00 +0800 Subject: [PATCH 02/10] Add distrobuilder doc and yaml files for each services --- scripts/lxd-container/README.adoc | 9 + scripts/lxd-container/build_lxd_container.sh | 16 ++ services/api_gateway/lxd.yaml | 207 +++++++++++++++++++ services/data_plane_manager/lxd.yaml | 4 +- services/elastic_ip_manager/lxd.yaml | 201 ++++++++++++++++++ services/gateway_manager/lxd.yaml | 207 +++++++++++++++++++ services/mac_manager/lxd.yaml | 207 +++++++++++++++++++ services/network_acl_manager/lxd.yaml | 207 +++++++++++++++++++ services/network_config_manager/lxd.yaml | 207 +++++++++++++++++++ services/node_manager/lxd.yaml | 207 +++++++++++++++++++ services/port_manager/lxd.yaml | 207 +++++++++++++++++++ services/private_ip_manager/lxd.yaml | 207 +++++++++++++++++++ services/quota_manager/lxd.yaml | 207 +++++++++++++++++++ services/route_manager/lxd.yaml | 207 +++++++++++++++++++ services/security_group_manager/lxd.yaml | 207 +++++++++++++++++++ services/subnet_manager/lxd.yaml | 207 +++++++++++++++++++ services/vpc_manager/lxd.yaml | 207 +++++++++++++++++++ 17 files changed, 2918 insertions(+), 3 deletions(-) create mode 100644 scripts/lxd-container/README.adoc create mode 100644 scripts/lxd-container/build_lxd_container.sh create mode 100644 services/api_gateway/lxd.yaml create mode 100644 services/elastic_ip_manager/lxd.yaml create mode 100644 services/gateway_manager/lxd.yaml create mode 100644 services/mac_manager/lxd.yaml create mode 100644 services/network_acl_manager/lxd.yaml create mode 100644 services/network_config_manager/lxd.yaml create mode 100644 services/node_manager/lxd.yaml create mode 100644 services/port_manager/lxd.yaml create mode 100644 services/private_ip_manager/lxd.yaml create mode 100644 services/quota_manager/lxd.yaml create mode 100644 services/route_manager/lxd.yaml create mode 100644 services/security_group_manager/lxd.yaml create mode 100644 services/subnet_manager/lxd.yaml create mode 100644 services/vpc_manager/lxd.yaml diff --git a/scripts/lxd-container/README.adoc b/scripts/lxd-container/README.adoc new file mode 100644 index 000000000..f468dc2fb --- /dev/null +++ b/scripts/lxd-container/README.adoc @@ -0,0 +1,9 @@ += Introduction of deployment in LXD +Min Chen +v0.1, 2020-09-18 +:toc: right +:sectnums: +:imagesdir: images + +== Install the disrtibuilder + diff --git a/scripts/lxd-container/build_lxd_container.sh b/scripts/lxd-container/build_lxd_container.sh new file mode 100644 index 000000000..62819d4c9 --- /dev/null +++ b/scripts/lxd-container/build_lxd_container.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# MIT License +# Copyright(c) 2020 Futurewei Cloud +# +# Permission is hereby granted, +# free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons +# to whom the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/services/api_gateway/lxd.yaml b/services/api_gateway/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/api_gateway/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/data_plane_manager/lxd.yaml b/services/data_plane_manager/lxd.yaml index f7edf7330..14e95c3ff 100644 --- a/services/data_plane_manager/lxd.yaml +++ b/services/data_plane_manager/lxd.yaml @@ -173,11 +173,9 @@ packages: cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: diff --git a/services/elastic_ip_manager/lxd.yaml b/services/elastic_ip_manager/lxd.yaml new file mode 100644 index 000000000..779229728 --- /dev/null +++ b/services/elastic_ip_manager/lxd.yaml @@ -0,0 +1,201 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/elasticipmanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/elasticipmanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/elasticipmanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/gateway_manager/lxd.yaml b/services/gateway_manager/lxd.yaml new file mode 100644 index 000000000..b07e193e0 --- /dev/null +++ b/services/gateway_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/gatewaymanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/gatewaymanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/gatewaymanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/mac_manager/lxd.yaml b/services/mac_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/mac_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/network_acl_manager/lxd.yaml b/services/network_acl_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/network_acl_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/network_config_manager/lxd.yaml b/services/network_config_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/network_config_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/node_manager/lxd.yaml b/services/node_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/node_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/port_manager/lxd.yaml b/services/port_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/port_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/private_ip_manager/lxd.yaml b/services/private_ip_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/private_ip_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/quota_manager/lxd.yaml b/services/quota_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/quota_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/route_manager/lxd.yaml b/services/route_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/route_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/security_group_manager/lxd.yaml b/services/security_group_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/security_group_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/subnet_manager/lxd.yaml b/services/subnet_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/subnet_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file diff --git a/services/vpc_manager/lxd.yaml b/services/vpc_manager/lxd.yaml new file mode 100644 index 000000000..f7edf7330 --- /dev/null +++ b/services/vpc_manager/lxd.yaml @@ -0,0 +1,207 @@ +image: + name: ubuntu-disco-x86_64 + distribution: ubuntu + release: bionic + description: |- + Ubuntu {{ image.release }} + architecture: x86_64 + +source: + downloader: debootstrap + same_as: gutsy + url: http://archive.ubuntu.com/ubuntu + keyserver: keyserver.ubuntu.com + keys: + - 0x790BC7277767219C42C86F933B4FE6ACC0B21F32 + - 0xf6ecb3762474eda9d21b7022871920d1991bc93c + +targets: + lxc: + create-message: |- + You just created an {{ image.description }} container. + + To enable SSH, run: apt install openssh-server + No default root or user password are set by LXC. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_personality }} + +files: +- path: /etc/hostname + generator: hostname + +- path: /etc/hosts + generator: hosts + +- path: /etc/resolvconf/resolv.conf.d/original + generator: remove + +- path: /etc/resolvconf/resolv.conf.d/tail + generator: remove + +- path: /etc/machine-id + generator: dump + +- path: /etc/user/profile + generator: copy + source: /etc/profile + +- path: /var/lib/dbus/machine-id + generator: remove + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - container + variants: + - default + +- path: /etc/netplan/10-lxc.yaml + generator: dump + content: |- + network: + version: 2 + ethernets: + enp5s0: + dhcp4: true + dhcp-identifier: mac + releases: + - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy + types: + - vm + variants: + - default + +- name: meta-data + generator: cloud-init + variants: + - cloud + +- name: network-config + generator: cloud-init + variants: + - cloud + +- name: user-data + generator: cloud-init + variants: + - cloud + +- name: vendor-data + generator: cloud-init + variants: + - cloud + +- name: ext4 + generator: fstab + types: + - vm + +- name: lxd-agent + generator: lxd-agent + types: + - vm + +- path: /etc/default/grub.d/50-lxd.cfg + generator: dump + content: |- + GRUB_RECORDFAIL_TIMEOUT=0 + GRUB_TIMEOUT=0 + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" + GRUB_TERMINAL=console + types: + - vm + +- path: /etc/sudoers.d/90-lxd + generator: dump + mode: 0440 + content: |- + # User rules for ubuntu + ubuntu ALL=(ALL) NOPASSWD:ALL + variants: + - default + +- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar + generator: copy + source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar + +packages: + manager: apt + update: true + cleanup: true + sets: + - packages: + - fuse + - language-pack-en + - openssh-client + - vim + - openjdk-11-jdk + action: install + + repositories: + - name: sources.list + url: |- + deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse + architectures: + - amd64 + +actions: +- trigger: post-files + action: |- + #!/bin/bash + java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ + --illegal-access=permit + types: + - vm + +mappings: + architecture_map: debian \ No newline at end of file From 0d27fbb5a6c1f9b48965de0243506a33bf7842a3 Mon Sep 17 00:00:00 2001 From: vanderchen Date: Tue, 26 Apr 2022 01:52:27 +0800 Subject: [PATCH 03/10] Update lxd scripts --- scripts/lxd-container/build_lxd_container.sh | 108 +++++++++++++++++++ 1 file changed, 108 insertions(+) mode change 100644 => 100755 scripts/lxd-container/build_lxd_container.sh diff --git a/scripts/lxd-container/build_lxd_container.sh b/scripts/lxd-container/build_lxd_container.sh old mode 100644 new mode 100755 index 62819d4c9..4ab127c5c --- a/scripts/lxd-container/build_lxd_container.sh +++ b/scripts/lxd-container/build_lxd_container.sh @@ -14,3 +14,111 @@ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +LXD_SCRIPTS_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +ALCOR_ROOT_DIR=$(dirname $(dirname $LXD_SCRIPTS_PATH)) +declare -a services_list=(ignite vpm snm rm pim mm pm nm sgm ag dpm eim qm nam ncm gm) + +function install_distrobuilder { + echo "Install distrobuilder dependencis" + apt update && \ + apt install -y \ + debootstrap \ + rsync \ + gpg \ + squashfs-tools \ + git + wget https://dl.google.com/go/go1.18.1.linux-amd64.tar.gz && \ + rm -rf /usr/local/go && \ + tar -C /usr/local -xzf go1.18.1.linux-amd64.tar.gz + rm go1.18.1.linux-amd64.tar.gz + PATH=$PATH:/usr/local/go/bin + git clone https://github.com/lxc/distrobuilder && \ + cd ./distrobuilder && \ + make + cd .. + rm -rf distrobuilder +} + +function build_alcor_with_db_lxd_image { + echo "Build Alcor LXD container" + apt install -y lxd && \ + lxd init + cd ${ALCOR_ROOT_DIR} + mvn -Dmaven.test.skip=true -DskipTests clean package install + + #build images + + # echo "#0 Creating ignite lxd image" + # docker build -t ignite -f $ALCOR_ROOT_DIR/lib/ignite.Dockerfile $ALCOR_ROOT_DIR/lib + # echo + + # echo "#1 Creating vpc_manager lxd image" + # cd $ALCOR_ROOT_DIR/services/vpc_manager + # ./$HOME/go/bin/distrobuilder build-lxd aca-lxd.yaml + # lxc image import lxd.tar.xz rootfs.squashfs --alias vpm + # rm -rf lxd.tar.xz rootfs.squashfs + # echo + + # echo "#2 Creating subnet_manager image with port 9002" + # docker build -t snm $ALCOR_ROOT_DIR/services/subnet_manager/ + # echo + + # echo "#3 Creating route_manager image with port 9003" + # docker build -t rm $ALCOR_ROOT_DIR/services/route_manager/ + # echo + + # echo "#4 Creating private_ip_manager image with port 9004" + # docker build -t pim $ALCOR_ROOT_DIR/services/private_ip_manager/ + # echo + + # echo "#5 Creating mac_manager image with port 9005" + # docker build -t mm $ALCOR_ROOT_DIR/services/mac_manager/ + # echo + + # echo "#6 Creating port_manger image with port 9006" + # docker build -t pm $ALCOR_ROOT_DIR/services/port_manager/ + # echo + + # echo "#7 Creating node_manager image with port 9007" + # docker build -t nm $ALCOR_ROOT_DIR/services/node_manager/ + # echo + + # echo "#8 Creating security_group_manager image with port 9008" + # docker build -t sgm $ALCOR_ROOT_DIR/services/security_group_manager/ + # echo + + # echo "#9 Creating api_gateway image with port 9009" + # docker build -t ag $ALCOR_ROOT_DIR/services/api_gateway/ + # echo + + echo "#10 Creating data_plane_manager lxd image" + cd $ALCOR_ROOT_DIR/services/data_plane_manager/ + ./$HOME/go/bin/distrobuilder build-lxd aca-lxd.yaml + lxc image import lxd.tar.xz rootfs.squashfs --alias dpm + echo + + # echo "#11 Creating elastic_ip_manager image with port 9011" + # docker build -t eim $ALCOR_ROOT_DIR/services/elastic_ip_manager/ + # echo + + # echo "#12 Creating quoto_manager image with port 9012" + # docker build -t qm $ALCOR_ROOT_DIR/services/quota_manager/ + # echo + + # echo "#13 Creating network_acl_manager image with port 9013" + # docker build -t nam $ALCOR_ROOT_DIR/services/network_acl_manager/ + # echo + + # echo "#14 Creating network_acl_manager image with port 9014" + # docker build -t ncm $ALCOR_ROOT_DIR/services/network_config_manager/ + # echo + + # echo "#15 Creating gateway_manager image with port 9015" + # docker build -t gm $ALCOR_ROOT_DIR/services/gateway_manager/ + # echo + +} + + +# install_distrobuilder +build_alcor_with_db_lxd_image \ No newline at end of file From a9aaab1265250322bc3a22b3144224ab03451cbd Mon Sep 17 00:00:00 2001 From: VanderChen Date: Wed, 27 Apr 2022 12:54:43 +0800 Subject: [PATCH 04/10] Update lxd build shell and lxd yaml file --- scripts/lxd-container/README.adoc | 3 +- scripts/lxd-container/build_lxd_container.sh | 254 ++++++++++++++----- services/api_gateway/lxd.yaml | 47 ++-- services/data_plane_manager/lxd.yaml | 39 +-- services/elastic_ip_manager/lxd.yaml | 49 ++-- services/gateway_manager/lxd.yaml | 43 ++-- services/mac_manager/lxd.yaml | 47 ++-- services/network_acl_manager/lxd.yaml | 47 ++-- services/network_config_manager/lxd.yaml | 47 ++-- services/node_manager/lxd.yaml | 47 ++-- services/port_manager/lxd.yaml | 47 ++-- services/private_ip_manager/lxd.yaml | 47 ++-- services/quota_manager/lxd.yaml | 47 ++-- services/route_manager/lxd.yaml | 47 ++-- services/security_group_manager/lxd.yaml | 47 ++-- services/subnet_manager/lxd.yaml | 47 ++-- services/vpc_manager/lxd.yaml | 47 ++-- 17 files changed, 594 insertions(+), 358 deletions(-) diff --git a/scripts/lxd-container/README.adoc b/scripts/lxd-container/README.adoc index f468dc2fb..3306982b2 100644 --- a/scripts/lxd-container/README.adoc +++ b/scripts/lxd-container/README.adoc @@ -5,5 +5,6 @@ v0.1, 2020-09-18 :sectnums: :imagesdir: images -== Install the disrtibuilder +== Install LXD and disrtibuilder +== Build LXD container images \ No newline at end of file diff --git a/scripts/lxd-container/build_lxd_container.sh b/scripts/lxd-container/build_lxd_container.sh index 4ab127c5c..f68292bc9 100755 --- a/scripts/lxd-container/build_lxd_container.sh +++ b/scripts/lxd-container/build_lxd_container.sh @@ -16,7 +16,9 @@ LXD_SCRIPTS_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ALCOR_ROOT_DIR=$(dirname $(dirname $LXD_SCRIPTS_PATH)) -declare -a services_list=(ignite vpm snm rm pim mm pm nm sgm ag dpm eim qm nam ncm gm) +IGNITE_VERSION="2.10.0" +# declare -a services_list=(ignite vpm snm rm pim mm pm nm sgm ag dpm eim qm nam ncm gm) +declare -a services_list=(dpm) function install_distrobuilder { echo "Install distrobuilder dependencis" @@ -39,86 +41,206 @@ function install_distrobuilder { rm -rf distrobuilder } -function build_alcor_with_db_lxd_image { - echo "Build Alcor LXD container" +function init_lxd { + echo "Install LXD" apt install -y lxd && \ lxd init +} + +function build_alcor_image () { +tee -a $1/ignite.service > /dev/null < /dev/null < /dev/null + +cd $1 && \ +cp -rp $LXD_SCRIPTS_PATH/apache-ignite-${IGNITE_VERSION}-bin ignite && \ +$HOME/go/bin/distrobuilder build-lxd lxd.yaml && \ +lxc image import lxd.tar.xz rootfs.squashfs --alias dpm && \ +rm -rf lxd.tar.xz \ + rootfs.squashfs \ + *.service \ + ignite && \ +echo +} + +function build_alcor_lxd_images_with_db { + echo "Build Alcor LXD container" + + apt install -y zip + cd ${ALCOR_ROOT_DIR} mvn -Dmaven.test.skip=true -DskipTests clean package install + + # download Apache Ignite + cd ${LXD_SCRIPTS_PATH} + wget https://archive.apache.org/dist/ignite/${IGNITE_VERSION}/apache-ignite-${IGNITE_VERSION}-bin.zip + unzip apache-ignite-${IGNITE_VERSION}-bin.zip + rm apache-ignite-${IGNITE_VERSION}-bin.zip #build images - # echo "#0 Creating ignite lxd image" - # docker build -t ignite -f $ALCOR_ROOT_DIR/lib/ignite.Dockerfile $ALCOR_ROOT_DIR/lib - # echo - - # echo "#1 Creating vpc_manager lxd image" - # cd $ALCOR_ROOT_DIR/services/vpc_manager - # ./$HOME/go/bin/distrobuilder build-lxd aca-lxd.yaml - # lxc image import lxd.tar.xz rootfs.squashfs --alias vpm - # rm -rf lxd.tar.xz rootfs.squashfs - # echo - - # echo "#2 Creating subnet_manager image with port 9002" - # docker build -t snm $ALCOR_ROOT_DIR/services/subnet_manager/ - # echo - - # echo "#3 Creating route_manager image with port 9003" - # docker build -t rm $ALCOR_ROOT_DIR/services/route_manager/ - # echo - - # echo "#4 Creating private_ip_manager image with port 9004" - # docker build -t pim $ALCOR_ROOT_DIR/services/private_ip_manager/ - # echo - - # echo "#5 Creating mac_manager image with port 9005" - # docker build -t mm $ALCOR_ROOT_DIR/services/mac_manager/ - # echo - - # echo "#6 Creating port_manger image with port 9006" - # docker build -t pm $ALCOR_ROOT_DIR/services/port_manager/ - # echo - - # echo "#7 Creating node_manager image with port 9007" - # docker build -t nm $ALCOR_ROOT_DIR/services/node_manager/ - # echo - - # echo "#8 Creating security_group_manager image with port 9008" - # docker build -t sgm $ALCOR_ROOT_DIR/services/security_group_manager/ - # echo - - # echo "#9 Creating api_gateway image with port 9009" - # docker build -t ag $ALCOR_ROOT_DIR/services/api_gateway/ - # echo - - echo "#10 Creating data_plane_manager lxd image" - cd $ALCOR_ROOT_DIR/services/data_plane_manager/ - ./$HOME/go/bin/distrobuilder build-lxd aca-lxd.yaml - lxc image import lxd.tar.xz rootfs.squashfs --alias dpm + echo "#1 Creating vpc_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/vpc_manager vpm vpcmanager-0.1.0-SNAPSHOT.jar + echo + + echo "#2 Creating subnet_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/subnet_manager snm subnetmanager-0.1.0-SNAPSHOT.jar + echo + + echo "#3 Creating route_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/route_manager rm routemanager-0.1.0-SNAPSHOT.jar + echo + + echo "#4 Creating private_ip_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/subnet_manager pim subnetmanager-0.1.0-SNAPSHOT.jar + echo + + echo "#5 Creating mac_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/mac_manager mm macmanager-0.1.0-SNAPSHOT.jar + echo + + echo "#6 Creating port_manger lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/port_manager pm portmanager-0.1.0-SNAPSHOT.jar echo - # echo "#11 Creating elastic_ip_manager image with port 9011" - # docker build -t eim $ALCOR_ROOT_DIR/services/elastic_ip_manager/ - # echo + echo "#7 Creating node_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/node_manager nm nodemanager-0.1.0-SNAPSHOT.jar + echo + + echo "#8 Creating security_group_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/security_group_manager sgm securitygroupmanager-0.1.0-SNAPSHOT.jar + echo + + echo "#9 Creating api_gateway lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/api_gateway ag apigateway-0.1.0-SNAPSHOT.jar + echo + + echo "#10 Creating data_plane_manager lxd image\n" + build_alcor_image $ALCOR_ROOT_DIR/services/data_plane_manager dpm dataplanemanager-0.1.0-SNAPSHOT.jar + + echo "#11 Creating elastic_ip_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/elastic_ip_manager eim elastic_ip_manager-0.1.0-SNAPSHOT.jar + echo + + echo "#12 Creating quoto_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/quota_manager qm quotamanager-0.1.0-SNAPSHOT.jar + echo - # echo "#12 Creating quoto_manager image with port 9012" - # docker build -t qm $ALCOR_ROOT_DIR/services/quota_manager/ - # echo + echo "#13 Creating network_acl_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/network_acl_manager nam networkaclmanager-0.1.0-SNAPSHOT.jar + echo - # echo "#13 Creating network_acl_manager image with port 9013" - # docker build -t nam $ALCOR_ROOT_DIR/services/network_acl_manager/ - # echo + echo "#14 Creating network_acl_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/network_config_manager ncm networkconfigmanager-0.1.0-SNAPSHOT.jar + echo - # echo "#14 Creating network_acl_manager image with port 9014" - # docker build -t ncm $ALCOR_ROOT_DIR/services/network_config_manager/ - # echo + echo "#15 Creating gateway_manager lxd image" + build_alcor_image $ALCOR_ROOT_DIR/services/services/gateway_manager gm gatewaymanager-0.1.0-SNAPSHOT.jar + echo - # echo "#15 Creating gateway_manager image with port 9015" - # docker build -t gm $ALCOR_ROOT_DIR/services/gateway_manager/ - # echo + rm -rf $LXD_SCRIPTS_PATH/apache-ignite-2.10.0-bin +} + +function start_lxd_containers { + count=0 + echo "Starting Alcor LXD containers\n" + for service in ${services_list[@]}; do + lxc launch $service $service + sleep 5 + lxc exec $service -- bash -c "chmod +x /root/ignite/bin/ignite.sh" + lxc exec $service -- bash -c "systemctl enable ignite" + lxc exec $service -- bash -c "systemctl enable $service" + lxc exec $service -- bash -c "systemctl start ignite" + lxc exec $service -- bash -c "systemctl start $service" + if [[ $? -eq 0 ]]; then count=$((count + 1)); fi + done + echo -e "\n$count services started...\n" +} + +function stop_lxd_containers { + count=0 + echo "Stoping and Deleting Alcor LXD containers\n" + for service in ${services_list[@]}; do + lxc stop $service $service + lxc delete $service + if [[ $? -eq 0 ]]; then count=$((count + 1)); fi + done + echo -e "\n$count services stoped and deleted...\n" +} +function delete_lxd_images { + count=0 + echo "Deleting Alcor LXD images\n" + for service in ${services_list[@]}; do + lxc stop $service $service + lxc delete $service + if [[ $? -eq 0 ]]; then count=$((count + 1)); fi + done + echo -e "\n$count services images stoped...\n" } +while getopts "ibsdD" opt; do +case $opt in + i) + echo "Download dependencis" + init_lxd + install_distrobuilder + ;; + b) + build_alcor_lxd_images_with_db + ;; + s) + start_lxd_containers + ;; + d) + stop_lxd_containers + ;; + D) + delete_lxd_images + ;; + \?) + echo "Invalid arguements" +esac +done # install_distrobuilder -build_alcor_with_db_lxd_image \ No newline at end of file +build_alcor_lxd_images_with_db +start_lxd_containers diff --git a/services/api_gateway/lxd.yaml b/services/api_gateway/lxd.yaml index f7edf7330..731c62c00 100644 --- a/services/api_gateway/lxd.yaml +++ b/services/api_gateway/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/apigateway-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/apigateway-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/ag.service + generator: copy + source: ./ag.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/data_plane_manager/lxd.yaml b/services/data_plane_manager/lxd.yaml index 14e95c3ff..2ca3472a7 100644 --- a/services/data_plane_manager/lxd.yaml +++ b/services/data_plane_manager/lxd.yaml @@ -166,7 +166,19 @@ files: - path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar generator: copy source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/dpm.service + generator: copy + source: ./dpm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true @@ -186,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/elastic_ip_manager/lxd.yaml b/services/elastic_ip_manager/lxd.yaml index 779229728..27f8f8ecb 100644 --- a/services/elastic_ip_manager/lxd.yaml +++ b/services/elastic_ip_manager/lxd.yaml @@ -81,6 +81,12 @@ files: dhcp-identifier: mac releases: - bionic + - eoan + - focal + - groovy + - hirsute + - impish + - jammy types: - container variants: @@ -160,18 +166,28 @@ files: - path: /root/elasticipmanager-0.1.0-SNAPSHOT.jar generator: copy source: ./target/elasticipmanager-0.1.0-SNAPSHOT.jar - + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/eim.service + generator: copy + source: ./dpm.service + +- path: /etc/systemd/system/eim.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -182,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/elasticipmanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/gateway_manager/lxd.yaml b/services/gateway_manager/lxd.yaml index b07e193e0..d59f3db96 100644 --- a/services/gateway_manager/lxd.yaml +++ b/services/gateway_manager/lxd.yaml @@ -166,18 +166,28 @@ files: - path: /root/gatewaymanager-0.1.0-SNAPSHOT.jar generator: copy source: ./target/gatewaymanager-0.1.0-SNAPSHOT.jar - + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/dpm.service + generator: copy + source: ./dpm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/gatewaymanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/mac_manager/lxd.yaml b/services/mac_manager/lxd.yaml index f7edf7330..0e9f58a77 100644 --- a/services/mac_manager/lxd.yaml +++ b/services/mac_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/macmanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/macmanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/mm.service + generator: copy + source: ./mm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/network_acl_manager/lxd.yaml b/services/network_acl_manager/lxd.yaml index f7edf7330..a5c6ba545 100644 --- a/services/network_acl_manager/lxd.yaml +++ b/services/network_acl_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/network-acl-manager-0.0.1-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/network-acl-manager-0.0.1-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/nam.service + generator: copy + source: ./nam.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/network_config_manager/lxd.yaml b/services/network_config_manager/lxd.yaml index f7edf7330..046615307 100644 --- a/services/network_config_manager/lxd.yaml +++ b/services/network_config_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/networkconfigmanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/networkconfigmanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/ncm.service + generator: copy + source: ./ncm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/node_manager/lxd.yaml b/services/node_manager/lxd.yaml index f7edf7330..d53f23d0a 100644 --- a/services/node_manager/lxd.yaml +++ b/services/node_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/nodemanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/nodemanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/nm.service + generator: copy + source: ./nm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/port_manager/lxd.yaml b/services/port_manager/lxd.yaml index f7edf7330..ef267ebaa 100644 --- a/services/port_manager/lxd.yaml +++ b/services/port_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/portmanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/portmanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/pm.service + generator: copy + source: ./pm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/private_ip_manager/lxd.yaml b/services/private_ip_manager/lxd.yaml index f7edf7330..468ec9923 100644 --- a/services/private_ip_manager/lxd.yaml +++ b/services/private_ip_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/privateipmanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/privateipmanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/pim.service + generator: copy + source: ./pim.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/quota_manager/lxd.yaml b/services/quota_manager/lxd.yaml index f7edf7330..adf0a1729 100644 --- a/services/quota_manager/lxd.yaml +++ b/services/quota_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/quotamanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/quotamanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/qm.service + generator: copy + source: ./qm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/route_manager/lxd.yaml b/services/route_manager/lxd.yaml index f7edf7330..210f561ec 100644 --- a/services/route_manager/lxd.yaml +++ b/services/route_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/routemanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/routemanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/rm.service + generator: copy + source: ./rm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/security_group_manager/lxd.yaml b/services/security_group_manager/lxd.yaml index f7edf7330..6b3bb04c1 100644 --- a/services/security_group_manager/lxd.yaml +++ b/services/security_group_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/securitygroupmanager-0.0.1-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/securitygroupmanager-0.0.1-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/sgm.service + generator: copy + source: ./sgm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/subnet_manager/lxd.yaml b/services/subnet_manager/lxd.yaml index f7edf7330..1c01dba4c 100644 --- a/services/subnet_manager/lxd.yaml +++ b/services/subnet_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/subnetmanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/subnetmanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/sm.service + generator: copy + source: ./sm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file diff --git a/services/vpc_manager/lxd.yaml b/services/vpc_manager/lxd.yaml index f7edf7330..cae3a377c 100644 --- a/services/vpc_manager/lxd.yaml +++ b/services/vpc_manager/lxd.yaml @@ -163,21 +163,31 @@ files: variants: - default -- path: /root/dataplanemanager-0.1.0-SNAPSHOT.jar +- path: /root/vpcmanager-0.1.0-SNAPSHOT.jar generator: copy - source: ./target/dataplanemanager-0.1.0-SNAPSHOT.jar - + source: ./target/vpcmanager-0.1.0-SNAPSHOT.jar + +- path: /root/ignite + generator: copy + source: ./ignite + +- path: /etc/systemd/system/vpm.service + generator: copy + source: ./vpm.service + +- path: /etc/systemd/system/ignite.service + generator: copy + source: ./ignite.service + packages: manager: apt update: true cleanup: true sets: - packages: - - fuse - - language-pack-en - openssh-client - vim - - openjdk-11-jdk + - openjdk-11-jre action: install repositories: @@ -188,20 +198,17 @@ packages: deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse architectures: - amd64 - -actions: -- trigger: post-files - action: |- - #!/bin/bash - java -jar /root/dataplanemanager-0.1.0-SNAPSHOT.jar \ - --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \ - --add-exports=java.base/sun.nio.ch=ALL-UNNAMED \ - --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \ - --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \ - --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \ - --illegal-access=permit - types: - - vm + +# TODO: actions part is provided by official but not working +# actions: +# - trigger: post-files +# action: |- +# #!/bin/bash +# chmod +x /root/ignite/bin/ignite.sh +# systemctl daemon-reload +# systemctl enable ignite +# systemctl enable dpm + mappings: architecture_map: debian \ No newline at end of file From 9ae29691e027f0c2e5ee26fc66f9a2e3a816c18f Mon Sep 17 00:00:00 2001 From: VanderChen Date: Wed, 27 Apr 2022 13:43:16 +0800 Subject: [PATCH 05/10] Fix bug in lxd scripts --- scripts/lxd-container/build_lxd_container.sh | 32 +++++++++----------- services/subnet_manager/lxd.yaml | 4 +-- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/scripts/lxd-container/build_lxd_container.sh b/scripts/lxd-container/build_lxd_container.sh index f68292bc9..af3c03b21 100755 --- a/scripts/lxd-container/build_lxd_container.sh +++ b/scripts/lxd-container/build_lxd_container.sh @@ -118,62 +118,62 @@ function build_alcor_lxd_images_with_db { #build images echo "#1 Creating vpc_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/vpc_manager vpm vpcmanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/vpc_manager vpm vpcmanager-0.1.0-SNAPSHOT.jar echo echo "#2 Creating subnet_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/subnet_manager snm subnetmanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/subnet_manager snm subnetmanager-0.1.0-SNAPSHOT.jar echo echo "#3 Creating route_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/route_manager rm routemanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/route_manager rm routemanager-0.1.0-SNAPSHOT.jar echo echo "#4 Creating private_ip_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/subnet_manager pim subnetmanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/subnet_manager pim subnetmanager-0.1.0-SNAPSHOT.jar echo echo "#5 Creating mac_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/mac_manager mm macmanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/mac_manager mm macmanager-0.1.0-SNAPSHOT.jar echo echo "#6 Creating port_manger lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/port_manager pm portmanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/port_manager pm portmanager-0.1.0-SNAPSHOT.jar echo echo "#7 Creating node_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/node_manager nm nodemanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/node_manager nm nodemanager-0.1.0-SNAPSHOT.jar echo echo "#8 Creating security_group_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/security_group_manager sgm securitygroupmanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/security_group_manager sgm securitygroupmanager-0.1.0-SNAPSHOT.jar echo echo "#9 Creating api_gateway lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/api_gateway ag apigateway-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/api_gateway ag apigateway-0.1.0-SNAPSHOT.jar echo echo "#10 Creating data_plane_manager lxd image\n" build_alcor_image $ALCOR_ROOT_DIR/services/data_plane_manager dpm dataplanemanager-0.1.0-SNAPSHOT.jar echo "#11 Creating elastic_ip_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/elastic_ip_manager eim elastic_ip_manager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/elastic_ip_manager eim elastic_ip_manager-0.1.0-SNAPSHOT.jar echo echo "#12 Creating quoto_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/quota_manager qm quotamanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/quota_manager qm quotamanager-0.1.0-SNAPSHOT.jar echo echo "#13 Creating network_acl_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/network_acl_manager nam networkaclmanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/network_acl_manager nam networkaclmanager-0.1.0-SNAPSHOT.jar echo echo "#14 Creating network_acl_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/network_config_manager ncm networkconfigmanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/network_config_manager ncm networkconfigmanager-0.1.0-SNAPSHOT.jar echo echo "#15 Creating gateway_manager lxd image" - build_alcor_image $ALCOR_ROOT_DIR/services/services/gateway_manager gm gatewaymanager-0.1.0-SNAPSHOT.jar + build_alcor_image $ALCOR_ROOT_DIR/services/gateway_manager gm gatewaymanager-0.1.0-SNAPSHOT.jar echo rm -rf $LXD_SCRIPTS_PATH/apache-ignite-2.10.0-bin @@ -240,7 +240,3 @@ case $opt in echo "Invalid arguements" esac done - -# install_distrobuilder -build_alcor_lxd_images_with_db -start_lxd_containers diff --git a/services/subnet_manager/lxd.yaml b/services/subnet_manager/lxd.yaml index 1c01dba4c..ae5b1247c 100644 --- a/services/subnet_manager/lxd.yaml +++ b/services/subnet_manager/lxd.yaml @@ -171,9 +171,9 @@ files: generator: copy source: ./ignite -- path: /etc/systemd/system/sm.service +- path: /etc/systemd/system/snm.service generator: copy - source: ./sm.service + source: ./snm.service - path: /etc/systemd/system/ignite.service generator: copy From 98cb187ec3f4f7e136b7d7737b21c2e2ae77229e Mon Sep 17 00:00:00 2001 From: VanderChen Date: Wed, 27 Apr 2022 14:30:57 +0800 Subject: [PATCH 06/10] Fix bug in lxd scripts --- scripts/lxd-container/build_lxd_container.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/lxd-container/build_lxd_container.sh b/scripts/lxd-container/build_lxd_container.sh index af3c03b21..d8259bd6f 100755 --- a/scripts/lxd-container/build_lxd_container.sh +++ b/scripts/lxd-container/build_lxd_container.sh @@ -220,7 +220,9 @@ function delete_lxd_images { while getopts "ibsdD" opt; do case $opt in i) - echo "Download dependencis" + install_distrobuilder + ;; + I) init_lxd install_distrobuilder ;; From ab20aa3a64a7caa883bc93a58d1fd536d79d1f2c Mon Sep 17 00:00:00 2001 From: VanderChen Date: Wed, 27 Apr 2022 14:31:09 +0800 Subject: [PATCH 07/10] Fix bug in lxd scripts --- scripts/lxd-container/build_lxd_container.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lxd-container/build_lxd_container.sh b/scripts/lxd-container/build_lxd_container.sh index d8259bd6f..49815607d 100755 --- a/scripts/lxd-container/build_lxd_container.sh +++ b/scripts/lxd-container/build_lxd_container.sh @@ -217,7 +217,7 @@ function delete_lxd_images { echo -e "\n$count services images stoped...\n" } -while getopts "ibsdD" opt; do +while getopts "iIbsdD" opt; do case $opt in i) install_distrobuilder From 350127874b74018117107e877f8f24c8f2de209f Mon Sep 17 00:00:00 2001 From: VanderChen Date: Wed, 27 Apr 2022 15:03:07 +0800 Subject: [PATCH 08/10] Fix bug in lxd scripts --- scripts/lxd-container/build_lxd_container.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/lxd-container/build_lxd_container.sh b/scripts/lxd-container/build_lxd_container.sh index 49815607d..42855cd93 100755 --- a/scripts/lxd-container/build_lxd_container.sh +++ b/scripts/lxd-container/build_lxd_container.sh @@ -240,5 +240,15 @@ case $opt in ;; \?) echo "Invalid arguements" + ;; esac done + +if [ $OPTIND -eq 1 ]; then + echo "Build and start containers" + stop_lxd_containers + delete_lxd_images + build_alcor_lxd_images_with_db + start_lxd_containers +fi +shift $((OPTIND-1)) \ No newline at end of file From 6f936bcb4ba247474e72fef3be2534b9f0e5fecc Mon Sep 17 00:00:00 2001 From: VanderChen Date: Wed, 27 Apr 2022 15:04:31 +0800 Subject: [PATCH 09/10] Fix bug in lxd scripts --- services/elastic_ip_manager/lxd.yaml | 4 ++-- services/gateway_manager/lxd.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/elastic_ip_manager/lxd.yaml b/services/elastic_ip_manager/lxd.yaml index 27f8f8ecb..0a30feeb7 100644 --- a/services/elastic_ip_manager/lxd.yaml +++ b/services/elastic_ip_manager/lxd.yaml @@ -173,9 +173,9 @@ files: - path: /etc/systemd/system/eim.service generator: copy - source: ./dpm.service + source: ./eim.service -- path: /etc/systemd/system/eim.service +- path: /etc/systemd/system/ignite.service generator: copy source: ./ignite.service diff --git a/services/gateway_manager/lxd.yaml b/services/gateway_manager/lxd.yaml index d59f3db96..dcb758dcd 100644 --- a/services/gateway_manager/lxd.yaml +++ b/services/gateway_manager/lxd.yaml @@ -171,9 +171,9 @@ files: generator: copy source: ./ignite -- path: /etc/systemd/system/dpm.service +- path: /etc/systemd/system/gm.service generator: copy - source: ./dpm.service + source: ./gm.service - path: /etc/systemd/system/ignite.service generator: copy From aca67e0fcc0537398f2b142b7bb9e4933625dfd1 Mon Sep 17 00:00:00 2001 From: VanderChen Date: Wed, 27 Apr 2022 18:29:38 +0800 Subject: [PATCH 10/10] Add static ip config for lxd container --- scripts/lxd-container/build_lxd_container.sh | 53 +++++++++++++++++--- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/scripts/lxd-container/build_lxd_container.sh b/scripts/lxd-container/build_lxd_container.sh index 42855cd93..b75f95ff0 100755 --- a/scripts/lxd-container/build_lxd_container.sh +++ b/scripts/lxd-container/build_lxd_container.sh @@ -17,8 +17,8 @@ LXD_SCRIPTS_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ALCOR_ROOT_DIR=$(dirname $(dirname $LXD_SCRIPTS_PATH)) IGNITE_VERSION="2.10.0" -# declare -a services_list=(ignite vpm snm rm pim mm pm nm sgm ag dpm eim qm nam ncm gm) -declare -a services_list=(dpm) +declare -a services_list=(vpm snm rm pim mm pm nm sgm ag dpm eim qm nam ncm gm) +declare -a ip_list=(10.92.85.101 10.92.85.102 10.92.85.103 10.92.85.104 10.92.85.105 10.92.85.106 10.92.85.107 10.92.85.108 10.92.85.109 10.92.85.110) function install_distrobuilder { echo "Install distrobuilder dependencis" @@ -93,7 +93,7 @@ sed -i "s/alcor-service.jar/${3}/g" $1/${2}.service > /dev/null cd $1 && \ cp -rp $LXD_SCRIPTS_PATH/apache-ignite-${IGNITE_VERSION}-bin ignite && \ $HOME/go/bin/distrobuilder build-lxd lxd.yaml && \ -lxc image import lxd.tar.xz rootfs.squashfs --alias dpm && \ +lxc image import lxd.tar.xz rootfs.squashfs --alias ${2} && \ rm -rf lxd.tar.xz \ rootfs.squashfs \ *.service \ @@ -101,6 +101,30 @@ rm -rf lxd.tar.xz \ echo } +function config_alcor_service_url () { + sed -i -E "s/('microservices.vpc.service.url'.+)name(.+'9001/')/\1'=http://10.92.85.101:'\2/" ${1}/src/main/resources/application.properties + sed -i -E "s/('microservices.subnet.service.url'.+)name(.+'9002/')/\1'=http://10.92.85.102'\2/" ${1}/src/main/resources/application.properties + sed -i -E "s/('microservices.route.service.url'.+)name(.+'9003/')/\1'=http://10.92.85.103'\2/" ${1}/src/main/resources/application.properties + sed -i -E "s/('microservices.port.service.url'.+)name(.+'9006/')/\1'=http://10.92.85.104'\2/" ${1}/src/main/resources/application.properties + sed -i -E "s/('microservices.sg.service.url'.+)name(.+'9008/')/\1'=http://0.92.85.105'\2/" ${1}/src/main/resources/application.properties + sed -i -E "s/('microservices.elasticip.service.url'.+)name(.+'9011/')/\1'=http://10.92.85.106'\2/" ${1}/src/main/resources/application.properties + sed -i -E "s/('microservices.quota.service.url'.+)name(.+'9012/')/\1'=http://10.92.85.107'\2/" ${1}/src/main/resources/application.properties + sed -i -E "s/('microservices.dpm.service.url'.+)name(.+'9010/')/\1'=http://10.92.85.108'\2/" ${1}/src/main/resources/application.properties +} + +function config_alcor_container_url () { + count=0 + echo "Starting Alcor LXD containers\n" + for i in "${!services_list[@]}"; do + lxc stop "${services_list[$i]}" + lxc network attach $1 "${services_list[$i]}" eth0 eth0 + lxc config device set "${services_list[$i]}" eth0 ipv4.address "${ip_list[$i]}" + lxc start "${services_list[$i]}" + if [[ $? -eq 0 ]]; then count=$((count + 1)); fi + done + echo -e "\n$count services started...\n" +} + function build_alcor_lxd_images_with_db { echo "Build Alcor LXD container" @@ -199,8 +223,17 @@ function stop_lxd_containers { count=0 echo "Stoping and Deleting Alcor LXD containers\n" for service in ${services_list[@]}; do - lxc stop $service $service - lxc delete $service + lxc stop $servicebash + if [[ $? -eq 0 ]]; then count=$((count + 1)); fi + done + echo -e "\n$count services stoped and deleted...\n" +} + +function delete_lxd_containers { + count=0 + echo "Stoping and Deleting Alcor LXD containers\n" + for service in ${services_list[@]}; do + lxc delete $service if [[ $? -eq 0 ]]; then count=$((count + 1)); fi done echo -e "\n$count services stoped and deleted...\n" @@ -217,14 +250,15 @@ function delete_lxd_images { echo -e "\n$count services images stoped...\n" } -while getopts "iIbsdD" opt; do + + +while getopts "iIbsrdD" opt; do case $opt in i) install_distrobuilder ;; I) init_lxd - install_distrobuilder ;; b) build_alcor_lxd_images_with_db @@ -232,9 +266,12 @@ case $opt in s) start_lxd_containers ;; - d) + r) stop_lxd_containers ;; + d) + delete_lxd_containers + ;; D) delete_lxd_images ;;