summaryrefslogtreecommitdiffstats
path: root/scripts/vmware/main.yml
blob: 0fd68d44fe7bc7da0a2d2e9007b3ffeb1502fe79 (plain)
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
# Copyright (C) 2016 Kristoffer Gronlund
#
# License: GNU General Public License (GPL)
version: 2.2
category: Stonith
shortdesc: Fencing using vCenter / ESX Server
longdesc: |
  Note that SBD is the recommended fencing mechanism for VMware
  hosts! Please refer to the documentation for more details on
  recommended fencing configurations.

  Fencing for VMware virtualized hosts using ESX Server or vCenter.

  This wizard configures a fencing resource for a single node.
  It is necessary to run the wizard for each node to fence.

  Prerequisites

  1. Install the vSphere Web Services SDK on all nodes.

  2. Generate vCenter credentials using credstore_admin.pl

  3. Copy credentials to the same location on all nodes.

parameters:
  - name: id
    type: resource
    shortdesc: Base Resource ID
    value: vcenter-fencing
    required: true
  - name: node_name
    type: string
    shortdesc: Name of node to fence
    required: true
  - name: machine_name
    type: string
    shortdesc: Name of machine in vCenter inventory
    required: true
  - name: server
    type: string
    shortdesc: VCenter server URL
    required: true
    example: vcenter.example.com
  - name: credstore
    type: string
    shortdesc: Credentials file name
    required: true

actions:
  - cib: |
      primitive {{id}}-{{node_name}} stonith:external/vcenter
          VI_SERVER="{{server}}"
          VI_CREDSTORE="{{credstore}}"
          HOSTLIST="{{node_name}}={{machine_name}}"
          RESETPOWERON="0"
          pcmk_host_check="static-list"
          pcmk_host_list="{{node_name}}"
          op monitor interval="60s"
      location loc-{{id}}-{{node_name}} {{id}}-{{node_name}} -inf: {{node_name}}
      property stonith-enabled=true