PowerVC resource operations CLI (registration or deregistration of storages or hosts)

This topic explains the steps to register and deregister storage controller (SVC), Hardware Management Console (HMC), and hosts by using the powervc-resource-operations command-line interface (CLI).

Introduction

PowerVC admin or login users without root or sudo access cannot perform host or SVC registration from the PowerVC user interface (UI). The powervc-resource-operations CLI is an essential tool for managing resources in such restricted environments.

The powervc-resource-operations CLI is designed for PowerVC admin or login users who operate with limited access and do not have root or sudo permissions to create or modify Linux system services directly. While the initial PowerVC installation must be performed by a root user, the powervc-resource-operations CLI also must be run as root. To support non-root users for PowerVC, a PowerVC login user with restricted access can be created by using the powervc-opsmgr config CLI. This PowerVC allows operational tasks without elevated privileges while maintaining secure control over resource management. Remove root wrap privileges for OpenStack users such as nova and cinder.

Note: The powervc-resource-operations CLI supports only single node environment.

CLI overview

The CLI command that supports registration and deregistration of SVC, HMC, and hosts is powervc-resource-operations. You can use the powervc-resource-operations --help command to see the available options. The powervc-resource-operations svc and powervc-resource-operations hmc are the valid subcommands of the powervc-resource-operations command.

The powervc-resource-operations --help command shows the following details:
[root@vm-xxx ~]# powervc-resource-operations --help
usage: powervc-resource-operations [-h] {svc,hmc} ...

Registers a Storage Provider or HMC host with PowerVC. For more info please run, powervc-host-register <hmc/svc> --help

positional arguments:
  {svc,hmc}
    svc       Register a Storage Provider
    hmc       Register an HMC host

options:
  -h, --help  show this help message and exit
The powervc-resource-operations svc --help command shows the following details:
[root@vm-xxx ~]# powervc-resource-operations svc --help
usage: powervc-resource-operations svc [-h] [-c CREDENTIALS] [-g] [-sc] [-ns] [-pu POWERVC_USER] [-pp POWERVC_PASSWORD] [--access-ip ACCESS_IP] [--password PASSWORD] [--user-id USER_ID] [--volume-pool-name VOLUME_POOL_NAME]
                                       [--host-display-name HOST_DISPLAY_NAME] [--deregister] [--private-key PRIVATE_KEY]

options:
  -h, --help            show this help message and exit
  -c CREDENTIALS, --credentials CREDENTIALS
                        Credentials info file path.
  -g, --get-volume-pools
                        Get volume pool names
  -sc, --sample-credentials
                        Generate Sample credentials to help with registration
  -ns, --non-sudo       Use this to explicitly indicate whether the environment supports sudo or not
  -pu POWERVC_USER, --powervc-user POWERVC_USER
                        PowerVC username for authentication. Equivalent environment variable OS_USERNAME .
  -pp POWERVC_PASSWORD, --powervc-password POWERVC_PASSWORD
                        PowerVC password for authentication. Equivalent environment variable OS_PASSWORD.
  --access-ip ACCESS_IP
                        Access IP for the storage provider.
  --password PASSWORD   Password for the storage provider.
  --user-id USER_ID     User for the storage provider.
  --volume-pool-name VOLUME_POOL_NAME
                        Volume pool name for the storage provider.
  --host-display-name HOST_DISPLAY_NAME
                        Host display name for the storage provider.
  --deregister          Deregister storage
  --private-key PRIVATE_KEY
                        Private key to connect to storage.
The powervc-resource-operations hmc --help’ command shows the following details:
[root@vm-xxx ~]# powervc-resource-operations hmc --help
usage: powervc-resource-operations hmc [-h] [-c CREDENTIALS] [-g] [-sc] [-ns] [-rh] [-pu POWERVC_USER] [-pp POWERVC_PASSWORD] [--access-ip ACCESS_IP] [--user-id USER_ID] [--password PASSWORD] [--hmc-display-name HMC_DISPLAY_NAME]
                                       [--host-display-name HOST_DISPLAY_NAME] [--deregister]

