From 5fe0dc0037e972266ddc0661be99a9fdc9892910 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 1 Oct 2013 16:50:55 +0000 Subject: [PATCH] Add a iscsi_client role, add to virthosts --- playbooks/groups/virthost.yml | 2 + roles/iscsi_client/files/multipath.conf | 65 +++++++++++++++++++ roles/iscsi_client/tasks/main.yml | 39 +++++++++++ .../templates/initiatorname.iscsi.j2 | 1 + vars/global.yml | 5 ++ 5 files changed, 112 insertions(+) create mode 100644 roles/iscsi_client/files/multipath.conf create mode 100644 roles/iscsi_client/tasks/main.yml create mode 100644 roles/iscsi_client/templates/initiatorname.iscsi.j2 diff --git a/playbooks/groups/virthost.yml b/playbooks/groups/virthost.yml index a4fdafb459..b439656b5d 100644 --- a/playbooks/groups/virthost.yml +++ b/playbooks/groups/virthost.yml @@ -5,6 +5,7 @@ - name: make virthost server system hosts: $target user: root + accelerate: True gather_facts: True vars_files: @@ -18,6 +19,7 @@ - /srv/web/infra/ansible/roles/denyhosts - /srv/web/infra/ansible/roles/nagios_client - /srv/web/infra/ansible/roles/fas_client + - /srv/web/infra/ansible/roles/iscsi_client tasks: - include: $tasks/hosts.yml diff --git a/roles/iscsi_client/files/multipath.conf b/roles/iscsi_client/files/multipath.conf new file mode 100644 index 0000000000..6ceca79f67 --- /dev/null +++ b/roles/iscsi_client/files/multipath.conf @@ -0,0 +1,65 @@ +defaults { + rr_min_io 128 + user_friendly_names yes + max_fds max + queue_without_daemon no +} + +blacklist { + devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" + devnode "^hd[a-z]" + devnode "^cciss!c[0-9]d[0-9]*" + device { + vendor "IBM-ESXS" + } + device { + vendor "IBM" + } + device { + vendor "LSILOGIC" + } + device { + vendor "ATA" + } + device { + vendor "VMware" + } + + wwid "*GBRL0015XVEUCM*" # Blacklist the on board blade RAID controller +} + +devices { + device { + vendor "NETAPP" + product "LUN" + path_grouping_policy group_by_prio + path_checker directio + failback immediate + prio ontap + features "1 queue_if_no_path" + } + + device { + path_checker tur + product "NEXTRA" + vendor "XIV" + rr_min_io 15 + path_grouping_policy multibus + path_selector "round-robin 0" + no_path_retry 5 + polling_interval 3 + failback 15 + } + + device { + path_checker tur + product "2810XIV" + vendor "IBM" + rr_min_io 15 + path_grouping_policy multibus + path_selector "round-robin 0" + no_path_retry 5 + polling_interval 3 + failback 15 + } +} diff --git a/roles/iscsi_client/tasks/main.yml b/roles/iscsi_client/tasks/main.yml new file mode 100644 index 0000000000..902f62da6f --- /dev/null +++ b/roles/iscsi_client/tasks/main.yml @@ -0,0 +1,39 @@ +--- +# +# This task sets up iscsid and mpathd on a machine. +# + +# +- name: install packages needed for iscsi_client + yum: state=installed name=$item + with_items: + - iscsi-initiator-utils + - device-mapper-multipath + tags: + - packages + +- name: enable iscsi service + service: state=running enabled=yes name=iscsi + tags: + - services + +- name: enable multipathd service + service: state=running enabled=yes name=multipathd + tags: + - services + +- name: setup multipath.conf file + copy: src=multipath.conf dest=/etc/multipath.conf + tags: + - config + +- name: setup initiatorname.iscsi + template: src=initiatorname.iscsi.j2 dest=/etc/iscsi/initiatorname.iscsi + tags: + - config + +- name: run iscsiadm command for initial connect + command: creates=/var/lib/iscsi/nodes/{{ netapp_iscsi_name }}/{{ netapp_iscsi_portal }},3260 /sbin/iscsiadm --mode node --targetname --portal {{ netapp_iscsi_portal }} -o new ; /sbin/iscsiadm --mode node --targetname {{ netapp_iscsi_name }} --portal {{ netapp_iscsi_portal }} --login + tags: + - config + diff --git a/roles/iscsi_client/templates/initiatorname.iscsi.j2 b/roles/iscsi_client/templates/initiatorname.iscsi.j2 new file mode 100644 index 0000000000..0555966823 --- /dev/null +++ b/roles/iscsi_client/templates/initiatorname.iscsi.j2 @@ -0,0 +1 @@ +InitiatorName=iqn.2003-11.org.fedoraproject.{{ inventory_hostname }} diff --git a/vars/global.yml b/vars/global.yml index 8f2d3c05bf..3b577e7784 100644 --- a/vars/global.yml +++ b/vars/global.yml @@ -21,3 +21,8 @@ global_pkgs_inst: ['bind-utils', 'joe', 'mailx', 'nc', 'openssh-clients', 'patch', 'postfix', 'rsync', 'strace', 'telnet', 'tmpwatch', 'traceroute', 'vim-enhanced', 'xz', 'zsh', 'libselinux-python' ] + +# iscsi initiator for netapp iscsi volume +netapp_iscsi_name: iqn.1992-08.com.netapp:sn.1573980081:vf.6fb258f4-106f-11e2-ae29-00a098161d90 +# iscsi portal for netapp iscsi volume +netapp_iscsi_portal: 10.5.88.35