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

M #-: add provision AR count (#669)

This commit is contained in:
Alejandro Huertas Herrero 2021-01-19 12:28:15 +01:00 committed by GitHub
parent 721bc8fa16
commit 473fc4f9da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 2 deletions

View File

@ -21,6 +21,11 @@ inputs:
description: 'Number of AWS instances to create'
default: '1'
- name: 'number_public_ips'
type: text
description: 'Number of public IPs to get'
default: '1'
- name: 'aws_ami_image'
type: text
description: "AWS ami image used for host deployments"

View File

@ -19,6 +19,8 @@ networks:
- name: "${provision}-public"
vn_mad: 'elastic'
bridge: 'br0'
provision:
count: "${input.number_public_ips}"
ar:
- provison_id: "${provision_id}"
size: '1'

View File

@ -21,6 +21,11 @@ inputs:
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)"

View File

@ -19,6 +19,8 @@ networks:
- name: "${provision}-public"
vn_mad: 'elastic'
bridge: 'br0'
provision:
count: "${input.number_public_ips}"
ar:
- provison_id: "${provision_id}"
size: '1'

View File

@ -574,8 +574,10 @@ module OneProvision
cfg[r].each do |x|
Driver.retry_loop('Failed to create some resources',
self) do
x['provision'] = { 'id' => @id }
obj = Resource.object(r, nil, x)
x['provision'] ||= {}
x['provision'].merge!({ 'id' => @id })
obj = Resource.object(r, nil, x)
next if obj.nil?

View File

@ -32,6 +32,21 @@ module OneProvision
@type = 'network'
end
# Creates the object in OpenNebula
#
# @param cluster_id [Integer] Cluster ID
#
# @return [Integer] Resource ID
def create(cluster_id)
if @p_template['provision']['count'] && @p_template['ar']
(Integer(@p_template['provision']['count']) - 1).times do
@p_template['ar'] << @p_template['ar'][0]
end
end
super
end
# Info an specific object
#
# @param id [String] Object ID