canonical/multipass

Bulk operations - Ability to perform actions on multiple nodes

Open

#2,404 建立於 2022年1月22日

在 GitHub 查看
 (11 留言) (0 反應) (0 負責人)C++ (634 fork)batch import
enhancementgood first issuehelp wanted

倉庫指標

Star
 (6,956 star)
PR 合併指標
 (平均合併 16天 2小時) (30 天內合併 50 個 PR)

描述

What are you trying to do? Currently all commands use instance name to perform operations. This makes operations on multiple instances difficult and requires individual commands/action on each instance. For example: if I have 3 VMs for apps, 2 vms for db, and I want to run a command on just db nodes, I would have to run two commands. Or If I have to reboot app servers, thats 3 commands.

What's your proposed solution? One option is to allow adding tags/lables to hosts. While launching we can add add these tags in commands line.

multipass launch --name app-server1 -m2g -c1 -d10g --tags group=app-server
multipass launch --name app-server2 -m2g -c1 -d10g --tags group=app-server
multipass launch --name app-server3 -m2g -c1 -d10g --tags group=app-server

Then for any operations we can specify the tag, instead of instance name.

multipass stop --tags group=app-server
multipass exec --tags group-app-server exec systemctl daemon-reload
multipass start --tags grou=app-server

Additionally, if we can expose these tags to the VM environment (file, metadata, etc.), we can make use of them in config management tool like Chef/Puppet/Script/Cloud-init, etc.

Additional context I made a small utility for multi-node microk8s cluster yogendra/mnmk8s (terrible name, i know), that does something similar, in absence of this feature.

貢獻者指南