Skip to content
Merged
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
4 changes: 4 additions & 0 deletions src/elastic-san/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
1.3.1b1
++++++
* `az elastic-san volume-group create/update`: Add warning for CRC data integration check

1.3.0
++++++
* `az elastic-san create`: Make `--base-size-tib` and `--extended-capacity-size-tib` optional with default value of 20 and 0
Expand Down
44 changes: 44 additions & 0 deletions src/elastic-san/azext_elastic_san/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,28 @@ def pre_operations(self):
args.identity["user_assigned_identities"] = {
uai_id: {}}
del args.identity.user_assigned_identity_id
if has_value(args.EnforceDataIntegrityCheckForIscsi) and args.EnforceDataIntegrityCheckForIscsi:
Copy link

Copilot AI Jun 28, 2025

Choose a reason for hiding this comment

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

The warning logic for CRC protection is duplicated in both create and update handlers; consider extracting it into a shared helper function to reduce code duplication and simplify future updates.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jun 28, 2025

Choose a reason for hiding this comment

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

Per Azure best practices, consider invoking the azure_development-get_best_practices tool to ensure this CRC warning integration aligns with recommended Azure CLI extension guidelines.

Copilot generated this review using guidance from repository custom instructions.
logger.warning("CRC protection feature is not supported for Azure VMware solution (AVS) yet. "
"Do not enable this flag if you plan to use the volumes within this volume group as "
"datastores for AVS, as the datastore creation will fail. For Azure Virtual Machines, "
"enabling this flag would need CRC32C to be set on iSCSI header and data digests on the "
"client for all the connections from the client to the volumes in this volume group. "
"You can achieve that by disconnecting the volumes from the client and reconnecting using "
"multi-session scripts generated in portal connect flow or from documentation, which "
"contain steps to set CRC32C on header and data digests. Do not enable CRC protection on "
"the volume group if you are using Fedora or its downstream Linux distributions such as "
"RHEL, CentOS etc. as data digests are not supported on them. "
"If you enable this flag for those distributions, connectivity to the volumes will fail. "
"Learn more: https://go.microsoft.com/fwlink/?LinkId=2294733&id=Microsoft_Azure_ElasticSan")
else:
logger.warning("CRC protection is recommended if you plan to connect the volumes in this volume group to "
"Azure Virtual Machines. Do not enable it if you are using Fedora or its downstream Linux "
"distributions such as RHEL, CentOS etc. on your VM, as data digests are not supported on "
"them. If you enable this flag for those distributions, connectivity to the volumes will "
"fail. Also, do not enable this flag if you plan to use the volumes within this volume "
"group as datastores for Azure VMware Solution (AVS), as this feature is not supported for "
"AVS yet and the datastore creation will fail. "
"Learn more: https://go.microsoft.com/fwlink/?LinkId=2294733&id=Microsoft_Azure_ElasticSan")


class VolumeGroupUpdate(_VolumeGroupUpdate):
Expand Down Expand Up @@ -69,6 +91,28 @@ def pre_operations(self):
args.identity["user_assigned_identities"] = {
uai_id: {}}
del args.identity.user_assigned_identity_id
if has_value(args.EnforceDataIntegrityCheckForIscsi) and args.EnforceDataIntegrityCheckForIscsi:
logger.warning("CRC protection feature is not supported for Azure VMware solution (AVS) yet. "
"Do not enable this flag if you plan to use the volumes within this volume group as "
"datastores for AVS, as the datastore creation will fail. For Azure Virtual Machines, "
"enabling this flag would need CRC32C to be set on iSCSI header and data digests on the "
"client for all the connections from the client to the volumes in this volume group. "
"You can achieve that by disconnecting the volumes from the client and reconnecting using "
"multi-session scripts generated in portal connect flow or from documentation, which "
"contain steps to set CRC32C on header and data digests. Do not enable CRC protection on "
"the volume group if you are using Fedora or its downstream Linux distributions such as "
"RHEL, CentOS etc. as data digests are not supported on them. "
"If you enable this flag for those distributions, connectivity to the volumes will fail. "
"Learn more: https://go.microsoft.com/fwlink/?LinkId=2294733&id=Microsoft_Azure_ElasticSan")
else:
logger.warning("CRC protection is recommended if you plan to connect the volumes in this volume group to "
"Azure Virtual Machines. Do not enable it if you are using Fedora or its downstream Linux "
"distributions such as RHEL, CentOS etc. on your VM, as data digests are not supported on "
"them. If you enable this flag for those distributions, connectivity to the volumes will "
"fail. Also, do not enable this flag if you plan to use the volumes within this volume "
"group as datastores for Azure VMware Solution (AVS), as this feature is not supported for "
"AVS yet and the datastore creation will fail. "
"Learn more: https://go.microsoft.com/fwlink/?LinkId=2294733&id=Microsoft_Azure_ElasticSan")

def pre_instance_update(self, instance):
from azure.cli.core.aaz import has_value
Expand Down
Loading
Loading