====== PowerVC command line ======
PowerVC is built on Openstack, so the main OpenStack functions are built into PowerVC as well.
These functions are:
Image management (in OpenStack it is called “Glance”)
Compute (VM) management (in Openstack it is called “Nova”)
Network management (in OpenStack it is called “Neutron”)
Storage management (in OpenStack it is called “Cinder”)
====== Commands ======
https://aix4admins.blogspot.com/2018/08/openstack.html
PowerVC version
[root@ibmrhelpvc01p /opt/ibm/powervc]# cat version.properties
[2.2.0 Install]
name = IBM PowerVC
version = 2.2.0
build = 20231102-0930
oem = no
install-date = 2024-02-13
cloud_enabled = yes
cluster = PowerVC
install_method = cluster
===== Services =====
**Start / Stop services **
/opt/ibm/powervc/bin/powervc-services all stop
===== Backup =====
Backup the powerVC config using:
usage: powervc-opsmgr backup [-h] -c CLUSTER [-p BACKUP_PATH] [-m] [-v]
[root@ibmpvc01 nova]# powervc-opsmgr backup -c PowerVC
PLAY [Take PowerVC Backup] *****************************************************
TASK [Gathering Facts] *********************************************************
ok: [10.10.10.10]
TASK [command] *****************************************************************
.............
IBM PowerVC backup successfully completed at 2023-01-13 19:02:19. Backup path: /var/opt/ibm/powervc/backups/20230113T185840830430/powervc_backup.tar.gz
Refer to /opt/ibm/powervc/log/backup/powervc-opsmgr_PowerVC_backup_20230113_185837/stdout for more details.
===== Openstack =====
[root@ibmpvc01 ~]# openstack token issue --os-username=root --os-auth-url=https://ibmpvc01:5000/v3 --os-cacert=/etc/pki/tls/certs/powervc.crt --os-identity-api-version 3
+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------+----------------------------------------------------------------------------+
| expires | 2023-01-13T22:18:12+0000 |
| id | gAAAAABjwYREtWsbwM_beR4Bqr5L4PFK0wP98LYpUoqnM1z9q1ErTRViGTFC9sLczNvWQTtQxo1jVbs1Ql-hYb7IBanOV-Bo_XbNtrKyJrS2eCsdsnb9wDPyzWytDeYiLEeORKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| user_id | 150f1bcbd9a74ad5994fexxxxxxxxxxxxxx |
+---------+----------------------------------------------------------------------------+
[root@ibmpvc01 ~]# openstack project list
+----------------------------------+-------------+
| ID | Name |
+----------------------------------+-------------+
| 689d14b300ba4d6fa3c297c0acdf6acb | projet1 |
| d87a04d2194c4b7e8a0bc8391502d6a9 | ibm-default |
+----------------------------------+-------------+
[root@ibmpvc01 ~]# nova --os-project-name projetAIX list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
Openstack Commands:
In the past for each component (nova, cinder, neutron…) there was a separate CLI (command line interface), which means these type of commands were available:
nova list list virtual machines (name, id, status: active or shutoff)
nova reboot reboot a virtual machine
keystone role-list view role list
neutron port-list list network ports owned by virt. machines
Later Openstack decided to integrate all these separate command line utilities into one main CLI, which is the "openstack cli".
Openstack documentation says this:
"The neutron CLI is now deprecated and will be removed in the future. Use openstack CLI instead. The keystone command line utility is pending deprecation. Over time, command line functionality will be phased out of the nova CLI and into the openstack CLI. Using the openstack client where possible is preferred but there is not full parity yet for all of the nova commands."
(Regarding the future of "cinder" and "glance" CLI I did not find anything, probably those will remain in future as well.)
Where a specific instance is needed (like in a show command), we can use either the name or the id, both will work, like in below examples:
openstack group show powervc-filter
openstack group show 985ad84d4d7a3232985de0a4220df82c5f3f38b8a961f12f8e19f1f964cbac8a
Most commands have these options:
create/delete <--create or delete an object
list <--list instances
show <--show details of specific instance
set <--set some parameter of specific instans
openstack flavor list lists flavors (compute templates)
openstack flavor show show details of specific flavor
openstack group list List groups
openstack group show show details of a group
openstack group contains user Check user membership in group
openstack group add user Add user to group
openstack group create/delete Create/Delete new group
openstack group remove user Remove user from group
openstack hypervisor list List hypervisors
openstack hypervisor show Display hypervisor details
openstack image create/delete Create/Delete an image
openstack image list List available images
openstack image show Display image details
openstack network list lists networks
openstack network show Show network details
openstack network create/delete Create/Delete network
openstack network set Set network properties
openstack port list lists ports (virtual ethernet devices on LPARS, with MAC addresses)
openstack port show Show port details
openstack port create/delete Create/Delete port
openstack port set Set port properties
openstack project list List projects
openstack project show Display project details
openstack project create/delete Create/Delete a project
openstack role add Adds a role assignment to a user or group or project
openstack role assignment list List role assignments
openstack role assignment list --user root --project 3cc716cc52c647bface86421017aed0d --names lists the roles of the given user (root)
openstack role create/delete … Create/Delete role
openstack role list List roles
openstack role remove Removes a role assignment from domain/project : user/group
openstack role set Set role properties
openstack role show Display role details
openstak server list lists server (name, id, status, network, image, flavor) (good command!!!)
openstak server create/delete create/delete a server
openstak server add/reove volume add/remove volume from a server
openstack server image create... Create a new server disk image from an existing server
openstack server migrate ... Migrate server to different host
openstack server reboot ... Perform a hard or soft server reboot
openstack server resize ... Scale server to a new flavor
openstack server show show details of a server
openstack server stop/start stop/start a server
openstack server add/remove volume… add/remove volume to a server
openstack service list lists openstack components (nova, cinder...)
openstack service show show details of giben service
openstack token issue Issue new token
openstack token revoke Revoke existing token
openstack user create/delete … Create/Delete new user
openstack user list List users
openstack user password set Change current user password
openstack user set … Set user properties
openstack user show … Display user details
openstack volume create/delete … Create/Delete volume
openstack volume list List volumes
openstack volume show… Show details of a volue
openstack volume snapshot create/delete … Create/Delete volume snapshot
openstack volume snapshot list List volume snapshots
openstack volume snapshot set Set volume snapshot properties
openstack volume snapshot show Display volume snapshot details
openstack volume type list lists storage providers
===== Novalink =====
[root@ibmpvc01 ~]# nova --os-auth-url https://ibmpvc01:5000/v3 --os-username root --os-project-name ibm-default list
+--------------------------------------+----------------+--------+------------+-------------+-----------------------+
| ID | Name | Status | Task State | Power State |Networks |
+--------------------------------------+----------------+--------+------------+-------------+-----------------------+
| 14307dbe-db30-4320-8f4c-54dc620c44d5 | AIX002 | ACTIVE | - | Running | VLAN3=; VLAN5-BACKUP= |
| 18319c1b-aca1-45c8-888d-17b8c0256a70 | AIX047 | ACTIVE | - | Running | VLAN3-TEST=10.10.10.1 |
| 7c10d210-1f20-453b-9fd3-af357f35d7e3 | AIX052 | ACTIVE | - | Running | VLAN8-TEST1=10.10.10.3|
add-secgroup Add a Security Group to a server.
agent-create DEPRECATED Create new agent build.
agent-delete DEPRECATED Delete existing agent build.
agent-list DEPRECATED List all builds.
agent-modify DEPRECATED Modify existing agent build.
aggregate-add-host Add the host to the specified aggregate.
aggregate-cache-images Request images be cached. (Supported by API
versions '2.81' - '2.latest') [hint: use '--
os-compute-api-version' flag to show help
message for proper version]
aggregate-create Create a new aggregate with the specified
details.
aggregate-delete Delete the aggregate.
aggregate-list Print a list of all aggregates.
aggregate-remove-host Remove the specified host from the specified
aggregate.
aggregate-set-metadata Update the metadata associated with the
aggregate.
aggregate-show Show details of the specified aggregate.
aggregate-update Update the aggregate's name and optionally
availability zone.
availability-zone-list List all the availability zones.
backup Backup a server by creating a 'backup' type
snapshot.
boot Boot a new server.
clear-password Clear the admin password for a server from the
metadata server. This action does not actually
change the instance server password.
console-log Get console log output of a server.
delete Immediately shut down and delete specified
server(s).
diagnostics Retrieve server diagnostics.
evacuate Evacuate server from failed host.
flavor-access-add Add flavor access for the given tenant.
flavor-access-list Print access information about the given
flavor.
flavor-access-remove Remove flavor access for the given tenant.
flavor-create Create a new flavor.
flavor-delete Delete a specific flavor
flavor-key Set or unset extra_spec for a flavor.
flavor-list Print a list of available 'flavors' (sizes of
servers).
flavor-show Show details about the given flavor.
flavor-update Update the description of an existing flavor.
(Supported by API versions '2.55' -
'2.latest') [hint: use '--os-compute-api-
version' flag to show help message for proper
version]
force-delete Force delete a server.
get-mks-console Get an MKS console to a server. (Supported by
API versions '2.8' - '2.latest') [hint: use '
--os-compute-api-version' flag to show help
message for proper version]
get-password Get the admin password for a server. This
operation calls the metadata service to query
metadata information and does not read
password information from the server itself.
get-rdp-console Get a rdp console to a server.
get-serial-console Get a serial console to a server.
get-spice-console Get a spice console to a server.
get-vnc-console Get a vnc console to a server.
host-evacuate Evacuate all instances from failed host.
host-evacuate-live Live migrate all instances off the specified
host to other available hosts.
host-meta Set or Delete metadata on all instances of a
host.
host-servers-migrate Cold migrate all instances off the specified
host to other available hosts.
hypervisor-list List hypervisors. (Supported by API versions
'2.0' - '2.latest') [hint: use '--os-compute-
api-version' flag to show help message for
proper version]
hypervisor-servers List servers belonging to specific
hypervisors.
hypervisor-show Display the details of the specified
hypervisor.
hypervisor-stats (Supported by API versions '2.0' - '2.latest')
[hint: use '--os-compute-api-version' flag to
show help message for proper version]
hypervisor-uptime Display the uptime of the specified
hypervisor.
image-create Create a new image by taking a snapshot of a
running server.
instance-action Show an action.
instance-action-list List actions on a server. (Supported by API
versions '2.0' - '2.latest') [hint: use '--os-
compute-api-version' flag to show help message
for proper version]
instance-usage-audit-log List/Get server usage audits.
interface-attach Attach a network interface to a server.
interface-detach Detach a network interface from a server.
interface-list List interfaces attached to a server.
keypair-add Create a new key pair for use with servers.
keypair-delete Delete keypair given by its name. (Supported
by API versions '2.0' - '2.latest') [hint: use
'--os-compute-api-version' flag to show help
message for proper version]
keypair-list Print a list of keypairs for a user (Supported
by API versions '2.0' - '2.latest') [hint: use
'--os-compute-api-version' flag to show help
message for proper version]
keypair-show Show details about the given keypair.
(Supported by API versions '2.0' - '2.latest')
[hint: use '--os-compute-api-version' flag to
show help message for proper version]
limits Print rate and absolute limits.
list List servers.
list-secgroup List Security Group(s) of a server.
live-migration Migrate running server to a new machine.
live-migration-abort Abort an on-going live migration. (Supported
by API versions '2.24' - '2.latest') [hint:
use '--os-compute-api-version' flag to show
help message for proper version]
live-migration-force-complete
Force on-going live migration to complete.
(Supported by API versions '2.22' -
'2.latest') [hint: use '--os-compute-api-
version' flag to show help message for proper
version]
lock Lock a server. A normal (non-admin) user will
not be able to execute actions on a locked
server.
meta Set or delete metadata on a server.
migrate Migrate a server.
migration-list Print a list of migrations. (Supported by API
versions '2.0' - '2.latest') [hint: use '--os-
compute-api-version' flag to show help message
for proper version]
pause Pause a server.
quota-class-show List the quotas for a quota class.
quota-class-update Update the quotas for a quota class.
(Supported by API versions '2.0' - '2.latest')
[hint: use '--os-compute-api-version' flag to
show help message for proper version]
quota-defaults List the default quotas for a tenant.
quota-delete Delete quota for a tenant/user so their quota
will Revert back to default.
quota-show List the quotas for a tenant/user.
quota-update Update the quotas for a tenant/user.
(Supported by API versions '2.0' - '2.latest')
[hint: use '--os-compute-api-version' flag to
show help message for proper version]
reboot Reboot a server.
rebuild Shutdown, re-image, and re-boot a server.
refresh-network Refresh server network information.
remove-secgroup Remove a Security Group from a server.
rescue Reboots a server into rescue mode, which
starts the machine from either the initial
image or a specified image, attaching the
current boot disk as secondary.
reset-network Reset network of a server.
reset-state Reset the state of a server.
resize Resize a server.
resize-confirm Confirm a previous resize.
resize-revert Revert a previous resize (and return to the
previous VM).
restore Restore a soft-deleted server.
resume Resume a server.
server-group-create Create a new server group with the specified
details. (Supported by API versions '2.0' -
'2.latest') [hint: use '--os-compute-api-
version' flag to show help message for proper
version]
server-group-delete Delete specific server group(s).
server-group-get Get a specific server group.
server-group-list Print a list of all server groups.
server-migration-list Get the migrations list of specified server.
(Supported by API versions '2.23' -
'2.latest') [hint: use '--os-compute-api-
version' flag to show help message for proper
version]
server-migration-show Get the migration of specified server.
(Supported by API versions '2.23' -
'2.latest') [hint: use '--os-compute-api-
version' flag to show help message for proper
version]
server-tag-add Add one or more tags to a server. (Supported
by API versions '2.26' - '2.latest') [hint:
use '--os-compute-api-version' flag to show
help message for proper version]
server-tag-delete Delete one or more tags from a server.
(Supported by API versions '2.26' -
'2.latest') [hint: use '--os-compute-api-
version' flag to show help message for proper
version]
server-tag-delete-all Delete all tags from a server. (Supported by
API versions '2.26' - '2.latest') [hint: use '
--os-compute-api-version' flag to show help
message for proper version]
server-tag-list Get list of tags from a server. (Supported by
API versions '2.26' - '2.latest') [hint: use '
--os-compute-api-version' flag to show help
message for proper version]
server-tag-set Set list of tags to a server. (Supported by
API versions '2.26' - '2.latest') [hint: use '
--os-compute-api-version' flag to show help
message for proper version]
server-topology Retrieve server topology. (Supported by API
versions '2.78' - '2.latest') [hint: use '--
os-compute-api-version' flag to show help
message for proper version]
service-delete Delete the service by UUID ID. If deleting a
nova-compute service, be sure to stop the
actual nova-compute process on the physical
host before deleting the service with this
command. Failing to do so can lead to the
running service re-creating orphaned
compute_nodes table records in the database.
(Supported by API versions '2.0' - '2.latest')
[hint: use '--os-compute-api-version' flag to
show help message for proper version]
service-disable Disable the service. (Supported by API
versions '2.0' - '2.latest') [hint: use '--os-
compute-api-version' flag to show help message
for proper version]
service-enable Enable the service. (Supported by API versions
'2.0' - '2.latest') [hint: use '--os-compute-
api-version' flag to show help message for
proper version]
service-force-down Force service to down. (Supported by API
versions '2.11' - '2.latest') [hint: use '--
os-compute-api-version' flag to show help
message for proper version]
service-list Show a list of all running services. Filter by
host & binary.
set-password Change the admin password for a server.
shelve Shelve a server.
shelve-offload Remove a shelved server from the compute node.
show Show details about the given server.
ssh SSH into a server.
start Start the server(s).
stop Stop the server(s).
suspend Suspend a server.
trigger-crash-dump Trigger crash dump in an instance. (Supported
by API versions '2.17' - '2.latest') [hint:
use '--os-compute-api-version' flag to show
help message for proper version]
unlock Unlock a server.
unpause Unpause a server.
unrescue Restart the server from normal boot disk
again.
unshelve Unshelve a server.
update Update the name or the description for a
server.
usage Show usage data for a single tenant.
usage-list List usage data for all tenants.
version-list List all API versions.
volume-attach Attach a volume to a server.
volume-attachments List all the volumes attached to a server.
volume-detach Detach a volume from a server.
volume-update Update the attachment on the server. If
dest_volume is the same as the src_volume then
the command migrates the data from the
attached volume to the specified available
volume and swaps out the active attachment to
the new volume. Otherwise it only updates the
parameters of the existing attachment.
bash-completion Prints all of the commands and options to
stdout so that the nova.bash_completion script
doesn't have to hard code them.
help Display help about this program or one of its
subcommands.
rtpolicy-event-list Dispaly runtime policy events.
rtpolicy-hypervisor-list Display hypervisors' runtime policy status.
rtpolicy-list List all policies.
rtpolicy-show Show details of the specified policy.
rtpolicy-update Update policy settings.
hypervisor-status-list List status of all hypervisors.
hypervisor-status-show Show status of the specified hypervisor.
maintenance-disable Disable maintenance mode for a hypervisor.
maintenance-enable Enable maintenance mode for a hypervisor.
hapolicy-event-list Display HA policy events.
hapolicy-hypervisor-list Display hypervisors' hapolicy status.
hapolicy-list List all policies.
hapolicy-show Show details of the specified policy.
hapolicy-update Update policy settings.
[root@ibmpvc01 ~]# nova --os-auth-url https://ibmpvc01:5000/v3 --os-username root --os-project-name ibm-default hypervisor-list
+--------------------------------------+---------------------+-------+---------+
| ID | Hypervisor hostname | State | Status |
+--------------------------------------+---------------------+-------+---------+
| 7b1c1c2a-ff6e-4b5f-80bb-035278fbe7fa | 828422A_xxxxx3V | up | enabled |
| 06fe7179-adad-44e7-b9b3-21b4ffb26f53 | 828422A_xxxxx6V | up | enabled |
[root@ibmpvc01 ~]# nova --os-auth-url https://ibmpvc01:5000/v3 --os-username root --os-project-name ibm-default hypervisor-servers 828422A_xxxxx3V
+--------------------------------------+---------+--------------------------------------+---------------------+
| ID | Name | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+---------+--------------------------------------+---------------------+
| 4c68b784-220c-44f5-93a3-7275bad5670e | LNX025 | 7b1c1c2a-ff6e-4b5f-80bb-035278fbe7fa | 828422A_xxxxx3V |
| 6f887754-766f-4e85-8771-2c7582d6e035 | AIX096 | 7b1c1c2a-ff6e-4b5f-80bb-035278fbe7fa | 828422A_xxxxx3V |
| 1480ae45-bf67-42cc-9fb7-c0104ffadd82 | AIX018 | 7b1c1c2a-ff6e-4b5f-80bb-035278fbe7fa | 828422A_xxxxx3V |
[root@ibmpvc01 ~]# nova --os-auth-url https://ibmpvc01:5000/v3 --os-username root --os-project-name ibm-default hypervisor-show 7b1c1c2a-ff6e-4b5f-80bb-035278fbe7fa
+-----------------------------+------------------------------------------+
| Property | Value |
+-----------------------------+------------------------------------------+
| dro_consecutive_alert_times | 0 |
| dro_violated | 0 |
| health_status_health_value | PENDING |
| health_status_id | 7b1c1c2a-ff6e-4b5f-80bb-035278fbe7fa |
| health_status_updated_at | 2023-01-13T17:03:11.333838 |
| health_status_value_reason | PENDING |
| host_ip | 10.1.1.1 |
| hypervisor_hostname | 828422A_xxxxx3V |
| hypervisor_state | UNKNOWN |
| hypervisor_type | phyp |
| hypervisor_version | 8 |
| id | 7b1c1c2a-ff6e-4b5f-80bb-035278fbe7fa |
| service_disabled_reason | None |
| service_hmc_uuids | ["01eec5a1-539a-3a29-8a6f-7faf5fb7e926", |
| | "5157c2cc-90ba-30ae-8b15-6028cb20e0de"] |
| service_host | 828422A_xxxxx3V |
| service_host_display_name | srv01-p820 |
| service_host_storage_type | SAN |
| service_host_type | powervm |
| service_id | 72fb9e7a-7867-4af5-8841-b43219691b63 |
| service_manager_type | hmc |
| service_primary_hmc_uuid | 5157c2cc-90ba-30ae-8b15-6028cb20e0de |
| service_secondary_hmc_uuids | ["01eec5a1-539a-3a29-8a6f-7faf5fb7e926"] |
| service_vios_clusters | [] |
| state | up |
| status | enabled |
| uptime | None |
+-----------------------------+------------------------------------------+
===== Misc =====
Get IDs
# ll /var/lib/cinder
===== PowerVC - Volume and zone naming =====
You can specify a template for the zoning name. The zone-name-template can be a combination of these keys: 'vm_name', 'storage_hostname', 'storage_display_name', 'intiatior_wwpn', 'target_wwpns', or your custom string. vm_name corresponds to virtual machine's host name.
# powervc-config storage fc-zone zone-name-template
-t "DATA_CENTER_1_%(initiator_wwpn)s_%(vm_name)s_%(storage_display_name).6s"
DATA_CENTER_1_c050760867264558_TEST_INITIATO__HDS_G18JTA
You can specify a template for the volume name. The vol-name-template can be a combination of these keys: 'display_name’ ,’id’ or your custom string.
# powervc-config storage vol-name-format --template ‘vol-%(display_name).37s-%(id).13s’