Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: 2026 - Canonical Ltd
# SPDX-License-Identifier: Apache-2.0

"""Dell PowerFlex backend for Sunbeam storage."""
173 changes: 173 additions & 0 deletions sunbeam-python/sunbeam/storage/backends/dellpowerflex/backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# SPDX-FileCopyrightText: 2026 - Canonical Ltd
# SPDX-License-Identifier: Apache-2.0

"""Dell PowerFlex backend implementation using base step classes."""

import logging
from typing import Annotated, Literal

from pydantic import Field

from sunbeam.core.manifest import StorageBackendConfig
from sunbeam.storage.base import StorageBackendBase
from sunbeam.storage.models import PEMCertificates, SecretDictField

LOG = logging.getLogger(__name__)
Comment thread
jproque-dell marked this conversation as resolved.
Resolved


class PowerFlexConfig(StorageBackendConfig):
"""Configuration model for Dell PowerFlex backend.

This model includes the essential configuration options for deploying
a Dell PowerFlex backend. Additional configuration can be managed dynamically
through the charm configuration system.
"""

# Mandatory connection parameters
san_ip: Annotated[
str, Field(description="IP address of the PowerFlex Gateway server")
]
san_login: Annotated[
str,
Field(
description="Username for PowerFlex Gateway with administrative privileges"
),
SecretDictField(field="san-login"),
]
san_password: Annotated[
str,
Field(description="Password for PowerFlex Gateway authentication"),
SecretDictField(field="san-password"),
]
powerflex_storage_pools: Annotated[
str,
Field(
description="Comma-separated list of storage pools in format "
"protection_domain_name:storage_pool_name"
),
]

# Protocol selection
protocol: Annotated[
Literal["scaleio", "nvme-tcp"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this targeting Gazpacho? NVMe-TCP support for PowerFlex was introduced in Hibiscus: https://docs.openstack.org/releasenotes/cinder/2026.2.html

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targeting Hibiscus

Field(
description="Dell PowerFlex protocol selector: scaleio (PowerFlexDriver) "
"or nvme-tcp (PowerFlexNVMeDriver)"
),
] = "scaleio"

# PowerFlex Gateway configuration
powerflex_rest_server_port: Annotated[
int | None,
Field(description="Secured port to use when connecting to PowerFlex Manager"),
] = None

# Storage management
powerflex_max_over_subscription_ratio: Annotated[
float | None,
Field(description="Maximum oversubscription ratio allowed"),
] = None

# Volume management
powerflex_round_volume_capacity: Annotated[
bool | None,
Field(
description="Round volume sizes up to 8GB boundaries. "
"PowerFlex OS requires volumes to be sized in multiples of 8GB"
),
] = None

# Advanced configuration
powerflex_allow_non_padded_volumes: Annotated[
bool | None,
Field(
description="Allow volumes to be created in Storage Pools when zero "
"padding is disabled. Should not be enabled if multiple tenants use "
"volumes from a shared Storage Pool"
),
] = None
powerflex_allow_migration_during_rebuild: Annotated[
bool | None,
Field(description="Allow volume migration during rebuild operation"),
] = None

# REST API timeouts
rest_api_connect_timeout: Annotated[
int | None,
Field(description="Connection timeout value (in seconds) for REST calls"),
] = None
rest_api_read_timeout: Annotated[
int | None,
Field(description="Read timeout value (in seconds) for REST calls"),
] = None

# Image cache configuration
powerflex_max_image_cache_vtree_size: Annotated[
int | None,
Field(
description="Maximum size of the vTree associated with an entry in the "
"image volume cache"
),
] = None

# Performance options
use_multipath_for_image_xfer: Annotated[
bool | None,
Field(description="Enable multipathing for image transfer operations"),
] = None

# Replication configuration
replication_device: Annotated[
Comment thread
jproque-dell marked this conversation as resolved.
Resolved
str | None,
Field(
description="Specific replication configuration settings. Must be set "
"under the form of backend_id:powerflex_repl, "
"san_ip: <Replication system San ip>, "
"san_login: <Replication system San username>, "
"san_password: <Replication system San password>"
),
SecretDictField(field="replication-device"),
] = None

# SSL and security
driver_ssl_cert: Annotated[
Comment thread
jproque-dell marked this conversation as resolved.
Resolved
Comment thread
jproque-dell marked this conversation as resolved.
Resolved
PEMCertificates | None,
Field(description="PEM-encoded SSL certificate to use for HTTPS connections"),
] = None


class PowerFlexBackend(StorageBackendBase):
"""Dell PowerFlex backend implementation."""

backend_type = "dellpowerflex"
display_name = "Dell PowerFlex"
generally_available = False

@property
def charm_name(self) -> str:
"""Return the charm name for this backend."""
return "cinder-volume-dellpowerflex"

@property
def charm_channel(self) -> str:
"""Return the charm channel for this backend."""
return "2026.1/edge"

@property
def charm_revision(self) -> str | None:
"""Return the charm revision for this backend."""
return None

@property
def charm_base(self) -> str:
"""Return the charm base for this backend."""
return "ubuntu@24.04"

@property
def supports_ha(self) -> bool:
"""Return whether this backend supports HA deployments."""
return True

def config_type(self) -> type[StorageBackendConfig]:
"""Return the configuration class for Dell PowerFlex backend."""
return PowerFlexConfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from sunbeam.storage.backends.datacore.backend import DatacoreBackend
from sunbeam.storage.backends.datera.backend import DateraBackend
from sunbeam.storage.backends.dellpowerflex.backend import PowerFlexBackend
from sunbeam.storage.backends.dellpowermax.backend import DellpowermaxBackend
from sunbeam.storage.backends.dellpowerstore.backend import DellPowerstoreBackend
from sunbeam.storage.backends.dellpowervault.backend import DellPowerVaultBackend
Expand Down Expand Up @@ -297,6 +298,12 @@ def dellpowerstore_backend():
return DellPowerstoreBackend()


@pytest.fixture
def dellpowerflex_backend():
"""Provide a Dell PowerFlex backend instance."""
return PowerFlexBackend()


@pytest.fixture
def infinidat_backend():
"""Provide an Infinidat backend instance."""
Expand Down Expand Up @@ -351,6 +358,8 @@ def hpe3par_backend():
"yadro": YadroBackend,
"zadara": ZadaraBackend,
"dellpowerstore": DellPowerstoreBackend,
# Temporarily excluded until snap-helpers is updated to include it
# "dellpowerflex": PowerFlexBackend,
"solidfire": SolidFireBackend,
"hpe3par": HPEthreeparBackend,
"infinidat": InfinidatBackend,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ class TestAllBackends(BaseBackendTests):
@pytest.fixture
def backend(self, any_backend):
"""Use the parametrized any_backend fixture."""
# Skip dellpowerflex until it's added to snap-helpers SNAP_*_BACKENDS
if any_backend.backend_type == "dellpowerflex":
pytest.skip("dellpowerflex not yet classified in snap-helpers")
return any_backend


Expand Down
Loading
Loading