Dell PowerStore Python Library

3.4.2.0 · active · verified Thu Apr 16

pypowerstore is the official Python library for interacting with Dell PowerStore storage arrays. It provides a programmatic interface to manage PowerStore resources like volumes, snapshots, hosts, and more. The current version is 3.4.2.0, with releases generally aligning with new PowerStore OS versions.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart initializes the PowerStoreClient and demonstrates fetching system information and a list of volumes. Ensure your PowerStore IP, username, and password are provided, preferably via environment variables. For production, manage SSL certificates properly instead of `verify_ssl=False`.

import os
from pypowerstore.client import PowerStoreClient

POWERSTORE_HOST = os.environ.get('POWERSTORE_HOST', 'your_powerstore_ip')
POWERSTORE_USER = os.environ.get('POWERSTORE_USER', 'admin')
POWERSTORE_PASSWORD = os.environ.get('POWERSTORE_PASSWORD', 'password')

if not all([POWERSTORE_HOST, POWERSTORE_USER, POWERSTORE_PASSWORD]):
    print("Please set POWERSTORE_HOST, POWERSTORE_USER, and POWERSTORE_PASSWORD environment variables.")
    exit(1)

# Initialize the client. For lab/dev environments, verify_ssl=False is common.
# For production, ensure proper SSL certificate handling by configuring trusted CAs.
client = PowerStoreClient(
    host=POWERSTORE_HOST,
    username=POWERSTORE_USER,
    password=POWERSTORE_PASSWORD,
    verify_ssl=False # Set to True and configure trusted CAs in production environments
)

try:
    # Example: Get all systems
    systems = client.system.get()
    if systems:
        print(f"Successfully connected to PowerStore: System ID: {systems[0]['id']}, Name: {systems[0]['name']}, Model: {systems[0]['model']}")
    else:
        print("No systems found.")

    # Example: Get all volumes (if any exist)
    volumes = client.volumes.get()
    print(f"Found {len(volumes)} volumes.")
    if volumes:
        print(f"First volume ID: {volumes[0]['id']}, Name: {volumes[0]['name']}")

except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →