From 9e7b9c4d0cc17e31f3c84c2d6ae9a95a5f97527c Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Wed, 22 Apr 2015 14:14:35 +0000 Subject: Configure and start an iSCSI initiator on all required machines The OpenStack Ironic Conductor service requires that an iSCSI initiator is running on the same local machine. This commit configures and sets an iSCSI initiator to run on the controller node on a two-node and three-node OpenStack system. For a one-node system, this service was already configured as it is required by OpenStack Cinder. Change-Id: I46291d9cd1a31e3ff91888401d45ab0dc67e3677 --- openstack-cinder.configure | 2 +- openstack-ironic.configure | 3 +++ openstack/manifest | 4 ++-- openstack/usr/lib/systemd/system/iscsi-setup.service | 12 ++++++++++++ .../systemd/system/openstack-cinder-iscsi-setup.service | 12 ------------ openstack/usr/share/openstack/cinder-iscsi.yml | 15 --------------- openstack/usr/share/openstack/iscsi.yml | 15 +++++++++++++++ 7 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 openstack/usr/lib/systemd/system/iscsi-setup.service delete mode 100644 openstack/usr/lib/systemd/system/openstack-cinder-iscsi-setup.service delete mode 100644 openstack/usr/share/openstack/cinder-iscsi.yml create mode 100644 openstack/usr/share/openstack/iscsi.yml diff --git a/openstack-cinder.configure b/openstack-cinder.configure index a971dc4c..587a0f83 100644 --- a/openstack-cinder.configure +++ b/openstack-cinder.configure @@ -89,7 +89,7 @@ check_bool CINDER_ENABLE_STORAGE ###################################### if "$CINDER_ENABLE_COMPUTE" || "$CINDER_ENABLE_STORAGE"; then - enable openstack-cinder-iscsi-setup + enable iscsi-setup enable target #target.service! enable iscsid fi diff --git a/openstack-ironic.configure b/openstack-ironic.configure index 7c9c0ffd..962bbcd1 100644 --- a/openstack-ironic.configure +++ b/openstack-ironic.configure @@ -73,6 +73,9 @@ fi ###################################### enable openstack-ironic-setup +enable iscsi-setup +enable target #target.service! +enable iscsid ########################################################################## # Generate configuration file diff --git a/openstack/manifest b/openstack/manifest index 78b030bb..4812c6c3 100644 --- a/openstack/manifest +++ b/openstack/manifest @@ -11,7 +11,6 @@ template 0100644 0 0 /etc/tempest/tempest.conf 0040755 0 0 /usr/share/openstack/cinder 0100644 0 0 /usr/share/openstack/cinder-config.yml 0100644 0 0 /usr/share/openstack/cinder-db.yml -0100644 0 0 /usr/share/openstack/cinder-iscsi.yml 0100644 0 0 /usr/share/openstack/cinder-lvs.yml 0100644 0 0 /usr/share/openstack/cinder/cinder.conf 0100644 0 0 /usr/share/openstack/cinder/api-paste.ini @@ -35,6 +34,7 @@ template 0100644 0 0 /etc/tempest/tempest.conf 0100644 0 0 /usr/share/openstack/ironic.yml 0100644 0 0 /usr/share/openstack/ironic/ironic.conf 0100644 0 0 /usr/share/openstack/ironic/policy.json +0100644 0 0 /usr/share/openstack/iscsi.yml 0100644 0 0 /usr/share/openstack/keystone.yml 0040755 0 0 /usr/share/openstack/keystone 0100644 0 0 /usr/share/openstack/keystone/logging.conf @@ -128,6 +128,7 @@ template 0100644 0 0 /etc/tempest/tempest.conf 0040755 0 0 /usr/lib/sysctl.d 0100644 0 0 /usr/lib/sysctl.d/neutron.conf 0100644 0 0 /usr/lib/systemd/system/apache-httpd.service +0100644 0 0 /usr/lib/systemd/system/iscsi-setup.service 0100644 0 0 /usr/lib/systemd/system/openstack-keystone.service 0100644 0 0 /usr/lib/systemd/system/openstack-keystone-setup.service 0100644 0 0 /usr/lib/systemd/system/openstack-glance-setup.service @@ -159,7 +160,6 @@ template 0100644 0 0 /etc/tempest/tempest.conf 0100644 0 0 /usr/lib/systemd/system/rabbitmq-server.service 0100644 0 0 /usr/lib/systemd/system/openstack-cinder-config-setup.service 0100644 0 0 /usr/lib/systemd/system/openstack-cinder-db-setup.service -0100644 0 0 /usr/lib/systemd/system/openstack-cinder-iscsi-setup.service 0100644 0 0 /usr/lib/systemd/system/openstack-cinder-lv-setup.service 0100644 0 0 /usr/lib/systemd/system/openstack-cinder-api.service 0100644 0 0 /usr/lib/systemd/system/openstack-cinder-scheduler.service diff --git a/openstack/usr/lib/systemd/system/iscsi-setup.service b/openstack/usr/lib/systemd/system/iscsi-setup.service new file mode 100644 index 00000000..c9e5ee59 --- /dev/null +++ b/openstack/usr/lib/systemd/system/iscsi-setup.service @@ -0,0 +1,12 @@ +[Unit] +Description=Run iscsi-setup Ansible scripts +Before=iscsid.service target.service +Wants= iscsid.service target.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/iscsi.yml + +[Install] +WantedBy=multi-user.target diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-iscsi-setup.service b/openstack/usr/lib/systemd/system/openstack-cinder-iscsi-setup.service deleted file mode 100644 index 157f30fc..00000000 --- a/openstack/usr/lib/systemd/system/openstack-cinder-iscsi-setup.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Run cinder-iscsi-setup Ansible scripts -Before=iscsid.service target.service -Wants= iscsid.service target.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/cinder-iscsi.yml - -[Install] -WantedBy=multi-user.target diff --git a/openstack/usr/share/openstack/cinder-iscsi.yml b/openstack/usr/share/openstack/cinder-iscsi.yml deleted file mode 100644 index b80377ae..00000000 --- a/openstack/usr/share/openstack/cinder-iscsi.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: localhost - tasks: - - 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 diff --git a/openstack/usr/share/openstack/iscsi.yml b/openstack/usr/share/openstack/iscsi.yml new file mode 100644 index 00000000..b80377ae --- /dev/null +++ b/openstack/usr/share/openstack/iscsi.yml @@ -0,0 +1,15 @@ +--- +- hosts: localhost + tasks: + - 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 -- cgit v1.2.1