diff --git a/deployment/cinder/cinder-common-container-puppet.yaml b/deployment/cinder/cinder-common-container-puppet.yaml index 3e724d1c6f..8e3ebc1123 100644 --- a/deployment/cinder/cinder-common-container-puppet.yaml +++ b/deployment/cinder/cinder-common-container-puppet.yaml @@ -106,21 +106,26 @@ outputs: - 'M' args: creates: /var/lib/cinder/cinder-volumes + - name: cinder create LVM loopback device + command: + losetup -f /var/lib/cinder/cinder-volumes + - name: cinder identify the LVM loopback device + command: + losetup -j /var/lib/cinder/cinder-volumes -n -O NAME + register: cinder_lvm_loopback_device + - name: set cinder_lvm_dev fact + set_fact: + cinder_lvm_dev: "{{ cinder_lvm_loopback_device.stdout|default('') }}" - name: cinder create LVM volume group shell: | - if ! losetup /dev/loop2; then - losetup /dev/loop2 /var/lib/cinder/cinder-volumes - fi if ! pvdisplay | grep cinder-volumes; then - pvcreate /dev/loop2 + pvcreate {{ cinder_lvm_dev }} fi if ! vgdisplay | grep cinder-volumes; then - vgcreate cinder-volumes /dev/loop2 + vgcreate cinder-volumes {{ cinder_lvm_dev }} fi - touch /dev/loop2cinder args: executable: /bin/bash - creates: /dev/loop2cinder - name: cinder create service to run losetup for LVM on startup copy: dest: /etc/systemd/system/cinder-lvm-losetup.service @@ -131,8 +136,8 @@ outputs: [Service] Type=oneshot - ExecStart=/bin/bash -c '/sbin/losetup /dev/loop2 || /sbin/losetup /dev/loop2 /var/lib/cinder/cinder-volumes' - ExecStop=/bin/bash -c '/sbin/losetup -d /dev/loop2' + ExecStart=/bin/bash -c '/sbin/losetup {{ cinder_lvm_dev }} || /sbin/losetup {{ cinder_lvm_dev }} /var/lib/cinder/cinder-volumes' + ExecStop=/bin/bash -c '/sbin/losetup -d {{ cinder_lvm_dev }}' RemainAfterExit=yes [Install] diff --git a/deployment/cinder/cinder-volume-container-puppet.yaml b/deployment/cinder/cinder-volume-container-puppet.yaml index 2788ec6fc9..699b952838 100644 --- a/deployment/cinder/cinder-volume-container-puppet.yaml +++ b/deployment/cinder/cinder-volume-container-puppet.yaml @@ -92,10 +92,6 @@ parameters: default: iscsi description: Whether to use TCP ('iscsi') or iSER RDMA ('iser') for iSCSI type: string - CinderLVMLoopDeviceSize: - default: 10280 - description: The size of the loopback file used by the cinder LVM driver. - type: number CinderNfsAvailabilityZone: default: '' description: > @@ -215,7 +211,6 @@ outputs: tripleo::profile::base::cinder::volume::nfs::cinder_nfs_snapshot_support: {get_param: CinderNfsSnapshotSupport} tripleo::profile::base::cinder::volume::nfs::cinder_nas_secure_file_operations: {get_param: CinderNasSecureFileOperations} tripleo::profile::base::cinder::volume::nfs::cinder_nas_secure_file_permissions: {get_param: CinderNasSecureFilePermissions} - tripleo::profile::base::cinder::volume::iscsi::cinder_lvm_loop_device_size: {get_param: CinderLVMLoopDeviceSize} tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_helper: {get_param: CinderISCSIHelper} tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_protocol: {get_param: CinderISCSIProtocol} tripleo::profile::base::cinder::volume::rbd::cinder_rbd_ceph_conf: