{"id":23087071,"url":"https://github.com/opennebula/addon-3par","last_synced_at":"2025-04-03T16:28:17.801Z","repository":{"id":74244448,"uuid":"198604169","full_name":"OpenNebula/addon-3par","owner":"OpenNebula","description":"The 3PAR datastore driver enables OpenNebula to use a HPE 3PAR storage system for storing disk images.","archived":false,"fork":false,"pushed_at":"2023-12-23T23:15:36.000Z","size":356,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-09T05:17:08.129Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenNebula.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"feldsam"}},"created_at":"2019-07-24T09:36:21.000Z","updated_at":"2023-06-01T14:00:17.000Z","dependencies_parsed_at":"2023-12-24T00:59:23.996Z","dependency_job_id":null,"html_url":"https://github.com/OpenNebula/addon-3par","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNebula%2Faddon-3par","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNebula%2Faddon-3par/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNebula%2Faddon-3par/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNebula%2Faddon-3par/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenNebula","download_url":"https://codeload.github.com/OpenNebula/addon-3par/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247036188,"owners_count":20872912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T19:42:02.170Z","updated_at":"2025-04-03T16:28:17.782Z","avatar_url":"https://github.com/OpenNebula.png","language":"Shell","funding_links":["https://github.com/sponsors/feldsam"],"categories":[],"sub_categories":[],"readme":"# HPE 3PAR Storage Driver\n\n## Description\n\nThe 3PAR datastore driver enables OpenNebula to use a [HPE 3PAR](https://www.hpe.com/us/en/storage/3par.html) storage system for storing disk images.\n\n## Development\n\nTo contribute bug patches or new features, you can use the Github Pull Request model. It is assumed that code and documentation are contributed under the Apache License 2.0.\n\nMore info:\n\n* Issues Tracking: Github issues (https://github.com/OpenNebula/addon-3par/issues)\n\n## Authors\n\n* Leader: Kristian Feldsam (feldsam@feldhost.net)\n\n## Support\n\n[FeldHost™](https://www.feldhost.net/products/opennebula) offers design, implementation, operation and management of a cloud solution based on OpenNebula.\n\n## Compatibility\n\nThis add-on is developed and tested with:\n- OpenNebula 6.2 and 3PAR OS 3.3.1.648 (MU5)+P125,P126,P132,P135,P140,P146,P150,P151,P155,P156,P164,P170,P173\n- OpenNebula 5.10 and 3PAR OS 3.3.1.648 (MU5)+P125,P126,P132,P135,P140,P146,P150,P151\n- OpenNebula 5.8 and 3PAR OS 3.3.1.460 (MU3)+P50,P58,P61,P77,P78,P81\n- OpenNebula 5.8 and 3PAR OS 3.3.1.410 (MU2)+P32,P34,P36,P37,P39,P40,P41,P42,P45,P48\n- OpenNebula 5.6 and 3PAR OS 3.2.2.612 (MU4)+P51,P56,P59,P94,P98,P102,P106,P113,P118,P127\n\n\n## Requirements\n\n### OpenNebula Front-end\n\n* Working OpenNebula CLI interface with `oneadmin` account authorized to OpenNebula's core with UID=0\n* Password-less SSH access from the front-end `oneadmin` user to the `node` instances.\n* 3PAR python package `python-3parclient` installed, WSAPI username, password and access to the 3PAR API network\n* libvirt-client package installed\n\n```bash\nyum install python-setuptools libvirt-client\neasy_install pip\npip install python-3parclient\n```\n\n### OpenNebula Node (or Bridge Node)\n\n* There is only one task (`datastore/3par/cp`), which use `BRIDGE_LIST`, so there is no need to have separate Bridge Node\n* Each OpenNebula Node (or Bridge Node) need to have relevant Host created on 3PAR\n* Host name on 3PAR and OpenNebula Node name (or Bridge Node name) must be same. Name is used for (un)exporting volumes\n* sg3_utils package installed\n* `/etc/multipath.conf` need to have set `user_friendly_names no`, because we use WWNs instead of `mpathx` aliasses\n* `/etc/sudoers.d/opennebula` - add `ONE_3PAR` cmd alias\n* `/etc/sudoers.d/opennebula-node-kvm` - add `ONE_3PAR` alias to the list\n\n```\nnano /etc/sudoers.d/opennebula\n...\nCmnd_Alias ONE_3PAR = /sbin/multipath, /usr/sbin/multipathd, /sbin/dmsetup, /usr/sbin/blockdev, /usr/bin/tee /sys/block/*/device/delete, /usr/bin/rescan-scsi-bus.sh, /sbin/mkswap, /usr/sbin/mkfs\n...\n\nnano /etc/sudoers.d/opennebula-node-kmv\n...\noneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ..., ONE_3PAR, ...\n...\n```\n\n```bash\nyum install sg3_utils\n```\n\n## Features\nSupport standard OpenNebula datastore operations:\n\n* datastore configuration via CLI\n* all Datastore MAD(DATASTORE_MAD) and Transfer Manager MAD(TM_MAD) functionality\n* SYSTEM datastore\n* TRIM/discard in the VM when virtio-scsi driver is in use (require `DEV_PREFIX=sd` and `DISCARD=unmap`)\n* disk images can be full provisioned, thin provisioned, thin deduplicated, thin compressed or thin deduplicated and compressed RAW block devices\n* support different 3PAR CPGs as separate datastore\n* support for 3PAR Priority Optimization Policy (QoS)\n* live VM snapshots\n* live VM migrations\n* volatile disks support (need patched KVM driver `attach_disk` script)\n* support multiple storage systems\n* support Remote Copy with Peer Persistence\n* support Save As between storage systems\n* support migrations of VMs between storage systems\n* ds/clone operation support cloning image between storage systems\n* Sunstone integration - available via our enterprise repository\n\n## Limitations\n\n1. Tested only with KVM hypervisor\n1. When SYSTEM datastore is in use the reported free/used/total space is the space on 3PAR CPG. (On the host filesystem there are mostly symlinks and small files that do not require much disk space)\n1. Tested/confirmed working on CentOS 7 and Oracle Linux 7 (Frontend), and Oracle Linux 7, Oracle Linux 8, CentOS 7, CentOS 8, Fedora 29+ (Nodes).\n\n## ToDo\n\n1. QOS Priority per VM\n1. Configuration of API auth in datastore template\n\n## Installation\n\nThe installation instructions are for OpenNebula 5.6+.\n\n### Get the addon from github\n```bash\ncd ~\ngit clone https://github.com/OpenNebula/addon-3par.git\n```\n\n### Automated installation\nThe automated installation is best suitable for new deployments.\n\n* Run the install script as 'root' user and check for any reported errors or warnings\n```bash\nbash ~/addon-3par/install.sh\n```\n\n### Manual installation\n\nThe following commands are related to latest OpenNebula version.\n\n#### oned related pieces\n\n* Copy 3PAR's DATASTORE_MAD driver files\n```bash\ncp -a ~/addon-3par/datastore/3par /var/lib/one/remotes/datastore/\n\n# copy config\ncp -a ~/addon-3par/etc/datastore/3par /var/lib/one/remotes/etc/datastore/\n\n# fix ownership\nchown -R oneadmin.oneadmin /var/lib/one/remotes/datastore/3par /var/lib/one/remotes/etc/datastore/3par\n\n```\n\n* Copy 3PAR's TM_MAD driver files\n```bash\ncp -a ~/addon-3par/tm/3par /var/lib/one/remotes/tm/\n\n# fix ownership\nchown -R oneadmin.oneadmin /var/lib/one/remotes/tm/3par\n```\n\n### Addon configuration\nThe global configuration of one-addon-3par is in `/var/lib/one/remotes/etc/datastore/3par/3par.conf` file.\n\n\n* Edit `/etc/one/oned.conf` and add `3par` to the `TM_MAD` arguments\n```\nTM_MAD = [\n    executable = \"one_tm\",\n    arguments = \"-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph,dev,3par\"\n]\n```\n\n* Edit `/etc/one/oned.conf` and add `3par` to the `DATASTORE_MAD` arguments\n\n```\nDATASTORE_MAD = [\n    executable = \"one_datastore\",\n    arguments  = \"-t 15 -d dummy,fs,vmfs,lvm,ceph,dev,3par  -s shared,ssh,ceph,fs_lvm,qcow2,3par\"\n]\n```\n\n* Edit `/etc/one/oned.conf` and append `TM_MAD_CONF` definition for 3par\n```\nTM_MAD_CONF = [\n  NAME = \"3par\", LN_TARGET = \"NONE\", CLONE_TARGET = \"SELF\", SHARED = \"yes\", DRIVER = \"raw\", ALLOW_ORPHANS=\"yes\"\n]\n```\n\n* Edit `/etc/one/oned.conf` and append DS_MAD_CONF definition for 3par\n```\nDS_MAD_CONF = [\n    NAME = \"3par\",\n    REQUIRED_ATTRS = \"CPG,BRIDGE_LIST\",\n    PERSISTENT_ONLY = \"NO\",\n    MARKETPLACE_ACTIONS = \"\"\n]\n```\n\n* Edit `/etc/one/oned.conf` and update VM_MAD arguments for 3par\n\n```\nVM_MAD = [\n      ARGUMENTS = \"-t 15 -r 0 kvm -l snapshotcreate=snapshot_create-3par,snapshotdelete=snapshot_delete-3par,snapshotrevert=snapshot_revert-3par\",\n      ...\n```\n\n* Enable live disk snapshots support for 3PAR by adding `kvm-3par` to `LIVE_DISK_SNAPSHOTS` variable in `/etc/one/vmm_exec/vmm_execrc`\n```\nLIVE_DISK_SNAPSHOTS=\"kvm-qcow2 kvm-ceph kvm-3par\"\n```\n\n### Post-install\n* Restart `opennebula` service\n```bash\nsystemtl restart opennebula\n```\n* As oneadmin user (re)sync the remote scripts\n```bash\nsu - oneadmin -c 'onehost sync --force'\n```\n\n### Live snapshots info\n\n* Live snapshots are tested only by using TCP communication with libvirtd on OpenNebula Nodes. Follow [this docs](https://docs.opennebula.org/5.8/deployment/open_cloud_host_setup/kvm_driver.html?highlight=qemu%20tcp#multiple-actions-per-host)\n* In `/var/lib/one/remotes/etc/vmm/kvm/kvmrc` also set `export QEMU_PROTOCOL=qemu+tcp`\n* Probably works out of the box, because by default `QEMU_PROTOCOL=qemu+ssh`, so it should tries to connect like this `virsh -c qemu+ssh://node/ ...`, but not tested\n\n### Volatile disks support info\n\nTo make volatile disks working, we need to patch vmm driver action `attach_disk`. Patched file is available in `vmm/kvm`\ndirectory and have to be installed to `/var/lib/one/remotes/vmm/kvm/`.\n\n### Configuring the System Datastore\n\nThis addon enables full support of transfer manager (TM_MAD) backend of type 3par for the system datastore.  \nThe system datastore will hold only the symbolic links to the 3PAR block devices and context isos, so it will not take much space. See more details on the [Open Cloud Storage Setup](https://docs.opennebula.org/5.8/deployment/open_cloud_storage_setup/).\n\n### Configuring the Datastore\n\nSome configuration attributes must be set to enable a datastore as 3PAR enabled one:\n\n* **DS_MAD**: [mandatory] The DS driver for the datastore. String, use value `3par`\n* **TM_MAD**: [mandatory] Transfer driver for the datastore. String, use value `3par`\n* **DISK_TYPE**: [mandatory for IMAGE datastores] Type for the VM disks using images from this datastore. String, use value `block`\n* **API_ENDPOINT**: 3PAR WSAPI Endpoint. String\n* **IP**: 3PAR IP address for SSH authentication options for the SSH based calls. String\n* **CPG**: [mandatory] Name of Common Provisioning Group created on 3PAR. String\n* **THIN**: Use thin volumes `tpvv` or no. By default enabled. `YES|NO`\n* **DEDUP**: Use deduplicated thin volumes `tdvv` or no. By default disabled. `YES|NO`\n* **COMPRESSION**: Use compressed thin volumes or no. By default disabled. `YES|NO`\n* **NAMING_TYPE**: Part of volume name defining environment. By default `dev`. String (1)\n* **BRIDGE_LIST**: [mandatory for IMAGE datastores] Nodes to use for image datastore operations. String (2)\n* **REMOTE_COPY**: Enable Remote Copy. `YES|NO`\n* **SEC_API_ENDPOINT**: [mandatory when Remote Copy] Secondary 3PAR WSAPI Endpoint. String\n* **SEC_IP**: [mandatory when Remote Copy] Secondary 3PAR IP address. String\n* **SEC_CPG**: [mandatory when Remote Copy] Name of Common Provisioning Group on Secondary 3PAR. String\n* **QOS_ENABLE**: Enable QoS. `YES|NO` (3)\n* **QOS_PRIORITY**: QoS Priority. `HIGH|NORMAL|LOW` (4)\n* **QOS_MAX\\_IOPS**: QoS Max IOPS. Int (5)\n* **QOS_MIN\\_IOPS**: QoS Min IOPS. Int (6)\n* **QOS_MAX\\_BW**: QoS Man bandwidth in kB/s. Int (7)\n* **QOS_MIN\\_BW**: QoS Min bandwidth in kB/s. Int (8)\n* **QOS_LATENCY**: QoS Latency goal in ms. Int (9)\n\n1. Volume names are created according to best practices naming conventions.\n   `\u003cTYPE\u003e` part - can be prd for production servers, dev for development servers, tst for test servers, etc.\n   Volume name will be `\u003cTYPE\u003e.one.\u003cIMAGE_ID\u003e.vv` for ex. `dev.one.1.vv` or `tst.one.3.vv`\n   \n2. Quoted, space separated list of server hostnames which are Hosts on the 3PAR System.\n\n3. QoS Rules - Applied per VM, so if VM have multiple disks, them QoS policy applies to all VM disks\n   - minimum goals and maximum limits are shared.\n   Persistent disks use `QOS_*` attributes from IMAGE datastore.\n   Non-Persistent disks use `QOS_*` attributes from target SYSTEM datastore.\n\n4. QoS Priority - Determines the sequence for throttling policies to meet latency goals.\n   High priority should be used for critical applications, lower priority should be used for less critical applications.\n   The priority will be ignored if the system does not have policies with a latency goal and minimum goal.\n\n5. The maximum IOPS permitted for the virtual volumes associated with the policy.\n   The IOPS maximum limit must be between 0 and 2 147 483 647 IO/s.\n\n6. If IOPS fall below this minimum goal, then IOPS will not be throttled (reduced) for the virtual volumes\n   associated with the policy. If a minimum goal is set for IOPS, then a maximum limit must also be set for IOPS.\n   The minimum goal will be ignored if the system does not have policies with a latency goal set.\n   The IOPS minimum goal must be between 0 and 2 147 483 647 IO/s.\n   Zero means disabled.\n\n7. The maximum bandwidth permitted for the virtual volumes associated with the policy. The maximum limit does not have\n   dependencies on the other optimization settings.\n   The bandwidth maximum limit must be between 0 and 9 007 199 254 740 991 KB/s.\n\n8. If bandwidth falls below this minimum goal, then bandwidth will not be throttled (reduced) for the virtual volumes\n   associated with the policy. If a minimum goal is set for bandwidth, then a maximum limit must also be set\n   for bandwidth. The minimum goal will be ignored if the system does not have policies with a latency goal set.\n   The bandwidth minimum goal must be between 0 and 9 007 199 254 740 991 KB/s.\n   Zero means disabled.\n\n9. Service time that the system will attempt to achieve for the virtual volumes associated with the policy.\n   A latency goal requires the system to have other policies with a minimum goal specified so that the latency goal\n   algorithm knows which policies to throttle. The sequence in which these will be throttled is set\n   by priority (low priority is throttled first).\n   The latency goal must be between 0,50 and 10 000,00 ms.\n   Zero means disabled.\n\nThe following example illustrates the creation of a 3PAR datastore.\nThe datastore will use hosts `tst.lin.fedora1.host`, `tst.lin.fedora2.host` and `tst.lin.fedora3.host` for importing and creating images.\n\n#### Image datastore through *onedatastore*\n\n```bash\n# create datastore configuration file\n$ cat \u003e/tmp/imageds.tmpl \u003c\u003cEOF\nNAME = \"3PAR IMAGE\"\nDS_MAD = \"3par\"\nTM_MAD = \"3par\"\nTYPE = \"IMAGE_DS\"\nDISK_TYPE = \"block\"\nCPG = \"SSD_r6\"\nNAMING_TYPE = \"tst\"\nBRIDGE_LIST = \"tst.lin.fedora1.host tst.lin.fedora2.host tst.lin.fedora3.host\"\nQOS_ENABLE = \"YES\"\nEOF\n\n# Create datastore\n$ onedatastore create /tmp/imageds.tmpl\n\n# Verify datastore is created\n$ onedatastore list\n\n  ID NAME                SIZE AVAIL CLUSTER      IMAGES TYPE DS       TM\n   0 system             98.3G 93%   -                 0 sys  -        ssh\n   1 default            98.3G 93%   -                 0 img  fs       ssh\n   2 files              98.3G 93%   -                 0 fil  fs       ssh\n 100 3PAR IMAGE         4.5T  99%   -                 0 img  3par     3par\n```\n\n#### System datastore through *onedatastore*\n\n```bash\n# create datastore configuration file\n$ cat \u003e/tmp/ds.conf \u003c\u003cEOF\nNAME = \"3PAR SYSTEM\"\nTM_MAD = \"3par\"\nTYPE = \"SYSTEM_DS\"\nCPG = \"SSD_r6\"\nNAMING_TYPE = \"tst\"\nQOS_ENABLE = \"YES\"\nEOF\n\n# Create datastore\n$ onedatastore create /tmp/ds.conf\n\n# Verify datastore is created\n$ onedatastore list\n\n  ID NAME                SIZE AVAIL CLUSTER      IMAGES TYPE DS       TM\n   0 system             98.3G 93%   -                 0 sys  -        shared\n   1 default            98.3G 93%   -                 0 img  fs       shared\n   2 files              98.3G 93%   -                 0 fil  fs       ssh\n 100 3PAR IMAGE         4.5T  99%   -                 0 img  3par     3par\n 101 3PAR SYSTEM        4.5T  99%   -                 0 sys  -        3par\n ```\n\n## 3PAR best practices guide incl. naming conventions\n\nPlease follow the [best practices guide](https://support.hpe.com/hpesc/public/docDisplay?docLocale=en_US\u0026docId=a00116000en_us).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennebula%2Faddon-3par","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopennebula%2Faddon-3par","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennebula%2Faddon-3par/lists"}