-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd-data-store.yml
63 lines (46 loc) · 1.73 KB
/
add-data-store.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
- hosts: all
tasks:
# - include_vars: "update_esxi_defaults.yaml"
- name: enable software iscsi adapter
shell: "esxcli iscsi software set --enabled=true"
register: iscsi_register
- debug:
msg: "{{ iscsi_register }}"
- name: add iqn from Iscsi storage to the ESX host
shell: "esxcli iscsi adapter set -A vmhba64 -n {{ host_iqn_from_softlayer }}"
register: add_iqn_register
- debug:
msg: "{{ add_iqn_register }}"
- name: add iscsi targets
shell: "esxcli iscsi adapter discovery sendtarget add -A vmhba64 -a {{ Target_address }}:3260"
register: iscsi_tgt_register
- debug:
msg: "{{ iscsi_tgt_register }}"
- name: Configure CHAP Authentication for Iscsi
shell: "esxcli iscsi adapter auth chap set --direction=uni --authname='{{ iscsi_user_name }}' --secret='{{ iscsi_password }}' --level=required --adapter=vmhba64"
# register: chap_register
# - debug:
# msg: "{{ chap_register }}"
- name: Iscsi discover
shell: "esxcli iscsi adapter discovery rediscover -A vmhba64"
register: discover_register
- debug:
msg: "{{ discover_register }}"
# before rescan
#- name: before rescan
# pause:
# seconds: 20
# when: will_reboot
- name: Rescan ESX Storage
shell: "esxcli storage core adapter rescan --adapter=vmhba64"
register: rescan_register
- debug:
msg: "{{ rescan_register }}"
# before rescan
# - name: before rescan
# pause:
# seconds: 20
# when: will_reboot
- name: search for new VMFS datastores
shell: "vmkfstools -V"