HomeClusterLabs Projects

Ironic fence agent

Description

Ironic fence agent

Introduce a fence agent that plugs into OpenStack's Ironic (Bare Metal
as a service) service.

Testing recap:

  1. With ironic services up and running

1.1) Status
$ fence_ironic -k $OS_AUTH_URL -l admin -p $OS_PASSWORD -o status -n 2b40a642-3d7b-4a43-b6a2-57a3967ebb1c
Status: ON

1.2) Power off
$ fence_ironic -k $OS_AUTH_URL -l admin -p $OS_PASSWORD -o off -n 2b40a642-3d7b-4a43-b6a2-57a3967ebb1c
Success: Powered OFF // Machine confirmed to be off

1.3) Power on
$ fence_ironic -k $OS_AUTH_URL -l admin -p $OS_PASSWORD -o on -n 2b40a642-3d7b-4a43-b6a2-57a3967ebb1c
Success: Powered ON

1.4) Power on (when already powered on)
fence_ironic -k $OS_AUTH_URL -l admin -p $OS_PASSWORD -o on -n 2b40a642-3d7b-4a43-b6a2-57a3967ebb1c
Success: Already ON

  1. With ironic services down/in error

2.1) Status
$ fence_ironic -k $OS_AUTH_URL -l admin -p $OS_PASSWORD -o status -n 2b40a642-3d7b-4a43-b6a2-57a3967ebb1c
Failed: Unable to obtain correct plug status or plug is not available

2.2) Power off
$ fence_ironic -k $OS_AUTH_URL -l admin -p $OS_PASSWORD -o off -n 2b40a642-3d7b-4a43-b6a2-57a3967ebb1c
Failed: Unable to obtain correct plug status or plug is not available

2.3) Power on
$ fence_ironic -k $OS_AUTH_URL -l admin -p $OS_PASSWORD -o on -n 2b40a642-3d7b-4a43-b6a2-57a3967ebb1c
Failed: Unable to obtain correct plug status or plug is not available

  1. Non existing VM

$ fence_ironic -k $OS_AUTH_URL -l admin -p $OS_PASSWORD -o on -n foo
Failed: Unable to obtain correct plug status or plug is not available

  1. Verified that password is never logged even when invoked with '-v'
  1. Tested list command

$ fence_ironic -k http://192.0.2.1:5000/v2.0 -l admin -p 1ea6ac2d58b975455bf90eeb625ba57ac2c67766 -o list-status -C " "
ffa9ff02-20f1-45f4-b44c-1276d8120827 control-0 ON
79956ff7-8f9a-45a8-k90b-f711daf79bed control-2 ON
2b40a642-3d7b-4a43-b6a2-57a3967ebb1c compute-0 ON
70e07769-c4c5-4e0d-k134-41bca3f525d4 control-3 ON
b1db4b9b-da1a-4f3b-k980-88251eb5bdcd control-1 ON

Set up the fence agent like this:
hostmap=$(nova list | grep ctlplane | awk -F\| '{print $3 ":" $2}' | tr -d ' ' | tr '\n' ' ')
sudo pcs stonith create shooter fence_ironic auth-url=${OS_AUTH_URL} \

login=${OS_USERNAME} passwd=${OS_PASSWORD} tenant-name=${OS_TENANT_NAME} \
pcmk_host_map=\"${hostmap}\" op monitor interval=60s

Details

Provenance
Michele Baldessari <michele@acksyn.org>Authored on Oct 5 2016, 6:09 AM
Parents
rF7e576420d6e7: fence_zvmip: Update XML metadata
Branches
Unknown
Tags
Unknown

Event Timeline