Commit Graph

9 Commits (9549fd984bb396e56473912d994f61beaff39555)

Author SHA1 Message Date
Dustin 9549fd984b VirtualMachine: to_xml(): Add pretty_print keyword
If the `lxml` package is available, its ElementTree implementation is
used instead of the one in the Python standard library. This
implementation provides a "pretty print" option when serializing XML
documents.

Note that since `Element.attrib` is not a "real" dictionary object, it
does not accept keyword arguments to its `update` method, so a
dictionary must be passed in instead. This is used in a few places to
set element attributes in bulk.
2015-08-06 15:49:50 -05:00
Dustin 167cc3b198 vmdesc: Add minimal support for CPU model selection
The `cpu` property of `VirtualMachine` objects indicates the value of
the `mode` attribute of the `cpu` element in the domain XML
configuration. The possible values are

* host-model (default)
* host-passthrough
* custom
2015-07-22 23:09:42 -05:00
Dustin faeccd5588 vmdesc: Allow specifying mkfs arguments
In some cases, the default options selected by the `mkfs.*` utilities
are insufficient. To allow overriding them, volumes and partitions in
the VM description now support an optional `mkfsargs` item, which will
be passed along when creating new filesystems.
2015-07-12 13:07:27 -05:00
Dustin b87d637951 Add README 2015-07-11 22:25:40 -05:00
Dustin 4b40194c86 configure: Add function to enable the SSH daemon
The `configure.enable_sshd` function enables the SSH daemon in the
target system. It generates host keys and sets the daemon to start at
boot. This function is called by `configure.configure` if the VM
definition contains at least one network interface.
2015-07-11 19:51:55 -05:00
Dustin aa97d4cd43 configure: Add function to enable serial console
The `enable_console_login` function modifies `/etc/inittab` to enable
logins on a serial device. For virtio serial devices, a getty is
configured to launch on `hvc0`; for other devices, it is configured for
`ttyS0` (the default).

When using the `configure.configure` function to automatically configure
a virtual machine, `enable_console_login` is called if a console device
is specified in the VM definition.
2015-07-11 19:46:55 -05:00
Dustin ef6b3ba8e8 VirtualMachine: Refresh LVM cache before creating PV
When *lvmetad* is in use, it will cache volume group metadata from
previous runs of `mkvm` that used the same block device and prevent new
physical volumes from being created on it. Running `pvscan` alone does
not refresh the cache unless it is told to do so with the `--cache`
argument.
2015-07-11 17:55:44 -05:00
Dustin e28238dc33 stage3: Fetcher.fetch_stage: Pass stderr fd to wget
The main entry point of the `mkvm` program closes FD 3 (native stderr)
to prevent extraneous messages from libvirt. Unfortunately, this breaks
wget's progress indicator, as it is printed to stderr as well. To ensure
that the progress indicator works, we have to pass the FD of the copy of
stderr to wget.
2015-07-11 17:40:54 -05:00
Dustin 6dbc137b3a Initial commit 2015-07-11 17:10:39 -05:00