-
Notifications
You must be signed in to change notification settings - Fork 7
Commit b46c60e
committed
netapp cleanup script: update for LIF and ports
Example run:
```
❯ ./delete_volumes_and_svms_netapp.py 70487c184b8244e39d8ffea6d7c4908d
Deleting resources for project: 70487c184b8244e39d8ffea6d7c4908d
Connecting to ONTAP: netapp1.dev.undercloud.rackspace.net
Starting LIF cleanup process for SVM: os-70487c184b8244e39d8ffea6d7c4908d
Step 1: Discovering LIFs for SVM os-70487c184b8244e39d8ffea6d7c4908d
Found 4 LIFs for SVM os-70487c184b8244e39d8ffea6d7c4908d
Debug - Raw LIF data: {'uuid': '6bdea5db-8745-11f0-9990-d039eabcb02a', 'name': 'N1-lif-A', 'ip': {'address': '100.127.0.69'}, 'svm': {'name': 'os-70487c184b8244e39d8ffea6d7c4908d'}, 'location': {'home_node': {'name': 'c-5836964-1337319-n01'}, 'home_port': {'uuid': '6bbee3ac-8745-11f0-9990-d039eabcb02a', 'name': 'e4a-2008', '_links': {'self': {'href': '/api/network/ethernet/ports/6bbee3ac-8745-11f0-9990-d039eabcb02a'}}}}, '_links': {'self': {'href': '/api/network/ip/interfaces/6bdea5db-8745-11f0-9990-d039eabcb02a'}}}
LIF: N1-lif-A (UUID: 6bdea5db-8745-11f0-9990-d039eabcb02a)
Home Port: e4a-2008 (UUID: 6bbee3ac-8745-11f0-9990-d039eabcb02a)
Home Node: c-5836964-1337319-n01
Debug - Raw LIF data: {'uuid': '6c33d011-8745-11f0-9990-d039eabcb02a', 'name': 'N1-lif-B', 'ip': {'address': '100.127.128.69'}, 'svm': {'name': 'os-70487c184b8244e39d8ffea6d7c4908d'}, 'location': {'home_node': {'name': 'c-5836964-1337319-n01'}, 'home_port': {'uuid': '6c178b20-8745-11f0-9990-d039eabcb02a', 'name': 'e4b-2008', '_links': {'self': {'href': '/api/network/ethernet/ports/6c178b20-8745-11f0-9990-d039eabcb02a'}}}}, '_links': {'self': {'href': '/api/network/ip/interfaces/6c33d011-8745-11f0-9990-d039eabcb02a'}}}
LIF: N1-lif-B (UUID: 6c33d011-8745-11f0-9990-d039eabcb02a)
Home Port: e4b-2008 (UUID: 6c178b20-8745-11f0-9990-d039eabcb02a)
Home Node: c-5836964-1337319-n01
Debug - Raw LIF data: {'uuid': '6c8c4b89-8745-11f0-b46e-d039eabcaa76', 'name': 'N2-lif-A', 'ip': {'address': '100.127.0.70'}, 'svm': {'name': 'os-70487c184b8244e39d8ffea6d7c4908d'}, 'location': {'home_node': {'name': 'c-5836964-1337320-n02'}, 'home_port': {'uuid': '6c67b34e-8745-11f0-b46e-d039eabcaa76', 'name': 'e4a-2008', '_links': {'self': {'href': '/api/network/ethernet/ports/6c67b34e-8745-11f0-b46e-d039eabcaa76'}}}}, '_links': {'self': {'href': '/api/network/ip/interfaces/6c8c4b89-8745-11f0-b46e-d039eabcaa76'}}}
LIF: N2-lif-A (UUID: 6c8c4b89-8745-11f0-b46e-d039eabcaa76)
Home Port: e4a-2008 (UUID: 6c67b34e-8745-11f0-b46e-d039eabcaa76)
Home Node: c-5836964-1337320-n02
Debug - Raw LIF data: {'uuid': '6ce935ae-8745-11f0-b46e-d039eabcaa76', 'name': 'N2-lif-B', 'ip': {'address': '100.127.128.70'}, 'svm': {'name': 'os-70487c184b8244e39d8ffea6d7c4908d'}, 'location': {'home_node': {'name': 'c-5836964-1337320-n02'}, 'home_port': {'uuid': '6cc40c40-8745-11f0-b46e-d039eabcaa76', 'name': 'e4b-2008', '_links': {'self': {'href': '/api/network/ethernet/ports/6cc40c40-8745-11f0-b46e-d039eabcaa76'}}}}, '_links': {'self': {'href': '/api/network/ip/interfaces/6ce935ae-8745-11f0-b46e-d039eabcaa76'}}}
LIF: N2-lif-B (UUID: 6ce935ae-8745-11f0-b46e-d039eabcaa76)
Home Port: e4b-2008 (UUID: 6cc40c40-8745-11f0-b46e-d039eabcaa76)
Home Node: c-5836964-1337320-n02
Found 4 LIFs that need to be cleaned up
Step 2: Analyzing home ports used by SVM os-70487c184b8244e39d8ffea6d7c4908d
Found 4 unique home ports used by SVM os-70487c184b8244e39d8ffea6d7c4908d
Analyzing 34 total LIFs across all SVMs for port usage
Found 4 home ports used exclusively by SVM os-70487c184b8244e39d8ffea6d7c4908d
Exclusive port: e4a-2008 on node c-5836964-1337320-n02 (UUID: 6c67b34e-8745-11f0-b46e-d039eabcaa76)
Exclusive port: e4b-2008 on node c-5836964-1337320-n02 (UUID: 6cc40c40-8745-11f0-b46e-d039eabcaa76)
Exclusive port: e4b-2008 on node c-5836964-1337319-n01 (UUID: 6c178b20-8745-11f0-9990-d039eabcb02a)
Exclusive port: e4a-2008 on node c-5836964-1337319-n01 (UUID: 6bbee3ac-8745-11f0-9990-d039eabcb02a)
Identified 4 home ports for potential cleanup
Step 3: Deleting 4 LIFs for SVM os-70487c184b8244e39d8ffea6d7c4908d
Deleting LIF: N1-lif-A (UUID: 6bdea5db-8745-11f0-9990-d039eabcb02a)
Successfully deleted LIF N1-lif-A (UUID: 6bdea5db-8745-11f0-9990-d039eabcb02a)
Deleting LIF: N1-lif-B (UUID: 6c33d011-8745-11f0-9990-d039eabcb02a)
Successfully deleted LIF N1-lif-B (UUID: 6c33d011-8745-11f0-9990-d039eabcb02a)
Deleting LIF: N2-lif-A (UUID: 6c8c4b89-8745-11f0-b46e-d039eabcaa76)
Successfully deleted LIF N2-lif-A (UUID: 6c8c4b89-8745-11f0-b46e-d039eabcaa76)
Deleting LIF: N2-lif-B (UUID: 6ce935ae-8745-11f0-b46e-d039eabcaa76)
Successfully deleted LIF N2-lif-B (UUID: 6ce935ae-8745-11f0-b46e-d039eabcaa76)
LIF deletion completed: 4/4 LIFs deleted successfully
Step 4: Cleaning up 4 exclusive home ports
Starting cleanup of 4 home ports
Attempting to clean up home port e4a-2008 on node c-5836964-1337320-n02 (UUID: 6c67b34e-8745-11f0-b46e-d039eabcaa76)
Port e4a-2008 details retrieved successfully
Port e4a-2008 type: vlan, state: up
Port e4a-2008 is VLAN type - proceeding with cleanup
Home port e4a-2008 cleanup completed (VLAN configuration verified)
Attempting to clean up home port e4b-2008 on node c-5836964-1337320-n02 (UUID: 6cc40c40-8745-11f0-b46e-d039eabcaa76)
Port e4b-2008 details retrieved successfully
Port e4b-2008 type: vlan, state: up
Port e4b-2008 is VLAN type - proceeding with cleanup
Home port e4b-2008 cleanup completed (VLAN configuration verified)
Attempting to clean up home port e4b-2008 on node c-5836964-1337319-n01 (UUID: 6c178b20-8745-11f0-9990-d039eabcb02a)
Port e4b-2008 details retrieved successfully
Port e4b-2008 type: vlan, state: up
Port e4b-2008 is VLAN type - proceeding with cleanup
Home port e4b-2008 cleanup completed (VLAN configuration verified)
Attempting to clean up home port e4a-2008 on node c-5836964-1337319-n01 (UUID: 6bbee3ac-8745-11f0-9990-d039eabcb02a)
Port e4a-2008 details retrieved successfully
Port e4a-2008 type: vlan, state: up
Port e4a-2008 is VLAN type - proceeding with cleanup
Home port e4a-2008 cleanup completed (VLAN configuration verified)
Home port cleanup completed: 4/4 ports processed successfully
Home port cleanup completed successfully
=== LIF Cleanup Summary ===
SVM: os-70487c184b8244e39d8ffea6d7c4908d
LIFs found: 4
LIFs deleted: 4
Home ports identified for cleanup: 4
Home ports cleaned: 4
LIF cleanup process completed successfully
=== End LIF Cleanup Summary ===
Volume vol_70487c184b8244e39d8ffea6d7c4908d deletion initiated successfully
SVM os-70487c184b8244e39d8ffea6d7c4908d deletion initiated successfully
All resources deleted successfully
```1 parent 0432bb1 commit b46c60eCopy full SHA for b46c60e
File tree
Expand file treeCollapse file tree
1 file changed
+519
-2
lines changedFilter options
- scripts
Expand file treeCollapse file tree
1 file changed
+519
-2
lines changed
0 commit comments