How to fence a Host using a Power Shell Script in Red Hat Virtualization 2.2 ?
- Red Hat Enterprise Virtualization 2.2
- Windows Powershell
- How to fence hosts using Power Shell Scripts?
To fence a host the host status must be first updated to Maintenance Mode.
To update a hosts status to maintenance,use the
Suspend-HostPS command and set the status to
But note that use the shell's tab completion to ensure we get the correct value.
Check the Id of host, please execute the following command first:
PS C:\> Select-Host
- Suspend the host using:
PS C:\> Suspend-Host -HostId <Id-of-host>
- After the Host in in Maintenance Mode execute the below command to fence it.
Fence-Host -HostId $HOST_N.HostId -Action Stop
- Red Hat Virtualization
- Learn more
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.