summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-04-10 10:59:13 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-04-10 10:59:13 (GMT)
commitbacbecb5c354b25d2654bfdfe1fc8624e790a9f8 (patch)
tree66554fb618361b4892258a284f1d1e58367709dd
parent62572324c94d5a943ddc9424f9d7eeddd120afd5 (diff)
parentbfe95fbfca73808861fb021a5c4688a550659bb4 (diff)
downloaddefinitions-baserock/openstack-v6.tar.gz
Merge branch 'baserock/pedroalvarez/openstack-v6-cinder-conf2' into baserock/openstack-v6baserock/openstack-v6
Reviewed-by: Francisco Redondo Marchena Reviewed-by: Richard Maw
-rw-r--r--openstack/usr/share/openstack/cinder.yml55
-rw-r--r--openstack/usr/share/openstack/cinder/cinder.conf7
2 files changed, 55 insertions, 7 deletions
diff --git a/openstack/usr/share/openstack/cinder.yml b/openstack/usr/share/openstack/cinder.yml
index 9a1930b..7752ba8 100644
--- a/openstack/usr/share/openstack/cinder.yml
+++ b/openstack/usr/share/openstack/cinder.yml
@@ -3,6 +3,57 @@
vars_files:
- "/etc/openstack/cinder.conf"
tasks:
+
+# Configure iscsid, this can go in a separate script
+ - name: Update kernel module dependencies
+ command: depmod -a
+
+ - name: generate InitiatorName for iscsi
+ shell: iscsi-iname
+ register: initiator_name
+
+ - lineinfile:
+ dest: /etc/iscsi/initiatorname.iscsi
+ regexp: '^InitiatorName=$'
+ line: 'InitiatorName={{ initiator_name.stdout }}'
+ backrefs: yes
+
+ - name: Enable and start iscsid
+ service:
+ name: "{{ item }}"
+ enabled: yes
+ state: started
+ with_items:
+ - iscsid
+
+# Configure LVM and target for Cinder
+ - name: Check that CINDER_DEVICE exists
+ stat:
+ path: "{{ CINDER_DEVICE }}"
+ register: cinder_device_stats
+ failed_when: cinder_device_stats.stat.exists == false
+
+ - name: Configure LVM group for cinder
+ lvg:
+ vg: cinder-volumes
+ pvs: "{{ CINDER_DEVICE }}"
+
+ - lineinfile:
+ dest: /etc/lvm/lvm.conf
+ regexp: '# filter = \[ \"a\/\.\*/\" \]'
+ line: ' filter = [ "a|{{ CINDER_DEVICE }}|", "r/.*/" ]'
+ backrefs: yes
+
+ - name: Enable and start lvm2-lvmetad and target services
+ service:
+ name: "{{ item }}"
+ enabled: yes
+ state: started
+ with_items:
+ - lvm2-lvmetad
+ - target
+
+# Configure cinder
- name: Create the cinder user.
user:
name: cinder
@@ -100,7 +151,3 @@
- openstack-cinder-scheduler
- openstack-cinder-volume
- openstack-cinder-backup
-
- - lvg:
- vg: cinder-volumes
- pvs: "{{ CINDER_DEVICE }}"
diff --git a/openstack/usr/share/openstack/cinder/cinder.conf b/openstack/usr/share/openstack/cinder/cinder.conf
index 1869de6..3f1eebf 100644
--- a/openstack/usr/share/openstack/cinder/cinder.conf
+++ b/openstack/usr/share/openstack/cinder/cinder.conf
@@ -1026,7 +1026,7 @@ use_syslog = True
# The IP address that the iSCSI daemon is listening on (string
# value)
-#iscsi_ip_address=$my_ip
+iscsi_ip_address={{ MANAGEMENT_INTERFACE_IP_ADDRESS }}
# The port that the iSCSI daemon is listening on (integer
# value)
@@ -1040,6 +1040,7 @@ use_syslog = True
# The backend name for a given driver implementation (string
# value)
#volume_backend_name=<None>
+volume_backend_name=LVM_iSCSI
# Do we attach/detach volumes in cinder using multipath for
# volume to image and image to volume transfers? (boolean
@@ -1062,7 +1063,7 @@ use_syslog = True
# iSCSI target user-land tool to use. tgtadm is default, use
# lioadm for LIO iSCSI support, iseradm for the ISER protocol,
# or fake for testing. (string value)
-iscsi_helper=tgtadm
+iscsi_helper=lioadm
# Volume configuration file storage directory (string value)
volumes_dir=$state_path/volumes
@@ -2262,7 +2263,7 @@ volume_group=cinder-volumes
#
# Driver to use for volume creation (string value)
-#volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
+volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
# Timeout for creating the volume to migrate to when
# performing volume migration (seconds) (integer value)