Hyper.Vm.Id (Hyper v0.1.0)

Copy Markdown View Source

A microVM id and its generator.

An id is a v prefix followed by lowercase base32 of 10 random bytes, charset [a-z2-7] - alphanumeric only, no -, _, or other punctuation. That charset is the intersection of three independent constraints the id must satisfy at once:

  • firecracker rejects _ in an instance id (InvalidInstanceId);
  • dm/jailer names must not start with -;
  • registry keys and chroot path components stay trivially safe.

Summary

Functions

Generate a fresh, random VM id (see the module doc for the charset contract).

Types

t()

@type t() :: String.t()

Functions

generate()

@spec generate() :: t()

Generate a fresh, random VM id (see the module doc for the charset contract).

The previous base64url encoding emitted - and _, so it could produce ids firecracker refused at boot (Invalid char (_)).