io7m | single-page | multi-page
3.18. vm-export
Previous
3. Command-Line Interface
Up
3.20. vm-kill
Next
3.19

# vm-import

- 3.19. vm-import
  - 3.19.1. Name
  - 3.19.2. Description
  - 3.19.3. Example

3.19.1

## Name

1
vm-import - Import defined virtual machines
3.19.2

## Description

1
The vm-import command imports configuration data for a virtual machine. This command is the inverse of the vm-export command.
2

### 3.19.2.2 Parameters

Parameter | Type | Required | Description
--- | --- | --- | ---
--configuration | Path | false | The path to the configuration file (environment variable: $WAXMILL_CONFIGURATION_FILE)
--verbose | Log Level | false | Set the minimum logging verbosity level.
--file | Path | true | A file containing one or more virtual machine configurations.

3.19.3

## Example

1

### 3.19.3.1 Example

    $ cat vm.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <wxm:VirtualMachines xmlns:wxm="urn:com.io7m.waxmill.vm:1:0">
        <wxm:VirtualMachine id="538a90e4-d50d-4511-8643-ae418279bac4" name="com.io7m.example">
            <wxm:CPUTopology sockets="1" threads="1" cores="1"/>
            <wxm:Memory gigabytes="0" megabytes="250"/>
            <wxm:Devices>
                <wxm:HostBridge vendor="UNSPECIFIED">
                    <wxm:DeviceSlot bus="0" slot="0" function="0"/>
                </wxm:HostBridge>
                <wxm:AHCIDiskDevice>
                    <wxm:DeviceSlot bus="0" slot="1" function="0"/>
                    <wxm:StorageBackendZFSVolume/>
                </wxm:AHCIDiskDevice>
                <wxm:AHCIOpticalDiskDevice>
                    <wxm:DeviceSlot bus="0" slot="2" function="0"/>
                </wxm:AHCIOpticalDiskDevice>
                <wxm:VirtioNetworkDevice>
                    <wxm:DeviceSlot bus="0" slot="4" function="0"/>
                    <wxm:TAPDevice name="tap23" address="a3:26:9c:74:79:34"/>
                </wxm:VirtioNetworkDevice>
            </wxm:Devices>
            <wxm:BootConfigurations>
                <wxm:BootConfigurationGRUBBhyve name="run">
                    <wxm:GRUBBhyveKernelOpenBSD>
                        <wxm:BSDBootDevice kernelPath="/bsd">
                            <wxm:DeviceSlot bus="0" slot="2" function="0"/>
                        </wxm:BSDBootDevice>
                    </wxm:GRUBBhyveKernelOpenBSD>
                </wxm:BootConfigurationGRUBBhyve>
            </wxm:BootConfigurations>
            <wxm:Flags>
                <wxm:Flag name="DisableMPTableGeneration" enabled="false"/>
                <wxm:Flag name="ForceVirtualIOPCIToUseMSI" enabled="false"/>
                <wxm:Flag name="GenerateACPITables" enabled="true"/>
                <wxm:Flag name="GuestAPICIsX2APIC" enabled="false"/>
                <wxm:Flag name="IncludeGuestMemoryInCoreFiles" enabled="false"/>
                <wxm:Flag name="RealTimeClockIsUTC" enabled="false"/>
                <wxm:Flag name="WireGuestMemory" enabled="false"/>
                <wxm:Flag name="ExitCPUOnPAUSE" enabled="true"/>
                <wxm:Flag name="YieldCPUOnHLT" enabled="true"/>
            </wxm:Flags>
        </wxm:VirtualMachine>
    </wxm:VirtualMachines>

    $ waxmill vm-import --file vm.xml
    INFO com.io7m.waxmill.cmdline.internal.WXMCommandVMImport: Imported 1 virtual machines

    $ waxmill vm-import --file vm.xml
    ERROR com.io7m.waxmill.cmdline.Main: com.io7m.waxmill.exceptions.WXMExceptionDuplicate: A virtual machine already exists with the given ID.
      ID:                  538a90e4-d50d-4511-8643-ae418279bac4
      Machine (A) Name:    com.io7m.example
      Machine (A) Source:  file:///tmp/vm.xml
      Machine (B) Name:    com.io7m.example
      Machine (B) Source:  file:///etc/waxmill/vm/538a90e4-d50d-4511-8643-ae418279bac4.wvmx

3.18. vm-export
Previous
3. Command-Line Interface
Up
3.20. vm-kill
Next
io7m | single-page | multi-page