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:
parent
721bc8fa16
commit
473fc4f9da
@ -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"
|
||||
|
@ -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'
|
||||
|
@ -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)"
|
||||
|
@ -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'
|
||||
|
@ -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?
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user