waft.cli.vm module¶
- waft.cli.vm.create(image: ~typing.Annotated[str, <typer.models.ArgumentInfo object at 0x7f78592d4fd0>], system_name: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f7858fde950>] = None, cloud_provider: ~waft.enums.Annotated[~waft.enums.CloudProvider, <typer.models.OptionInfo object at 0x7f78592d51d0>] = CloudProvider.AZURE, username: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f7858fbef10>] = 'waft-admin', resource_group: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f78592f6950>] = 'waft-vms', force: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f785905b390>] = False, config: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f785a2b2010>] = None)¶
Create a new VM system.
Only a VM image name is required. All other options have sensible defaults for typical usage but can be overridden.
System Name Auto-Generation: - If –system/-@ is not provided, the image name will be used as the system name - If a system with that name already exists in the config, an error will be raised - Use –system/-@ to specify a custom name when creating multiple VMs of the same image - Use –force to overwrite an existing system with the same name
Examples:
` $ waft vm create ubuntu_22_04_multiarch_intel # Auto-names system as image name $ waft vm create ubuntu_22_04_multiarch_intel -@ my-test-vm # Creates system named my-test-vm $ waft vm create windows_11_intel --system my-windows-vm # Creates system named my-windows-vm `
- waft.cli.vm.delete(systems: ~typing.Annotated[list[str], <typer.models.OptionInfo object at 0x7f78599f7e90>] = SystemsDefault.ALL, config: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f785a2b2010>] = None, prompt: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f78597afb90>] = True)¶
Delete one or more VM systems and configurations.
If no systems are specified, will prompt to delete all VM configurations. You can specify individual systems or groups. When a group is specified, all VM systems in that group will be deleted.
Examples:
` $ waft vm delete -@ system1 $ waft vm delete -@ system1 -@ system2 $ waft vm delete -@ groupA # Deletes all VM systems in groupA $ waft vm delete # Prompts to delete all VM configurations `
- waft.cli.vm.destroy(systems: ~typing.Annotated[list[str], <typer.models.OptionInfo object at 0x7f78599f7e90>] = SystemsDefault.ALL, config: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f785a2b2010>] = None, prompt: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f78597afb90>] = True)¶
Destroy one or more deployed VMs.
If no systems are specified, will prompt to destroy all deployed VMs. You can specify individual systems or groups. When a group is specified, all deployed VMs in that group will be destroyed.
Examples:
` $ waft vm destroy -@ system1 $ waft vm destroy -@ system1 -@ system2 $ waft vm destroy -@ groupA # Destroys all deployed VMs in groupA $ waft vm destroy # Prompts to destroy all deployed VMs `
- waft.cli.vm.ephemeral_vms(images: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7f78592d50d0>], config_path: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f785a2b2010>], cloud_provider: ~waft.enums.Annotated[~waft.enums.CloudProvider, <typer.models.OptionInfo object at 0x7f78592d51d0>], prompt: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f78597afb90>])¶
ContextManager that will manage vms of the given images. VMs will be created, yielded, and then destroyed.
- Parameters:
images – List of VM images to create
config_path – Path to config file
cloud_provider – Cloud provider to use
prompt – Whether to prompt the user for confirmations
- waft.cli.vm.export(system: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f78596c9510>], config: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f785a2b2010>] = None, locked: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f7858ea9110>] = False)¶
Export VM configuration.
- waft.cli.vm.images()¶
List available VM images.
- waft.cli.vm.import_vm(zip_file: ~pathlib.Annotated[~pathlib.Path, <typer.models.ArgumentInfo object at 0x7f7858ea9250>], system: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f7858fbe5d0>], force: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f7858ea9ed0>] = False, config: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f785a2b2010>] = None)¶
Import VM configuration.
- waft.cli.vm.inspect(system: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f78596c9510>], config: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f785a2b2010>] = None)¶
Inspect VM configuration.
- waft.cli.vm.redeploy(systems: ~typing.Annotated[list[str], <typer.models.OptionInfo object at 0x7f78599f7e90>] = SystemsDefault.NONE, config: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f785a2b2010>] = None)¶
Redeploy VMs for multiple systems.