Skip to content

feat: adding netapp-iscsi-helper script#72

Open
sanya-pf9 wants to merge 2 commits into
masterfrom
sanya/netapp-iscsi-audit
Open

feat: adding netapp-iscsi-helper script#72
sanya-pf9 wants to merge 2 commits into
masterfrom
sanya/netapp-iscsi-audit

Conversation

@sanya-pf9
Copy link
Copy Markdown
Collaborator

After a failed live migration, OpenStack can leave behind corrupted iSCSI
attachment state on the NetApp array. The VM may still be running, but its
disk is mapped to the wrong igroup — which can cause I/O errors, failed
rescans, or a complete loss of disk access on the next reboot.

This script:

  1. Queries Nova and Cinder to find every VM and its attached volumes
  2. Queries NetApp ONTAP to check which igroup each LUN is mapped to
  3. Compares the two and reports any mismatch
  4. Optionally fixes the NetApp igroup mappings automatically

All testing evidence and samples can be found in the READ ME



def get_server(server_id):
s = os_cmd("server", "show", server_id)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if os_cmd returns empty/[] or invalid json, then accessing json object will cause get_server crash. Need to handle that case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

if matched:
for s in matched:
host_iqn_map[s] = {iqn}
print(f" --host-iqn: {s} → {iqn}", flush=True)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we want here to replace existing?? or add to existing?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, Now --host-iqn accumulates on top of whatever was inferred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants