1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

M #-: Add Firecracker to oneprovision for packet (#823)

Signed-off-by: Ricardo Diaz <rdiaz@opennebula.io>
This commit is contained in:
Ricardo Diaz 2021-02-17 12:41:18 +01:00 committed by GitHub
parent 50622a8bf8
commit 948c4fb811
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 328 additions and 1 deletions

View File

@ -9,7 +9,8 @@
roles:
- ddc
- opennebula-repository
- opennebula-node-kvm
- { role: opennebula-node-kvm, when: oneprovision_hypervisor == 'kvm' }
- { role: opennebula-node-firecracker, when: oneprovision_hypervisor == 'firecracker' }
- opennebula-ssh
- role: iptables
iptables_base_rules_services:

View File

@ -0,0 +1,24 @@
name: 'packet-amsterdam'
description: 'Elastic cluster on Packet in Amsterdam'
provider: 'packet'
plain:
provision_type: 'hybrid+'
image: 'EQUINIX.webp'
location_key: 'facility'
connection:
token: 'Packet token'
project: 'Packet project'
facility: 'ams1'
inputs:
- name: 'packet_os'
type: 'list'
options:
- 'centos_8'
- name: 'packet_plan'
type: 'list'
options:
- 'baremetal_0'

View File

@ -0,0 +1,26 @@
name: 'packet-ewr1'
description: 'Elastic cluster on Packet in Parsippany, USA, NJ'
provider: 'packet'
plain:
provision_type: 'hybrid+'
image: 'EQUINIX.webp'
location_key: 'facility'
connection:
token: 'Packet token'
project: 'Packet project'
facility: 'ewr1'
inputs:
- name: 'packet_os'
type: 'list'
options:
- 'centos_8'
- name: 'packet_plan'
type: 'list'
options:
- 't1.small'
- 'c1.small'
- 'm1.xlarge'

View File

@ -0,0 +1,26 @@
name: 'packet-nrt1'
description: 'Elastic cluster on Packet in Tokyo, Japan'
provider: 'packet'
plain:
provision_type: 'hybrid+'
image: 'EQUINIX.webp'
location_key: 'facility'
connection:
token: 'Packet token'
project: 'Packet project'
facility: 'nrt1'
inputs:
- name: 'packet_os'
type: 'list'
options:
- 'centos_8'
- name: 'packet_plan'
type: 'list'
options:
- 't1.small'
- 'c1.small'
- 'm1.xlarge'

View File

@ -0,0 +1,26 @@
name: 'packet-sjc1'
description: 'Elastic cluster on Packet in Sunnyvale, USA, CA'
provider: 'packet'
plain:
provision_type: 'hybrid+'
image: 'EQUINIX.webp'
location_key: 'facility'
connection:
token: 'Packet token'
project: 'Packet project'
facility: 'sjc1'
inputs:
- name: 'packet_os'
type: 'list'
options:
- 'centos_8'
- name: 'packet_plan'
type: 'list'
options:
- 't1.small'
- 'c1.small'
- 'm1.xlarge'

View File

@ -0,0 +1,46 @@
---
# ---------------------------------------------------------------------------- #
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# ---------------------------------------------------------------------------- #
#-------------------------------------------------------------------------------
# datastores: Defines the storage area for the cluster using the SSH replication
# drivers. It creates the following datastores, using Replica driver:
# 1. Image datastore, ${cluster_name}-image
# 2. System datastore, ${cluster_name}-system
# 3. File datastore, ${cluster_name}-files
#
# Configuration/Input attributes:
# - replica_host: The host that will hold the cluster replicas and snapshots.
#-------------------------------------------------------------------------------
datastores:
- name: "${provision}-image"
type: 'image_ds'
ds_mad: 'fs'
tm_mad: 'ssh'
safe_dirs: "/var/tmp /tmp"
- name: "${provision}-system"
type: 'system_ds'
tm_mad: 'ssh'
safe_dirs: "/var/tmp /tmp"
replica_host: "use-first-host"
- name: "${provision}-files"
type: 'file_ds'
ds_mad: 'fs'
tm_mad: 'ssh'
safe_dirs: "/var/tmp /tmp"

