summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Zegan <m.zegan@samsung.com>2019-09-05 18:48:18 +0200
committerMichal Zegan <m.zegan@samsung.com>2019-09-06 12:26:09 +0200
commit7c1131e5b46160a1ba4ee52d59b4650cdc1a4c9d (patch)
treeef3f00caffe4817fb18dacd35d6b5e4ac75b6e13
parent6425e67d3832878b93b0da1520c150b81675cd3b (diff)
Add ability to put dockerdata-nfs on root disk
Modify the heat template so that it becomes possible to skip volume creation for dockerdata-nfs. This feature can be toggled at will. It is useful for the cases where /dockerdata-nfs needs to be fast, but there are no ssd volumes available. Of course, large enough ephemeral disks are needed, around 60 gb. Change-Id: I37e29e7cf7273d1d4a6e896ec017d9ef8177b1d0 Issue-ID: OOM-2042 Signed-off-by: Michal Zegan <m.zegan@samsung.com>
-rw-r--r--tools/cicdansible/group_vars/all.yml3
-rw-r--r--tools/cicdansible/heat/installer.yaml15
-rw-r--r--tools/cicdansible/roles/setup_openstack_infrastructure/tasks/deploy/heat.yml1
3 files changed, 18 insertions, 1 deletions
diff --git a/tools/cicdansible/group_vars/all.yml b/tools/cicdansible/group_vars/all.yml
index 581e7c4a..f886b628 100644
--- a/tools/cicdansible/group_vars/all.yml
+++ b/tools/cicdansible/group_vars/all.yml
@@ -26,6 +26,9 @@ infra_flavor_name: ""
installer_flavor_name: ""
#Name of the image for instances.
image_name: ""
+#Whether to use a volume for /dockerdata-nfs or to use ephemeral disk.
+#True by default, most openstack providers offer ssd volumes probably.
+use_volume_for_nfs: true
#Cidr of private subnet where instances are connected.
subnet_cidr: "10.1.0.0/24"
#Start of dhcp allocation range for subnet.
diff --git a/tools/cicdansible/heat/installer.yaml b/tools/cicdansible/heat/installer.yaml
index 793386c6..7b3f10c0 100644
--- a/tools/cicdansible/heat/installer.yaml
+++ b/tools/cicdansible/heat/installer.yaml
@@ -90,6 +90,13 @@ parameters:
constraints:
- range: { min: 1 }
description: "must be a positive number"
+ use_volume_for_nfs:
+ type: boolean
+ label: "use volume for nfs storage"
+ description: "Indicates whether a cinder volume should be used for nfs storage or not. If not checked, the nfs would be stored in the root disk"
+conditions:
+ #Condition for nfs volume usage.
+ use_volume_for_nfs: { get_param: use_volume_for_nfs }
resources:
# Security group used to secure access to instances.
secgroup:
@@ -200,12 +207,14 @@ resources:
#Nfs storage volume for first node.
nfs_storage:
type: OS::Cinder::Volume
+ condition: use_volume_for_nfs
properties:
name: nfs_storage
size: 50
#Attachment of volume to first node.
nfs_storage_attachment:
type: OS::Cinder::VolumeAttachment
+ condition: use_volume_for_nfs
properties:
instance_uuid: { get_attr: [nodes, "resource.0"] }
volume_id: { get_resource: nfs_storage }
@@ -292,8 +301,12 @@ resources:
node0_volumes:
type: OS::Heat::Value
properties:
+ #Note that it returns an empty list if nfs volume is disabled.
value:
- - [{ get_resource: nfs_storage }, "/dockerdata-nfs"]
+ if:
+ - use_volume_for_nfs
+ - - [{ get_resource: nfs_storage }, "/dockerdata-nfs"]
+ - []
#Output values
outputs:
installer_ip:
diff --git a/tools/cicdansible/roles/setup_openstack_infrastructure/tasks/deploy/heat.yml b/tools/cicdansible/roles/setup_openstack_infrastructure/tasks/deploy/heat.yml
index 2bfeda77..5f9bc4f6 100644
--- a/tools/cicdansible/roles/setup_openstack_infrastructure/tasks/deploy/heat.yml
+++ b/tools/cicdansible/roles/setup_openstack_infrastructure/tasks/deploy/heat.yml
@@ -32,5 +32,6 @@
node_ip: "{{ floating_ips_by_address[first_node_ip].id }}"
infra_ip: "{{ floating_ips_by_address[infra_ip].id }}"
installer_ip: "{{ floating_ips_by_address[installer_ip].id }}"
+ use_volume_for_nfs: "{{ use_volume_for_nfs }}"
wait: true
register: heat_stack