{"id":20357910,"url":"https://github.com/gandi/cinder-snapshooter","last_synced_at":"2026-01-07T19:04:18.437Z","repository":{"id":264627119,"uuid":"630875458","full_name":"Gandi/cinder-snapshooter","owner":"Gandi","description":"Collection of scripts to allow automatic snapshot creation on Openstack Cinder Volumes","archived":false,"fork":false,"pushed_at":"2023-05-03T13:09:43.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-29T07:26:27.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/Gandi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-04-21T11:01:31.000Z","updated_at":"2023-04-24T13:54:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1cb86f1-e128-4592-a366-4fd7c590e89a","html_url":"https://github.com/Gandi/cinder-snapshooter","commit_stats":null,"previous_names":["gandi/cinder-snapshooter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Gandi/cinder-snapshooter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fcinder-snapshooter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fcinder-snapshooter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fcinder-snapshooter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fcinder-snapshooter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gandi","download_url":"https://codeload.github.com/Gandi/cinder-snapshooter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fcinder-snapshooter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28236970,"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","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-14T23:24:27.425Z","updated_at":"2026-01-07T19:04:18.410Z","avatar_url":"https://github.com/Gandi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/Gandi/cinder-snapshooter/actions/workflows/CI.yml/badge.svg?event=push)](https://github.com/Gandi/cinder-snapshooter/actions/workflows/CI.yml)\n# Cinder-snapshooter\nThis is a collection of scripts to allow automatic snapshot creation on Openstack Cinder Volumes\n\n## Snapshots policy\nIf you run the creator script at least every day, it shall create a snapshot per day for every volume with automatic\nsnapshots enabled.\n\nThese snapshots will expire after 7 days, except for the first snapshot of the month that will expire after 3 months.\n\nThis let you with a maximum of 11 automatic snapshots for any given volume (4 \"monthly\" and 7 \"daily\"). Let see it with\nan example:\n\nI activate automatic snapshots on a volume on 15 January. On 8 April I will have the following snapshots:\n - 15 January, expire on 15 April\n - 1st February, expire on 1st May\n - 1st March, expire on 1st June\n - 1st April, expire on 1st July\n - 2 April, expire on 9 April\n - 3 April, expire on 10 April\n - 4 April, expire on 11 April\n - 5 April, expire on 12 April\n - 6 April, expire on 13 April\n - 7 April, expire on 14 April\n - 8 April, expire on 15 April\n\n## Usage\nThis project comes with one command `cinder-snapshooter` with the following subcommands:\n \n * `creator`: Creates automatic snapshots on volumes needing one\n * `destroyer`: Destroys expired snapshots\n \nBoth commands have a `dry-run` flag to control the behavior, refer\nto the commands `--help` for more details.\n\nTo enroll a volume to automatic snapshot creation it must have the `automatic_snapshots` property set to `true`,\nyou can do so using the following openstack command:\n```commandline\nopenstack volume set --property automatic_snapshots=true \"\u003cvolume_id\u003e\"\n```\n\nIf the user doing the snapshot creation has no rights on your project you can issue a trust to give them the right\nto create the snapshots (please be mindful it may give this user a lot more permissions on your project, be sure you\ntrust that user):\n```sh\nopenstack trust create --role member --project \"\u003cproject_id\u003e\" \"\u003cyour_user_id\u003e\" \"\u003ctrusted_user_id\u003e\"\n```\n\n### Use the docker image\nThis project comes with a `Dockerfile` to generate a docker image. \n\nYou can use it this way (here with snapshot creator):\n```sh\ndocker run --mount type=bind,src=$HOME/.config/openstack,dst=/root/.config/openstack -e OS_CLOUD=gandi ghcr.io/Gandi/cinder-snapshooter:latest creator\n```\n\n### Run automatically using systemd timers\nYou can use a set of two systemd timers+service to handle the creation and deletion of snapshots, here is an example\nof such units for `cinder-snapshooter creator`.\n\n```unit file (systemd)\n;cinder-snapshooter-creator.timer\n[Unit]\nDescription=Run cinder-snapshooter creator daily\n\n[Timer]\nOnCalendar=daily\nPersistent=true\n\n[Install]\nWantedBy=timers.target\n```\n\n```unit file (systemd)\n;cinder-snapshooter-creator.service\n[Unit]\nDescription=Creates automated snapshots\n\n[Service]\nType=oneshot\n; Here are my environment variable for configuration\nEnvironmentFile=/etc/default/cinder-snapshooter\nExecStart=/path/to/venv/bin/cinder-snapshooter creator\n; I put my clouds.yml file in this directory\nWorkingDirectory=/var/lib/cinder-snapshooter\nUser=cinder-snapshooter\n```\n\n### Environment variables for configuration\n\nSome configuration options are available using environment variables for ease of use:\n\n * OS_CLOUD: Name of the cloud to use in your clouds.yml file\n \n\n## Run tests\n\n```commandline\npoetry run pytest\n```\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate and to write meaningful commit messages.\n\n## Licence\n[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)\n\nCopyright 2021 Gandi SAS\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgandi%2Fcinder-snapshooter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgandi%2Fcinder-snapshooter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgandi%2Fcinder-snapshooter/lists"}