options:
  -h, --help            show this help message and exit
  -c CREDENTIALS, --credentials CREDENTIALS
                        Credentials info file path.
  -g, --get-available-hosts
                        Get available hosts in the provided HMC
  -sc, --sample-credentials
                        Generate Sample credentials to help with registration
  -ns, --non-sudo       Use this to explicitly indicate whether the environment supports sudo or not
  -rh, --register-hmc   Register HMC and stop execution (This is when the backend name of the host to be added is not known)
  -pu POWERVC_USER, --powervc-user POWERVC_USER
                        PowerVC username for authentication. Equivalent environment variable OS_USERNAME.
  -pp POWERVC_PASSWORD, --powervc-password POWERVC_PASSWORD
                        PowerVC password for authentication. Equivalent environment variable OS_PASSWORD.
  --access-ip ACCESS_IP
                        Access IP for the HMC.
  --user-id USER_ID     User for registering the HMC.
  --password PASSWORD   Password for the HMC.
  --hmc-display-name HMC_DISPLAY_NAME
                        HMC display name.
  --host-display-name HOST_DISPLAY_NAME
                        Host name of available hosts on the HMC.
  --deregister          Deregister host

Registering an SVC

Perform the following steps to register an SVC:
  1. Fetch a list of volume pools. To fetch the list of volume pools available on the storage system, enter the following command:
    powervc-resource-operations svc -pu <pvc_user> -pp <pvc_password> --access-ip <storage_address> --password <storage_password> --user-id <storage_user> --host-display-name <svc_display_name> -g
    Replace the following placeholders with appropriate values:
    • pvc_user: PowerVC username
    • pvc_password: PowerVC user password
    • storage_address: IP address of the storage system
    • storage_password: Storage system password
    • storage_user: Storage system username
    • svc_display_name: Display-name for the storage
  2. Register with a specific volume pool. After you have the list of available volume pools, enter the following command to register a specific volume pool:
    powervc-resource-operations svc -pu <pvc_user> -pp <pvc_password> --access-ip <storage_address> --password <storage_password> --user-id <storage_user> --host-display-name <svc_display_name> --volume-pool-name <volume_pool_name>
    where volume_pool_name is the name of the volume pool that must be registered.

Registering an HMC

Perform the following steps to register an HMC:
  1. Register only the HMC without its hosts. To register an HMC without its hosts, enter the following command:
    powervc-resource-operations hmc -pu <pvc_user> -pp <pvc_password> --access-ip <HMC_IP> --user-id <HMC_user> --password <HMC_password> --hmc-display-name <HMC_display_name> -rh
  2. Fetch the list of hosts. After registering the HMC, you can fetch the list of hosts associated with it. To get the list of hosts, enter the following command:
    powervc-resource-operations hmc -pu <pvc_user> -pp <pvc_password> --access-ip <HMC_IP> --user-id <HMC_user> --password <HMC_password> --hmc-display-name <HMC_display_name> -g
  3. Register a specific host. To register a specific host from the list, enter the following command:
    powervc-resource-operations hmc -pu <pvc_user> -pp <pvc_password> --access-ip <HMC_IP> --user-id <HMC_user> --password <HMC_password> --hmc-display-name <HMC_display_name> --host-display-name <name_of_host_to_be_registered>

Deregistering an SVC

To deregister an SVC, enter the following command:
powervc-resource-operations svc -pu <pvc_user> -pp <pvc_password> --host-display-name <host_display_name> --deregister

Deregistering HMC and hosts

Perform the following steps to deregister HMC and hosts:
  1. Deregister the hosts. Before deregistering an HMC, you must first deregister its associated hosts. To deregister the hosts, enter the following command:
    powervc-resource-operations hmc -pu <pvc_user> -pp <pvc_password> --host-display-name <host_display_name> --deregister
  2. Deregister the HMC. To deregister the HMC once all hosts are deregistered, enter the following command:
    powervc-resource-operations hmc -pu <pvc_user> -pp <pvc_password> --hmc-display-name <hmcregister> --deregister