Skip to content

crocuda/virshle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

323 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

virshle_logo

Virshle - A cli for multiple relentless virtual machines.

[!DANGER] Alpha releases.

Although Virshle is stable enough to be the engine propelling Crocuda_vps, You shouldn't use it in production as you may encounter unnoticed breaking changes.

Virshle is a single cli to manage multiple virtual machines.

It works on top of:

Installation

NixOs (with flakes)

Enable the module by adding the repository url to your flake input.

# flake.nix
inputs = {
  virshle = {
      url = "github:pipelight/virshle";
  };
};

Add the module to your host configuration.

nixosConfiguration = {
    default = pkgs.lib.nixosSystem {
        modules = [
            inputs.virshle.nixosModules.default
        ];
    };
}

Enable the service.

# default.nix
services.virshle = {
    enable = true;
    logLevel = "info"; # error | warn | info | debug | trace
    user = "anon"; # The user to run the node as (default to root).
};

Usage

In the vein of NixOs, you get a declarative/reproducible approach of VM creation.

A single template can spin up multiple identical VMs.

Define custom VM templates...

# /etc/virshle/config.toml

#########################
## Templates:
# Vm standard sizes with decents presets.
[[template.vm]]
name = "xxs"
vcpu = 1
vram = "1GiB"
[[template.vm.disk]]
name = "os"
path = "/var/lib/virshle/cache/nixos.xxs.efi.img"
[[template.vm.net]]
name = "main"
[template.vm.net.type.tap]

...add some user defined data...

# ./user-data.toml

#########################
# Conventional user-data added to the VM.
[[user]]
name = "anon"
[user.ssh]
# Key is appended at /etc/ssh/authorized_keys.d/<user.name>
authorized_keys = ["ssh-ed25519 AAAAC3N..."]

...and twist multiple copy of a VM.

v vm create --template xxs --user-data ~./user-data.toml

Check out the docs directory or on the documentation website at virshle.crocuda.com.

Developers

Fancy tests.

Set the CARGO_TEST_TRACING_LEVEL environment variable to run tests and print pretty logs when needed.

CARGO_TEST_TRACING_LEVEL='error' cargo test

About

A cli for multiple relentless virtual machines.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages