A simple, powerful CLI tool to spin up OpenIndiana virtual machines with QEMU
1import { getInstanceState, removeInstanceState } from "../state.ts";
2
3export default async function (name: string) {
4 const vm = await getInstanceState(name);
5 if (!vm) {
6 console.error(
7 `Virtual machine with name or ID ${name} not found.`,
8 );
9 Deno.exit(1);
10 }
11
12 console.log(`Removing virtual machine ${vm.name} (ID: ${vm.id})...`);
13 await removeInstanceState(name);
14}