Service for restarting Yandex Cloud compute instances.
Very basic python script checks if virtual machines from input list are working, and if not - starts them. Running as cron job, packed in Docker container.
List of possible statuses
- RUNNING
- STOPPING
- STOPPED
- STARTING
Script tries to start VM instance only if it is in STOPPED status. All other statuses are ignored.
- YCR_CRON - crontab
- YCR_HOSTS - list of instances separated by space
docker-compose build --build-arg YCR_CRON="* * * * *" --build-arg YCR_HOSTS="instance1 instance2"
docker-compose up -d
docker-compose exec yc-restarter /root/yandex-cloud/bin/yc init
Oficial guide: