SaatVedha ONTAP practice shell (ontapsim.py) - version 1.2
==========================================================
NOT NetApp software. A learning tool written by SaatVedha for the
"NetApp ONTAP Storage Administration" course. It looks like the ONTAP 9.18
clustershell; real output is similar but not identical.

Needs: Python 3.8 or newer (Windows, macOS or Linux). No extra packages.

Start:
  python ontapsim.py                     log in to saat-cluster (2 nodes)
  python ontapsim.py --cluster saat-dr   log in to the DR cluster (1 node)
  python ontapsim.py --user ravi         log in as another user you created
  Login: admin   Password: saatlab1

Inside the shell:
  help              how the shell works
  volume ?          list commands under "volume"
  simctl help       lab controls: faults, workloads, client hosts
  simctl reset      start the lab again from the beginning
  exit              log out

New in 1.1
  Security   security key-manager onboard enable / keystore show / key query
             volume create ... -encrypt true, volume encryption conversion start
             security anti-ransomware volume dry-run / enable / show / attack ...
             snaplock compliance-clock initialize, volume create -snaplock-type,
             volume snaplock show/modify, locked Snapshot copies (-snaplock-expiry-time)
             security multi-admin-verify (approval groups, rules, requests)
  S3         vserver object-store-server create / user / bucket / policy / group
             network interface service-policy show / add-service
  Upgrades   cluster image show / package get / validate / update /
             show-update-progress (rolling update moves forward with "simctl tick")
  Mirrors    load-sharing mirrors: snapmirror create -type LS, initialize-ls-set,
             update-ls-set, promote
  Network    on-box DNS load balancing: network interface create/modify -dns-zone
  Other      system health status/alert show, storage aggregate show-space,
             export-policy rule setindex, cluster peer modify/delete/health show,
             volume clone split estimate, volume qtree delete, volume expand,
             metrocluster show
  Lab        simctl break ransomware, simctl dns delegate, simctl web list,
             host views: rm, chmod -w, nslookup, aws s3 ls/cp/rm

REST API mode (new in 1.1)
  python ontapsim.py --rest                  http://127.0.0.1:8080/api
  python ontapsim.py --rest 8443 --https     https://127.0.0.1:8443/api (self-signed lab
                                             certificate: use curl -k, or Ansible
                                             validate_certs: false)
  Log in with admin / saatlab1. It serves a few real ONTAP REST endpoints
  (/api/cluster, /api/cluster/nodes, /api/storage/aggregates, /api/storage/volumes,
  /api/svm/svms, /api/storage/luns, /api/network/ip/interfaces,
  /api/snapmirror/relationships, /api/cluster/jobs) and can create, resize and
  delete volumes. The Ansible netapp.ontap modules na_ontap_rest_info and
  na_ontap_volume work against the --https mode. Real ONTAP uses HTTPS on
  port 443 of the cluster management LIF.

Client hosts as real-looking shells (new in 1.2)
  python ontapsim.py --host linux1     Ubuntu 24.04 client   root@linux1:~#
  python ontapsim.py --host rhel1      Rocky Linux 9 client  [root@rhel1 ~]#
  python ontapsim.py --host sv-target  Ubuntu lab server with a spare 20 GB disk (sdb)
  python ontapsim.py --host win1       Windows Server 2025   PS C:\Users\Administrator>
  (--run <file> and -c "<command>" work here too; type "help" for the command list)
  The hosts share the lab with the cluster: an iSCSI login shows up in
  "vserver iscsi session show", a LUN you map appears after a rescan, an NFS
  mount shows in "network connections active show", and data you write fills
  the volume.
  Linux:   ip, ping (incl. -M do -s 8972), tracepath, ss, tcpdump, VLAN interfaces,
           apt / dnf / rpm, systemctl, iscsiadm, multipath -ll, multipathd,
           mpathconf, lsblk, lsscsi, sg_inq, sg_vpd, sanlun (rhel1), mkfs.xfs,
           mkfs.ext4, mount, umount, /etc/fstab, df, dd, fallocate, fstrim,
           xfs_quota (sv-target), NFS mounts, showmount, nfsstat,
           nvme discover / connect-all / list / list-subsys / netapp ontapdevices
  Windows: ipconfig, Test-NetConnection, Get-Service msiscsi, iSCSI cmdlets,
           Install-WindowsFeature Multipath-IO, Enable-MSDSMAutomaticClaim,
           mpclaim, Get-Disk / Set-Disk / Initialize-Disk / New-Partition /
           Format-Volume / Resize-Partition, net use, New-SmbMapping,
           Get-SmbConnection, Get-SmbMultichannelConnection
  NVMe/TCP on the cluster: vserver nvme create, namespace, subsystem,
           subsystem host / map / controller show, show-interface
  Host faults: simctl break host-iqn-wrong <host> | multipathd-stopped <host> |
           no-mpio | mtu-mismatch <host> | nfs-wrong-version <host>

Your lab is saved in ontapsim-state.json next to ontapsim.py. A lab saved by
version 1.0 or 1.1 keeps working in 1.2.
Check every command in the official ONTAP documentation before you run it
on a real system.
