Skip to content

Driver: VMX

Sergei Parshev edited this page Apr 16, 2023 · 10 revisions

VMX driver

The driver was created to run virtual machines using VMware Fusion/Workstation solution. The killer feature of it - that it allows the unified way to create VM image and run it on any kind of OS you have and maintain the unified images library across all your local resources (lin/win/mac).

How it works?

How VMX driver works?

VMX driver uses Fusion/Workstation to start-up the VM's right on the Fish node machine. So make sure VMware Fusion/Workstation is installed properly.

Usage

To use the driver you need:

  • Install VMware Fusion or Workstation
  • Make sure it have the license configured and can run VM
  • Create the image - Aquarium Bait will be the simplest way
  • Run the Aquarium Fish node, create Label and send Application to receive the resource you want

Configuration

Describes the driver options in the drivers section in the aquarium-fish config file:

drivers:
  - name: vmx
    cfg:
      vmrun_path:        string  # Absolute path to the `vmrun` executable binary, located automatically if it's in PATH
      vdiskmanager_path: string  # Absolute path to the `vmware-vdiskmanager` exec binary, located automatically from vmrun_path

      images_path:    string  # Abs/rel path to the directory where images will be downloaded and located, by default `$CWD/fish_vmx_images`
      workspace_path: string  # Abs/rel path to the directory where the VM's and disks will be placed, by default `$CWD/fish_vmx_workspace`

      # Alter allows you to control how much resources will be used:
      # * Negative (<0) value will alter the total resource count before provisioning so you will be
      #   able to save some resources for the host system (recommended -2 for CPU and -10 for RAM
      #   for disk caching)
      # * Positive (>0) value could also be available (but check it in your vmware dist in advance)
      #   Please be careful here - noone wants the VM to fail allocation because of that...
      cpu_alter: int  # 0 do nothing, <0 reduces number available CPUs, >0 increases it (dangerous)
      ram_alter: int  # 0 do nothing, <0 reduces amount of available RAM (GB), >0 increases it (dangerous)

      # Overbook options allows tenants to reuse the resources
      # It will be used only when overbook is allowed by the tenants. It works by just adding those
      # amounts to the existing total before checking availability. For example if you have 16CPU
      # and want to run 2 tenants with requirement of 14 CPUs each - you can put 12 in CpuOverbook -
      # to have virtually 28 CPUs. 3rd will not be running because 2 tenants will eat all 28 virtual
      # CPUs. Same applies to the RamOverbook.
      cpu_overbook: uint  # How much CPUs could be reused by multiple tenants
      ram_overbook: uint  # How much RAM (GB) could be reused by multiple tenants

      download_user:     string  # User used to download the images (from artifact storage), uses HTTP Basic Auth
      download_password: string  # Password for the user

      log_monitor: bool  # Enables monitoring of the vmware.log of VM and reset it on halt (needed if VM's are not behaving good on boot)

Label definition

Describes the available options of the driver label definition:

definition:
  driver: vmx

  options:
    image:  string  # Name of the main image in the `images` list to run
    images: map     # Contains the locations of images to use
      <name>: <url>
      ...

  resources:
    node_filter: list  # List of the Fish Node identifiers, which allow to select the appropriate node for execution. Could use wildcards from path.Match
      - string
      - ...

    cpu:   uint  # Amount of CPUs (threads) required for the environment
    ram:   uint  # Amount of memory (in GB) required for the environment
    disks: map   # The disks to create/use in the VM
      <name>:          # The name of the disk file and label of the filesystem
        label: string  # Optional in case the label should be different from the disk name
        type:  string  # Filesystem type to format the new disk into, available: "hfs+", "exfat", "fat32"
        size:  uint    # The size of the disk (in GB)
        reuse: bool    # Will mark this disk to stay after the resource is destroyed, WARN: can't be used by multiple VMs for now

    # The modificators to simultaneous execution
    multitenancy: bool  # Tolerate to run along with the others
    cpu_overbook: bool  # Tolerate to CPU overbooking
    mem_overbook: bool  # Tolerate to RAM overbooking

    lifetime: duration  # Lifetime of the Resource in "1h2m3s" format. If "" or "0" - then default will be used, if negative - no timeout.

Examples:

Clone this wiki locally