View File

@ -0,0 +1,24 @@
---
# ---------------------------------------------------------------------------- #
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# ---------------------------------------------------------------------------- #
#-------------------------------------------------------------------------------
# defaults: Common configuration attributes for provision objects
#--------------------------------------------------------------------------------
# configuration: Ansible role parameters.
#--------------------------------------------------------------------------------
# Check defaults/main.yml in each role for the available variables
#-------------------------------------------------------------------------------

View File

@ -0,0 +1,38 @@
---
# ---------------------------------------------------------------------------- #
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# ---------------------------------------------------------------------------- #
inputs:
- name: 'number_hosts'
type: text
description: "Number of metal servers to create"
default: '1'
- name: 'number_public_ips'
type: text
description: 'Number of public IPs to get'
default: '1'
- name: 'packet_plan'
type: text
description: "Packet plan (device type)"
default: 'baremetal_0'
- name: 'packet_os'
type: text
description: "Packet host operating system"
default: 'centos_8'

View File

@ -0,0 +1,40 @@
---
# ---------------------------------------------------------------------------- #
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# ---------------------------------------------------------------------------- #
networks:
- name: "${provision}-public"
vn_mad: 'elastic'
bridge: 'br0'
netrole: 'public'
provision:
count: "${input.number_public_ips}"
ar:
- provison_id: "${provision_id}"
size: '1'
packet_ip_type: 'public_ipv4'
ipam_mad: 'packet'
vntemplates:
- name: "${provision}-private"
vn_mad: 'vxlan'
phydev: 'bond0'
automatic_vlan_id: 'yes'
netrole: 'private'
vxlan_mode: 'evpn'
vxlan_tep: 'dev'
ip_link_conf: 'nolearning='
cluster_ids: "${cluster.0.id}"

View File

@ -0,0 +1,76 @@
---
# ---------------------------------------------------------------------------- #
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# ---------------------------------------------------------------------------- #
#-------------------------------------------------------------------------------
# This is the canonical description file for a cluster build with 'Packet'
# resources using the KVM hypervisor.
# ------------------------------------------------------------------------------
name: 'packet-cluster'
provision_type: 'hybrid+_firecracker'
provider: 'packet'
image: 'OPENNEBULA-EQUINIX.png'
extends:
- common.d/defaults.yml
- common.d/resources.yml
- common.d/firecracker_hosts.yml
- packet.d/defaults.yml
- packet.d/datastores.yml
- packet.d/inputs.yml
- packet.d/networks.yml
#-------------------------------------------------------------------------------
# playbook: Ansible playbook used for hosts configuration.The packet playbook
# include the following roles:
# - ddc
# - opennebula-repository
# - opennebula-node-kvm
# - opennebula-ssh
# - tuntap
# - bridged-networking
# - iptables
#-------------------------------------------------------------------------------
playbook:
- packet
#-------------------------------------------------------------------------------
# defaults: Common configuration attributes for provision objects
#--------------------------------------------------------------------------------
defaults:
provision:
provider_name: 'packet'
plan: "${input.packet_plan}"
os: "${input.packet_os}"
#-------------------------------------------------------------------------------
# cluster: Parameters for the OpenNebula cluster. Applies to all the Hosts
#--------------------------------------------------------------------------------
# name: of the cluster
# description: Additional information
# reserved_cpu: In percentage. It will be subtracted from the TOTAL CPU
# reserved_memory: In percentage. It will be subtracted from the TOTAL MEM
#--------------------------------------------------------------------------------
cluster:
name: "${provision}"
description: 'Packet cluster'
datastores:
- 1
- 2
reserved_cpu: '0'
reserved_mem: '0'