diff --git a/cinder/Chart.yaml b/cinder/Chart.yaml index 2b23303406..66ccdfaecb 100644 --- a/cinder/Chart.yaml +++ b/cinder/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Cinder name: cinder -version: 0.2.4 +version: 0.2.5 home: https://docs.openstack.org/cinder/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Cinder/OpenStack_Project_Cinder_vertical.png sources: diff --git a/cinder/templates/bin/_bootstrap.sh.tpl b/cinder/templates/bin/_bootstrap.sh.tpl index 456b4ae2d3..ea6bbd585a 100644 --- a/cinder/templates/bin/_bootstrap.sh.tpl +++ b/cinder/templates/bin/_bootstrap.sh.tpl @@ -53,8 +53,34 @@ openstack volume type show {{ $name }} || \ {{- end }} {{- end }} + {{- /* Create and associate volume QoS if defined */}} + {{- if .Values.bootstrap.volume_qos}} + {{- range $qos_name, $qos_properties := .Values.bootstrap.volume_qos }} +type_defined=true + {{- /* If the volume type to associate with is not defined, skip the qos */}} + {{- range $qos_properties.associates }} +if ! openstack volume type show {{ . }}; then + type_defined=false +fi + {{- end }} +if $type_defined; then + openstack volume qos show {{ $qos_name }} || \ + openstack volume qos create \ + --consumer {{ $qos_properties.consumer }} \ + {{- range $key, $value := $qos_properties.properties }} + --property {{ $key }}={{ $value }} \ + {{- end }} + {{ $qos_name }} + {{- range $qos_properties.associates }} + openstack volume qos associate {{ $qos_name }} {{ . }} + {{- end }} +fi + {{- end }} + {{- end }} + {{- /* Check volume type and properties were added */}} openstack volume type list --long +openstack volume qos list {{- end }} diff --git a/cinder/values.yaml b/cinder/values.yaml index 25b635dcfd..765ab03c7c 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -361,6 +361,18 @@ bootstrap: name: group: volume_backend_name: + # Volume QoS if any. By default, None QoS is created. + # Below values with a number at the end need to be replaced + # with real names. + # volume_qos: + # qos_name_1: + # consumer: front-end + # properties: + # key_1: value_1 + # key_2: value_2 + # associates: + # - volume_type_1 + # - volume_type_2 network: api: diff --git a/cinder/values_overrides/qos.yaml b/cinder/values_overrides/qos.yaml new file mode 100644 index 0000000000..13d70ec5d3 --- /dev/null +++ b/cinder/values_overrides/qos.yaml @@ -0,0 +1,13 @@ +# NOTE: In this yaml file, an example qos is created +# and associated with volume type rbd1 + +--- +bootstrap: + high-iops: + consumer: front-end + properties: + read_iops_sec: 20000 + write_iops_sec: 10000 + associates: + - rbd1 +... diff --git a/releasenotes/notes/cinder.yaml b/releasenotes/notes/cinder.yaml index 2a6d64ea53..42b40ccb2d 100644 --- a/releasenotes/notes/cinder.yaml +++ b/releasenotes/notes/cinder.yaml @@ -21,4 +21,5 @@ cinder: - 0.2.2 Adding rabbitmq TLS logic - 0.2.3 Mount rabbitmq TLS secret - 0.2.4 Add Ussuri release support + - 0.2.5 Add volume QoS support ...