{"id":22281454,"url":"https://github.com/jenkinsci/openstack-cloud-plugin","last_synced_at":"2025-04-04T20:10:44.094Z","repository":{"id":27290536,"uuid":"30764186","full_name":"jenkinsci/openstack-cloud-plugin","owner":"jenkinsci","description":"Provision nodes from OpenStack on demand","archived":false,"fork":false,"pushed_at":"2024-12-16T19:45:53.000Z","size":2479,"stargazers_count":47,"open_issues_count":91,"forks_count":89,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T19:08:04.551Z","etag":null,"topics":["adopt-this-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/openstack-cloud","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-13T16:13:29.000Z","updated_at":"2025-03-03T13:04:33.000Z","dependencies_parsed_at":"2025-01-17T10:32:58.109Z","dependency_job_id":null,"html_url":"https://github.com/jenkinsci/openstack-cloud-plugin","commit_stats":null,"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fopenstack-cloud-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fopenstack-cloud-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fopenstack-cloud-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fopenstack-cloud-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/openstack-cloud-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"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":["adopt-this-plugin"],"created_at":"2024-12-03T16:18:25.382Z","updated_at":"2025-04-04T20:10:44.069Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenStack Cloud plugin for Jenkins\n\nProvision nodes from OpenStack on demand.\n  \n[![Build Status](https://ci.jenkins.io/job/Plugins/job/openstack-cloud-plugin/job/master/badge/icon)](https://ci.jenkins.io/job/Plugins/job/openstack-cloud-plugin/job/master/)\n\n## Essentials\n\n\u003ca href=\"https://raw.githubusercontent.com/jenkinsci/openstack-cloud-plugin/master/docs/config.png\"\u003e\u003cimg align=\"right\" width=\"300\" src=\"https://raw.githubusercontent.com/jenkinsci/openstack-cloud-plugin/master/docs/config.png\"\u003e\u003c/a\u003e\nIn order to provision new nodes when Jenkins load goes high,\nadministrator needs to configure *Cloud* and one or more *Templates* on\nglobal configuration page. Cloud represents connection to particular\nOpenStack project (tenant). In order to use several openstack instances\nor projects, it is necessary to configure several Clouds in Jenkins.\nTemplate can be seen as a definition of particular *kind* of node.\nTemplate is the primary holder of all the attributes for OpenStack\nmachine to be provisioned (image, flavor, etc.) as well as for Jenkins\nnode (number of executors, etc.). Note the attributes\ncan be configured on Cloud level as well. Such configuration will be\nthen used as default for its templates. For example, if all nodes are\nsupposed to use the same key-pair there is no need to state it in every\ntemplate, it can be configured on cloud level and leave the filed blank\nin the templates.\n\n\u003ca href=\"https://raw.githubusercontent.com/jenkinsci/openstack-cloud-plugin/master/docs/options.png\"\u003e\u003cimg align=\"right\" width=\"300\" src=\"https://raw.githubusercontent.com/jenkinsci/openstack-cloud-plugin/master/docs/options.png\"\u003e\u003c/a\u003e\nAside from machine/node attributes, every template require name and\nlabels to be configured. Name will serve both as an identifier of the\ntemplate as well as a name prefix for Jenkins node and OpenStack machine\n(that is why some limitations apply here). Labels field expects a set of\nJenkins labels that will be assigned to all nodes that the template\nprovisions. It will also be used to determine which cloud and template to\nuse to process Jenkins load. When there is a build with no label\nrequirements, any\ntemplate can be used to provision the node. Build with label restriction\ncan trigger provisioning only on templates with matching label set. The\nattributes at template level will inherit all global values (the value\nin effect is printed under the field on hte config page). In case required\nfield do not have a default nor current value, it will be reported.\n\nThe exception is here is the *Instance Cap* field that determines the maximal\namount of machines to be running either per whole cloud or per template. This is\nso one can limit the total number and number per individual template at the same time.\n\n### User data\n\nEvery template can declare user-data script to be passed to\n[cloud-init](https://cloudinit.readthedocs.io/en/latest/index.html) to customize\nthe machine that is provisioned. Note that the image needs to support\ncloud init explicitly.\n\nBefore the script is sent to OpenStack, plugin injects several values\nusing `${VARIABLE_NAME}` syntax:\n\n-   **`JENKINS_URL`**: The URL of the Jenkins instance\n-   **`SLAVE_JAR_URL`**: URL of the slave.jar - the agent executable\n-   **`SLAVE_JNLP_URL`**: The endpoint URL for JNLP connection\n-   **`SLAVE_JNLP_SECRET`**: The JNLP 'secret' key. This key authorizes\n    to connect Jenkins agent process to a Jenkins computer. Note that\n    referencing this in server user-data (and then using it to launch\n    agent process) makes it exposed to any user or automation permitted\n    to access the Jenkins agent (including running builds). Also, when\n    OpenStack deployment uses metadata service, which it often does, it\n    must be deployed in a way this is guaranteed not to leak. See\n    [OSSN-0074](https://wiki.openstack.org/wiki/OSSN/OSSN-0074) for\n    further details.\n-   **`SLAVE_LABELS`**: Labels of the corresponding Jenkins computer\n\n### Reporting\n\nOpenstack plugin utilizes [Cloud Statistics](https://plugins.jenkins.io/cloud-stats) that captures failures and time trends of past provisioning attempts.\n\n### Configuration As Code\n\nSince version 2.46, [JCasC](https://jenkins.io/projects/jcasc/) is supported. Example:\n\n```yaml\njenkins:\n  clouds:\n    - openstack:\n        name: \"foo\"\n        endPointUrl: \"https://acme.com:5000\"\n        credentialsId: \"openstack_service_credentials\"\n        ignoreSsl: false\n        zone: foo\n        slaveOptions:\n          bootSource:\n            image:\n              name: \"Image Name\"\n          hardwareId: \"hid\"\n          networkId: \"net\"\n          userDataId: \"user-data-id\"\n          instanceCap: 11\n          instancesMin: 1\n          floatingIpPool: \"baz\"\n          securityGroups: \"s1,s2\"\n          availabilityZone: \"bax\"\n          startTimeout: 15\n          keyPairName: \"key\"\n          numExecutors: 2\n          jvmOptions: \"-Xmx1G\"\n          fsRoot: \"/tmp/foo\"\n          launcherFactory:\n            ssh:\n              credentialsId: \"openstack_ssh_key\"\n              javaPath: \"/bin/true\"\n          retentionTime: 42\n        templates:\n          - name: \"empty\"\n            labels: \"linux\"\n          - name: \"jnlp\"\n            labels: \"jnlp\"\n            slaveOptions:\n              launcherFactory: \"jnlp\"\n          - name: \"volumeSnapshot\"\n            labels: \"volume\"\n            slaveOptions:\n              bootSource:\n                volumeSnapshot:\n                  name: \"Volume name\"\n          - name: \"volumeFromImage\"\n            labels: \"volume from image\"\n            slaveOptions:\n              bootSource:\n                volumeFromImage:\n                  name: \"Volume name\"\n                  volumeSize: 15\n \nunclassified:\n  globalConfigFiles:\n    configs:\n      - openstackUserData:\n          id: user-data-id\n          name: \"My user data\"\n          comment: \"... with a comment\"\n          content: \u003e\n            #cloud-config\n            disable_root: 0\n            ssh_pwauth: True\n            chpasswd: { expire: False }\n \n            users:\n              - name: root\n                password: toor\n                lock-passwd: false\n                inactive: false\n                system: false\n \ncredentials:\n  system:\n    domainCredentials:\n      - credentials:\n          - openstackV3:\n              scope: SYSTEM\n              id: \"openstack_service_credentials\"\n              description: \"desc\"\n              userName: \"foo\"\n              userDomain: \"acme.com\"\n              projectName: \"casc\"\n              projectDomain: \"acme.com\"\n              password: \"bar\" # Do not hardcode plaintext secrets for real world declarations!\n          - openstackV2:\n              scope: SYSTEM\n              id: \"openstack_service_credentialsV2\"\n              description: \"desc\"\n              username: \"username\"\n              password: \"pwd\" # Do not hardcode plaintext secrets for real world declarations!\n              tenant: \"tnt\"\n          - basicSSHUserPrivateKey:\n              scope: SYSTEM\n              id: \"openstack_ssh_key\"\n              username: \"jenkins\"\n              privateKeySource:\n                directEntry:\n                  # Do not hardcode plaintext secrets for real world declarations!\n                  privateKey: |\n                    -----BEGIN OPENSSH PRIVATE KEY-----\n                    b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn\n                    NhAAAAAwEAAQAAAQEAleOyx/pWbWBWrKOXyDpXio33Y6jAXdAi2mqo1nKIcIX75U71WxcR\n                    2+i+IqlyVm85YcBQ3xKZ9KVxW9rCGn/KNJkQdQa+hGltJUHJNLPGCoZG0Qj5LLhXW3SSOQ\n                    3X2e8FMLTmrHeBqOZhFJr9ijlDX23Hbo5JENGs8MCXAfFBcthBViWWouaon2qgH1xncT19\n                    OVpQbAozwgqM1pl+6fL1yvBw89emAix+G+iy+r89fk+mb/5jwkikFsk9qhZrQIkrSsGS2h\n                    noH+LeRUtMyDcjXcqC214PtyI38hA+TxjIfqNBz8VF9juhAq28kOVFMPBNxoI8bW2F6/1h\n                    49Jkg9iLzQAAA8i2KKHJtiihyQAAAAdzc2gtcnNhAAABAQCV47LH+lZtYFaso5fIOleKjf\n                    djqMBd0CLaaqjWcohwhfvlTvVbFxHb6L4iqXJWbzlhwFDfEpn0pXFb2sIaf8o0mRB1Br6E\n                    aW0lQck0s8YKhkbRCPksuFdbdJI5DdfZ7wUwtOasd4Go5mEUmv2KOUNfbcdujkkQ0azwwJ\n                    cB8UFy2EFWJZai5qifaqAfXGdxPX05WlBsCjPCCozWmX7p8vXK8HDz16YCLH4b6LL6vz1+\n                    T6Zv/mPCSKQWyT2qFmtAiStKwZLaGegf4t5FS0zINyNdyoLbXg+3IjfyED5PGMh+o0HPxU\n                    X2O6ECrbyQ5UUw8E3GgjxtbYXr/WHj0mSD2IvNAAAAAwEAAQAAAQBJrcbZBFZtp3iTnkri\n                    8sLLaeOcinwc4U3wnZNm7p/g6AudeYWkBCAUQEEOWsrIcB39zgIy1Tr2hkjFxS+6xOxJlK\n                    ABVpJaFlS/hqn4DRKhY8X1xPpvICJY42FpSEO9bf/YJGRrjMcgljZMYa+VvXY/t3/b+Xcz\n                    HE5tfc3893GbmK9YUvFu6WdGg/3J3M/L3NvJVlPDfq7hQkx1EPVv/w5B+CNrVRayKypVRj\n                    3cV/akjVuSblOs227nFzEtt6WDFky7H0T7rwoJKT0Co+4gVheQGibzU726MdXgVI2W2SPo\n                    h3HcQfA74FLi6JeM1s/Fkl4UZctbxzXXrtW3v8ecEbEhAAAAgFc8FdBS7Jbo+ofOgfmTBE\n                    fCkvVU/TIvPrkz6KAJxuBaYYGpT+YtSoJwpmdjOn0M23KiDA/4i+1G/NVZXa/N22rUd9Gp\n                    uSikOImAwrhB3hjr5c/8lt+iC89fdWQBEZs2QsxLeHPIqNnjYlyDa6Rz0t4lQe54rmbtXR\n                    FYgMGGBglTAAAAgQDEYxhyBdzLMg1U8XTe6rQ41ikPuePdeUghP0JCjq7M5TzdTRCC1oDe\n                    vwREeLNFOvDLdl8sqYGJTegpdVM2FHIQBmbxamM2Ms0YSETsCMWUHJguh3mKvIx8ICPkoZ\n                    eNN2HlSxh2ug3unE9vANuJKZztAsnPMoafMPyKmH5XbL+F1QAAAIEAw2NZu/9a815Rwr7C\n                    JbAt3jdjyM6MIVAFb7BQS1wtGsitZCaeb0Pond+T4j7mOTbzMZhE0lstwsWWrDWlX9LkHV\n                    RsDHpCNTnxRfQeA1NL5LoTIW8OfjV2/NiGAa6INerBBURRKlIRJYdLmdi/IoNSzwBzC/mV\n                    kh2nsVg0sOMNkhkAAAAMb2dvbmR6YUBhcmNoAQIDBAUGBw==\n                    -----END OPENSSH PRIVATE KEY-----\n```\n  \n\n### Tips and tricks\n\n-   User can manually provision agent from particular cloud/template on\n    *Manage Jenkins \\\u003e Manage Nodes.*\n-   Plugin identifies OpenStack image/snapshot to provision by its name.\n    The image can be updated/replaced in openstack and the plugin will\n    not require update provided its name have not changed.\n-   In case maximal instance number is specified on template level, the\n    stricter of the two (global and template value) will be applied.\n    Global value exists to ensure that the number of machines\n    provisioned by plugin will not exceed certain limit. The template\n    value can further restrict that at most N machines of given kind can\n    be utilized at the same time.\n-   Plugin can report maximal number of instances was reached while\n    there is not adequate number of Jenkins nodes. It is because plugin\n    inspects running OpenStack machines in order to cover machines being\n    provisioned/deleted (that do not have Jenkins nodes) and instances\n    that plugin failed to delete. In case the instance get leaked,\n    please report that as a bug with all relevant FINE level logs\n    attached.\n-   On every agent provisioned by the plugin, there is an environment\n    variable `OPENSTACK_PUBLIC_IP` declared with the public IP address\n    allocated for the machine.\n\n### Troubleshooting\n\n#### Accessing logs\n\nPlugin uses `INFO` and above levels to report things user should worry\nabout. For debugging, set it to `FINEST` - note the `ALL` level is not\nsufficient to print these. To configure OpenStack plugin logging in\nJenkins UI go to *Manage Jenkins \\\u003e System Log \\\u003e New Log Recorder* and\nuse `jenkins.plugins.openstack.compute` as the logger name.\n\n#### Access openstack client from [groovy console](https://www.jenkins.io/doc/book/managing/script-console/)\n\nUse `Jenkins.instance.clouds[0].openstack.@clientProvider.get()` to\naccess the openstack4j client. Users are discouraged to use this\nanything else but querying the openstack (otherwise there is no way to\nensure plugin will work correctly). For older versions fo the plugin use\n`Jenkins.instance.clouds[0].openstack.@client`.\n\n#### User Data / Cloud init is not evaluated\n\nThe image might not support it at all or can fail executing it. Check\nmachine log in OpenStack for further details. Note that for now, there\nis no guarantee the script will complete before machine is connected to\nJenkins and builds are started.\n\n### Changelog\n\n[Releases Page](https://github.com/jenkinsci/openstack-cloud-plugin/releases)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fopenstack-cloud-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fopenstack-cloud-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fopenstack-cloud-plugin/lists"}