The code in _add_implied_controllers() tries to add an ibmvscsi
controller if any disk with spapr-vio address type is found;
however, regardless of the specific SCSI controller in use, all
SCSI disks will use the drive address type, so that condition
will never be triggered - which is actually for the best, since
we want to use virtio-scsi on ppc64 anyway.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Our support.py check is not exhaustive based on libvirt code checking.
Don't reject this case so users have a chance to make it work. The
support check is really more valuable in the UI where we can screw
things up easier.
The test cases verify that:
+ --start works
+ --define --start works
+ --no-define --start works
+ --start works in combination with --add and --remove
+ combination of --start --update isn't valid
+ combination of --define --no-define --start isn't valid
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Add support for starting the domain. By default, first the domain is
defined and then started. If the `--start` is used in combination with
`--no-define` a transient domain is created without persisting the
changes in the persistent domain definition.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Add a test case validating mutual exclusivity of `--no-define` and
'--define' arguments.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Add `--no-define` argument. It's mutually exclusive to the `--define`
argument and later on it allows the user to start a domain
transiently.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Use the newly introduced method `reorder_boot_order` for setting
the boot index of a device. This ensures that all other boot order
values of domain guest definition are adjusted accordingly.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Add a test case for `reorder_boot_order`. It verifies that the OS boot
order is removed and that all other boot order indices are adjusted
accordingly.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Add `reorder_boot_order` method to Guest class. It sets the boot order
of the passed `dev` to `boot_index` and adapts all other boot indices
of the guest accordingly.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Refactor method for generating out file path. It will be used in a
upcoming patch.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Add a check if device boot order is supported to
Parser(Network|Disk|Redirdev|...) and throw an exception if not.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Introduce set_prop helper function. It will be used in the next patch.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Refactor get_prop since it will be used in the next patches at other
places as well.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
The original code for this was about version 0.7.3, but a refactor
accidentally changed it to 0.7.9 which is a libvirt version that
doesn't exist. Fix it
Function do_we_default returns only if we want to default to clone disk
even if we know how to create default clone path. Only in case that the
storage pool is TYPE_DISK we don't know how to create default path and
we cannot default to clone that disk. In all other cases as ReadOnly
disk or Shareable and so on we can prepare the default path for user if
they decide to clone it.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1565106
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
The building process here is mostly independent of the InstallScript
object. Moving it to its own function makes that more clear, makes
InstallScript smaller, and the code is indented less
--unattedend now can be used to perform tree based installations.
The way it's implemented, it takes advantage of the code we currently
have for setting --os-variant install="location|cdrom".
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
As --unattended will take care of generating the install script to be
inject in the initrd and also of the kernel command line to be used
during the installation, we should not mix whatever user is passing as
--initrd-inject or --extra-args when using --unattended.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
In case the InstallerTreeMedia has any unattended_data set, let's just
generate the install script and have everything set up for performing a
unattended installation.
path is appended to the tmpfiles as it's the generated unattended script
and it has to be cleaned up when no longer needed.
cmdline is preppended to the args gotten from _prepare_kernel_url() in
order to be used during the first OS boot (and only there!).
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
unattended_data will be used when we add support for unattended
installations. It'll be passed down to the helper that's responsible for
actually generating the script and the kernel command line to be used
with it during prepare(); nevertheless, the addition does nothing right
now.
Together with the addition of the unattended_data, a setter has been
added.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
generate_install_script() is a helper that will do all the needed
plumbing related to create, populating and generating the install script
and its config.
The method returns the path to the generated install script and the
kernel command line to be used with it.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
generate_install_script_output() generates the install script,
accordingly to the config passed, in a specific directory.
generate_install_script_cmdline() generates the kernel command line that
has to be used in order to perform the unattended installation.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
As some of the install scripts may act differently depending on whether
the installation is going to be done via the OS media or via network
let's have a wrapper around set_installation_source(), from
Libosinfo.InstallScript, in order to be able to properly set which is
going to be the used installation source.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
As not all unattended installations will be done by the same method,
let's have a wrapper around set_preferred_injection_method(), from
Libosinfo.InstallSript, in order to be able to properly set which is
going to be the preferred injection method for a script.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's try to guess the language and keyboard layout from the system's
language.
In case we can't do the guess, let's just let it be and libosinfo will
use the 'en_US' default for both language and keyboard layout.
There's a big issue here, though, that quite often users will *not* have
their keyboard layout matching with the language of their systems and,
unfortunately, I don't see any easy way to detect that unless we totally
rely on GLib.Settings (which, according to my understanding, we can't).
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's try to guess the timezone from '/etc/localtime' and use it, if
possible. Otherwise, let's just let it be and libosinfo will use the
default 'America/New_York' one.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
get_install_script_config() method returns an OsinfoInstallScriptConfig
object that's tied to an OsinfoInstallScript object, already configured
based in the info provided by the user and it's ready to be used.
For now, the config will always set the timezome to 'America/New_York'
and the language and keyboard layout to 'en_US'.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
get_install_script() method returns an installer script of a specific
profile type for a specific OS.
In case no OS is defined, None is returned.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>