diff --git a/EXAMPLE/cluster_defs/aws/testid/eu-west-1/sandbox/cluster_vars__buildenv.yml b/EXAMPLE/cluster_defs/aws/testid/eu-west-1/sandbox/cluster_vars__buildenv.yml index 2b2a40b6..6892f033 100644 --- a/EXAMPLE/cluster_defs/aws/testid/eu-west-1/sandbox/cluster_vars__buildenv.yml +++ b/EXAMPLE/cluster_defs/aws/testid/eu-west-1/sandbox/cluster_vars__buildenv.yml @@ -43,7 +43,7 @@ cluster_vars: auto_volumes: - { device_name: "/dev/sda1", mountpoint: "/", fstype: "ext4", volume_type: "gp2", volume_size: 8, encrypted: True, delete_on_termination: true } - { device_name: "/dev/sdf", mountpoint: "/media/mysvc", fstype: "ext4", volume_type: "gp2", volume_size: 1, encrypted: True, delete_on_termination: true } - - { device_name: "/dev/sdg", mountpoint: "/media/mysvc", fstype: "ext4", volume_type: "gp2", volume_size: 1, encrypted: True, delete_on_termination: true } + - { device_name: "/dev/sdg", mountpoint: "/media/mysvc", fstype: "ext4", volume_type: "gp2", volume_size: 1, iops: 100, encrypted: True, delete_on_termination: true } lvmparams: { vg_name: "vg0", lv_name: "lv0", lv_size: "100%VG" } flavor: t4g.nano # image: "ami-0c28049fa5618bca4" # eu-west-1 20.04 arm64 hvm-ssd 20210820. Ubuntu images can be located at https://cloud-images.ubuntu.com/locator/ @@ -61,7 +61,7 @@ cluster_vars: auto_volumes: - { device_name: "/dev/sda1", mountpoint: "/", fstype: "ext4", volume_type: "gp2", volume_size: 8, encrypted: True, delete_on_termination: true } - { device_name: "/dev/sdf", mountpoint: "/media/mysvc", fstype: "ext4", volume_type: "gp2", volume_size: 1, encrypted: True, delete_on_termination: true, perms: { owner: "root", group: "root", mode: "775" } } - - { device_name: "/dev/sdg", mountpoint: "/media/mysvc2", fstype: "ext4", volume_type: "gp2", volume_size: 1, encrypted: True, delete_on_termination: true } + - { device_name: "/dev/sdg", mountpoint: "/media/mysvc2", fstype: "ext4", volume_type: "gp2", volume_size: 1, iops: 100, encrypted: True, delete_on_termination: true } flavor: t3a.nano version: "{{sysdisks_version | default('')}}" vms_by_az: { a: 1, b: 1, c: 0 } @@ -69,7 +69,7 @@ cluster_vars: sysdiskslvm: auto_volumes: - { device_name: "/dev/sda1", mountpoint: "/", fstype: "ext4", volume_type: "gp2", volume_size: 8, encrypted: True, delete_on_termination: true } - - { device_name: "/dev/sdf", mountpoint: "/media/mysvc", fstype: "ext4", volume_type: "gp2", volume_size: 1, encrypted: True, delete_on_termination: true } + - { device_name: "/dev/sdf", mountpoint: "/media/mysvc", fstype: "ext4", volume_type: "gp2", volume_size: 1, iops: 100, encrypted: True, delete_on_termination: true } - { device_name: "/dev/sdg", mountpoint: "/media/mysvc", fstype: "ext4", volume_type: "gp2", volume_size: 1, encrypted: True, delete_on_termination: true } lvmparams: { vg_name: "vg0", lv_name: "lv0", lv_size: "100%VG" } flavor: t3a.nano @@ -85,7 +85,7 @@ cluster_vars: hostnvme-multi: auto_volumes: - - { device_name: "/dev/sda1", mountpoint: "/", fstype: "ext4", volume_type: "gp2", volume_size: 8, encrypted: True, delete_on_termination: true } + - { device_name: "/dev/sda1", mountpoint: "/", fstype: "ext4", volume_type: "gp2", volume_size: 8, iops: 100, encrypted: True, delete_on_termination: true } - { device_name: "/dev/sdb", mountpoint: "/media/mysvc", fstype: "ext4", volume_type: "ephemeral", ephemeral: ephemeral0 } - { device_name: "/dev/sdc", mountpoint: "/media/mysvc2", fstype: "ext4", volume_type: "ephemeral", ephemeral: ephemeral1 } - { device_name: "/dev/sdf", mountpoint: "/media/mysvc8", fstype: "ext4", volume_type: "gp2", volume_size: 1, encrypted: True, delete_on_termination: true } diff --git a/EXAMPLE/cluster_defs/test_aws_euw1/cluster_vars.yml b/EXAMPLE/cluster_defs/test_aws_euw1/cluster_vars.yml index 7a3d2cbc..55678642 100644 --- a/EXAMPLE/cluster_defs/test_aws_euw1/cluster_vars.yml +++ b/EXAMPLE/cluster_defs/test_aws_euw1/cluster_vars.yml @@ -96,8 +96,8 @@ cluster_vars: sandbox: hosttype_vars: sys: {auto_volumes: [], flavor: t3a.nano, version: '{{sys_version | default('''')}}', vms_by_az: {a: 1, b: 1, c: 0}} - sysdisks2: {auto_volumes: [{device_name: /dev/sda1, mountpoint: /, fstype: ext4, volume_type: gp2, volume_size: 9, encrypted: true, delete_on_termination: true}, {device_name: /dev/sdf, mountpoint: /media/mysvc, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true, perms: {owner: root, group: root, mode: '775'}}, {device_name: /dev/sdg, mountpoint: /media/mysvc2, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true}], flavor: t3a.nano, version: '{{sysdisks_version | default('''')}}', vms_by_az: {a: 1, b: 1, c: 0}} - sysdisks3: {auto_volumes: [{device_name: /dev/sdf, mountpoint: /media/mysvc, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true}, {device_name: /dev/sdg, mountpoint: /media/mysvc2, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true}, {device_name: /dev/sdh, mountpoint: /media/mysvc3, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true}], flavor: t3a.nano, version: '{{sysdisks_version | default('''')}}', vms_by_az: {a: 1, b: 1, c: 0}} + sysdisks2: {auto_volumes: [{device_name: /dev/sda1, mountpoint: /, fstype: ext4, volume_type: gp2, volume_size: 9, encrypted: true, delete_on_termination: true}, {device_name: /dev/sdf, mountpoint: /media/mysvc, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true, perms: {owner: root, group: root, mode: '775'}}, {device_name: /dev/sdg, mountpoint: /media/mysvc2, fstype: ext4, volume_type: gp2, volume_size: 1, iops: 100, encrypted: true, delete_on_termination: true}], flavor: t3a.nano, version: '{{sysdisks_version | default('''')}}', vms_by_az: {a: 1, b: 1, c: 0}} + sysdisks3: {auto_volumes: [{device_name: /dev/sdf, mountpoint: /media/mysvc, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true}, {device_name: /dev/sdg, mountpoint: /media/mysvc2, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true}, {device_name: /dev/sdh, mountpoint: /media/mysvc3, fstype: ext4, volume_type: gp2, volume_size: 1, iops: 100, encrypted: true, delete_on_termination: true}], flavor: t3a.nano, version: '{{sysdisks_version | default('''')}}', vms_by_az: {a: 1, b: 1, c: 0}} hostnvme-multi: {auto_volumes: [{device_name: "/dev/sda1", mountpoint: "/", fstype: "ext4", volume_type: "gp2", volume_size: 8, encrypted: True, delete_on_termination: true}, {device_name: /dev/sdb, mountpoint: /media/mysvc, fstype: ext4, volume_type: ephemeral, ephemeral: ephemeral0}, {device_name: /dev/sdc, mountpoint: /media/mysvc2, fstype: ext4, volume_type: ephemeral, ephemeral: ephemeral1}, {device_name: /dev/sdf, mountpoint: /media/mysvc8, fstype: ext4, volume_type: gp2, volume_size: 1, encrypted: true, delete_on_termination: true}], flavor: i3en.2xlarge, version: '{{sys_version | default('''')}}', vms_by_az: {a: 1, b: 1, c: 0}} hostnvme-lvm: {auto_volumes: [{device_name: "/dev/sda1", mountpoint: "/", fstype: "ext4", volume_type: "gp2", volume_size: 8, encrypted: True, delete_on_termination: true}, {device_name: /dev/sdb, mountpoint: /media/data, fstype: ext4, volume_type: ephemeral, ephemeral: ephemeral0}, {device_name: /dev/sdc, mountpoint: /media/data, fstype: ext4, volume_type: ephemeral, ephemeral: ephemeral1}], lvmparams: {vg_name: vg0, lv_name: lv0, lv_size: 100%VG}, flavor: i3en.2xlarge, version: '{{sys_version | default('''')}}', vms_by_az: {a: 1, b: 1, c: 0}} hosthdd-multi: {auto_volumes: [{device_name: /dev/sdb, mountpoint: /media/mysvc, fstype: ext4, volume_type: ephemeral, ephemeral: ephemeral0}, {device_name: /dev/sdc, mountpoint: /media/mysvc2, fstype: ext4, volume_type: ephemeral, ephemeral: ephemeral1}, {device_name: /dev/sdd, mountpoint: /media/mysvc3, fstype: ext4, volume_type: ephemeral, ephemeral: ephemeral2}], flavor: d2.xlarge, version: '{{sys_version | default('''')}}', vms_by_az: {a: 1, b: 1, c: 0}} diff --git a/_dependencies/tasks/main.yml b/_dependencies/tasks/main.yml index 1ca825d8..bbdcda2d 100644 --- a/_dependencies/tasks/main.yml +++ b/_dependencies/tasks/main.yml @@ -78,6 +78,8 @@ that: "'{%- for hosttype in cluster_vars[buildenv].hosttype_vars | dict2items -%}{%- if ('lvmparams' not in hosttype.value and (hosttype.value.auto_volumes | length) == (hosttype.value.auto_volumes | map(attribute='mountpoint') | list | unique | count)) or ('lvmparams' in hosttype.value and (hosttype.value.auto_volumes | selectattr('mountpoint', '!=', '/') | map(attribute='mountpoint') | list | unique | count == 1)) -%}{%- else -%}{{hosttype.key}}{%- endif -%}{%- endfor -%}' == ''" fail_msg: "All non-root volume mountpoints must either be all different (in which case 'lvmparams' must not be set), or all the same (in which case, 'lvmparams' must be set)" + - assert: { that: "cluster_vars[buildenv] | json_query(\"hosttype_vars.*.auto_volumes[] | [?iops > `16000`] && [?starts_with(volume_type, `gp`)]\") | length == 0", fail_msg: "Volume iops is too high; maximum is 16000" } + when: cluster_vars.type == "aws" - name: Create gcp service account contents file from cluster_vars[buildenv].gcp_service_account_rawtext (unless already defined by user) block: diff --git a/create/tasks/create_aws.yml b/create/tasks/create_aws.yml index 9874c365..20e58c14 100644 --- a/create/tasks/create_aws.yml +++ b/create/tasks/create_aws.yml @@ -100,6 +100,7 @@ encrypted: "{{item.auto_volume.encrypted}}" volume_size: "{%- if 'src' in item.auto_volume -%}{{omit}}{%- else -%}{{item.auto_volume.volume_size}}{%- endif -%}" volume_type: "{{item.auto_volume.volume_type}}" + iops: "{{item.auto_volume.iops | default(omit)}}" delete_on_termination: yes loop: "{{ cluster_hosts_target_denormalised_by_volume | selectattr('auto_volume.src', 'defined') | list }}" async: 7200