IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
With another fake iso, based on stripped down centos 6.5 boot iso.
Reason we do centos 6.5 is that everything newer also compares
on volume size, and we don't want to store a huge iso in git.
virt-install -n blah -r 1024 --vcpu=1 --disk=/root/vm/blah.qcow2,size=10\
--network=bridge:br-public --pxe --boot=network,rebootTimeout=3
By default, in case of (first) pxe boot failure the VM will simply
stop trying.
By adding the above, VM will re-try pxe boot. ( useful when DHCP not
replys on first attempt.
Libvirt support it and VM XML will look as follow : ( 'bios rebootTimeout'
will be created under OS section. )
<os>
<type arch='x86_64' machine='pc-i440fx-rhel7.5.0'>hvm</type>
<boot dev='network'/>
<bios rebootTimeout='3'/>
</os>
(crobinso: fix it, add test case)
Allow to set some memory backing options, ex:
--memorybacking access_mode=shared,source_type=anonymous
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Rather than forcing API users to go through the capabilities APIs.
This lets us simplify things in virt-install quite a bit, and is
needed for smarter machine type defaults
This case will still work, but be a bit slower, which is fine. Nowadays
-M virt is much better for virt usage and nearly everyone is using that,
so save us the complication. This was really only useful when
bootstrapping arm virt support
The validation is already handled by libvirt, and setting q35 for
smm=on is overkill and just hardcoding some libvirt logic here.
I think the 'secboot' detection in Guest.py is the preferred
magic here, otherwise let users specify all the correct values.
An emulated backend doesn't require any path, since libvirt will take
care of finding the emulator and managing the storage. However, the
version to emulate can be specified.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Add codec support to virt-install so that it can accommodate
multiple instances of codec configuration.
The commandline argument:
--sound codec0.type=micro,codec1.type=duplex,codec2.type=output
maps to the sound XML below:
<sound model="es1370">
<codec type="micro"/>
<codec type="duplex"/>
<codec type="output"/>
</sound>
Signed-off-by: Anya Harter <aharter@redhat.com>
This type of validation should really be done at the libvirt level,
particularly for a non-mandatory feature like cpuset. Otherwise
it's just more code for us to test which will rarely be hit by users
The copyright headers in every file were chjanged in this previous commit
commit b6dcee8eb7
Author: Cole Robinson <crobinso@redhat.com>
Date: Tue Mar 20 15:00:02 2018 -0400
Use consistent and minimal license header for every file
Where before this they said "
"either version 2 of the License, or (at your option) any later version."
Now they just say
"GNU GPLv2"
This fixes it to say "GNU GPLv2 or later" again.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
non-treeinfo redhat only applies to pre RHEL5.4 and very old
Fedora. It's not worth it anymore to slow down all URL lookups
and maintain code complexity to handle such long out of date
distros.
GenericDistro doesn't actually apply to any public trees that I
can find, except for some with TreeInfo. So turn it into
GenericTreeinfoDistro. If random URL trees want to work with
virt-install, add a treeinfo file
A new Python checker was added to warn about using a + operator inside
call of logging methods when one of the operands is a literal string.
https://pylint.readthedocs.io/en/latest/whatsnew/1.8.html
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
If we try to run the testsuite on anything older than libvirt 3.1,
it immediately throws an exception before processing any tests,
due to choking on parsing drm bits from testdriver.xml. This global
failure is only due to sloppy coding though.
Turn all test cases that use testdriver.xml into skips in this case,
so we can at least get some test coverage otherwise.
Right now, most test cases will create a libvirt test driver using
tests/testdriver.xml. This is problematic for 2 reasons:
1) testdriver.xml is 3500 lines of XML, and it's parsed hundreds of
times. Opening it is responsible for about 25% of test suite time
2) Older libvirt chokes on testdriver.xml, meaning the test suite will
be useless there. This is a recurring problem as new features are
added to testdriver.xml
Most test cases don't actually need all the test state in testdriver.xml
though. So this creates a smaller testsuite.xml which has a lower
libvirt requirement and is much quicker to parse. New XML bits should
continue to go into testdriver.xml so we can keep testsuite.xml as
the more stripped down option.
Add vcpupin support to virt-install so that it can create guest
domains with statically allocated vcpu pinning towards a given cpuset.
Syntax: to pin vcpu=0 to cpuset="1,3" and vcpu=1 to cpuset=2
--cputune vcpupin0.vcpu=0,vcpupin0.cpuset=1,3,vcpupin1.vcpu=1,vcpupin1.cpuset=2
generates below XML description for the guest domain.
<cputune>
<vcpupin vcpu="0" cpuset="1,3"/>
<vcpupin vcpu="1" cpuset="2"/>
</cputune>
Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
Now that libvirt has support for administration of distances between NUMA cells
it would be nice to be able to set those with virt-install directly instead of
having to 'virsh edit' the domain XML manually after installation.
For example
--cpu cell0.memory=1234,cell0.cpus=0-3,cell1.memory=5678,cell1.cpus=4-7,\
cell0.distances.sibling0.id=0,cell0.distances.sibling0.value=10,\
cell0.distances.sibling1.id=1,cell0.distances.sibling1.value=21,\
cell1.distances.sibling0.id=0,cell1.distances.sibling0.value=21,\
cell1.distances.sibling1.id=1,cell1.distances.sibling1.value=10
would generate the following XML:
<cpu>
<numa>
<cell cpus="0-3" memory="1234">
<distances>
<sibling id="0" value="10"/>
<sibling id="1" value="21"/>
</distances>
</cell>
<cell cpus="4-7" memory="5678">
<distances>
<sibling id="0" value="21"/>
<sibling id="1" value="10"/>
</distances>
</cell>
</numa>
</cpu>
Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
(crobinso: rework cli format, drop some validation, drop man changes)
libvirt supports guest CPU cache by commit df13c0b, So add this feature
to virt-install to configure cpu L3 cache mode.
Currently, The valid values are 'passthrough', 'emulate' or 'disable'.
say:
--cpu host-passthrough,cache.mode=passthrough
or
--cpu $CPU,cache.mode=emulate,cache.level=3
or
--cpu $CPU,cache.mode=disable
Signed-off-by: Lin Ma <lma@suse.com>
Using "listens.*" allows better configuration of listen elements for
graphics devices. Currently the only way how to configure a listen
type is to abuse "listen" parameter and there is no way how to configure
exact "network".
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
There are multiple models of the panic device, the address type is only
one and is valid only for "isa" model.
To not break the virt-install/virt-xml the command line parser needs to
be updated. Before this patch there was only one parameter that
configured the "iobase". Now the first parameter configures a model
but to keep it backward compatible it follows these rules:
1. there is only one parameter and it matches known model:
--panic isa
<panic model='isa'>
<address iobase='0x505' type='isa'/>
</panic>
2. there is only one parameter and it doesn't match any model:
--panic 0x505
<panic model='isa'>
<address iobase='0x505' type='isa'/>
</panic>
3. there are two parameters:
--panic isa,iobase=0x505
<panic model='isa'>
<address iobase='0x505' type='isa'/>
</panic>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
If we detect that the UEFI image is build to require SMM feature we
should configure the guest to enable SMM feature and set q35 machine
type. Without this user wouldn't be able to boot the guest.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1387479
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This element controls hot(un)plugable memory for the guest in
addition to the initial memory configured by <memory> element.
One has to configure <maxMemory> and guest numa nodes using <numa>
element to enable hot(un)plug of memory modules.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Add support to interface type 'vhostuser' by:
--network vhostuser,source_type=unix,source_path=/tmp/vhost1.sock,source_mode=server,model=virtio
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
When virt-clone is used without autoclone or destination file, libvirt
errors with message "ERROR missing source information for device vda".
This doesn't convey what is missing. This patch will indicate which
options to use.
Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
If this flag is specified, --import|--boot will create a transient
libvirt domain, ie. one which goes away when the guest shuts down or
the host is rebooted.
(crobinso: some tweaks and tests)
continue_install is intended to facilitate windows XP style 3 stage
installs:
stage 1: initial dos style disk setup, reboot
stage 2: actual full installer, reboot
stage 3: OS is functional, virt-install is done
The code assumed that we needed to keep the cdrom as the primary
boot device for the second stage, so virt-install/virt-manager needed
to hang around through the second stage run, wait until the VM shutdown,
then encode the final XML to boot of the disk.
Windows is and always has been smart enough to handle that case though...
after the initial boot, if we set the hd as the primary boot device
for stage 2, the disk bits that windows already installed will make
use of the cdrom as necessary. So the entire premise of continue_install
is irrelevant. Maybe back when it was added, when xen didn't even have
working ACPI support, this served a purpose, but I'm pretty sure we
can safely drop it nowadays.
Current libosinfo release on fedora23 and centos7
didn't know fedora23.
Change --os-variant fedora22 as a workaroud.
df1c3e74a introduce this issue.
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
There want be 1.3.6 version, libvirt switched to new release numbering, for more
information see <http://libvirt.org/downloads.html#numbering>.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This adds support for setting VirtualDisk <seclabel> XML. This
invents a new command line scheme for cases like this where there
are possibly multiple child elements that we want to specify
on the command line. So if you just want to specify one <seclabel>
block, you can do the expected
--disk ...,seclabel.model=dac,relabel=no
However if you want to specify 2 <seclabel> blocks you need to do:
--disk ...,seclabel0.model=dac,seclabel0.relabel=no,seclabel1.model=selinux,seclabel1.relabel=no
We register the VirtCLIArgument classes with the static parse
instructions, but instantiate it with the actual key=val pair
from the command line. This fixes some layering violations, and
gives callers access to the actual command line key that we
are parsing, if that's interesting.
This is the new style socket support, where we request libvirt to
allocate a socket path for us. Plus this is the only way to enable
socket support for type=spice
This exposes every device <address> option, for each device
cli option. So --disk, --network, --video, etc.
Fill out a few more address XML bits as well
So you can do "python setup.py --only many-devices' to only run the
clitest compare tests that output their results to files with
"many-devices" in the name
Commit f6322c9e changed the default bus type for disks to virtio.
That changed it for both disks and cdroms. The CD-ROMs dont work
if on virtio on pSeries. So, change the cdrom bus type to scsi as
before.
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Extend virt-install-ppc64-pseries-f20 test to cover this case.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Add a special listen value to disable any extra display server listening
socket. This is necessary now that qemu prevents starting a spice+virgl
VM with listening sockets (until spice allows remoting with virgl).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Use virtio+accel3d by default whenever spice+gl is chosen. This allows
to easily set up accelerated gpu VM.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Add a --graphics option to enable accelarated rendering using
OpenGl. This is used only by Spice (and for local only guests atm).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Libvirt started to put type='raw' by default for rbd volumes, which
changes our generated XML. Limit the test to only libvirt that supports
that check.
For many years virt-install has supported a bit of logic that maps
--cpuset=auto to a CPU pinning based on host NUMA topology; we look
for a NUMA node who's current free memory is closest to the requested
memory allocation. This isn't very useful though, since it's a one time
allocation, the conditions at VM creation time likely aren't the
conditions of the machine in the future.
Libvirt has supported a smarter option in vcpu placement=auto for a long
while, which will perform a similar operation but at every VM startup.
Convert cpuset=auto to use this functionality instead.
Since the qemu 2.4 has supported the watchdog device diag288
for s390x,so add it in the optional model list. Also modefied
the clitest xml to cover this change.
Add a capatilities xml file for s390x ,the capatility for IBM
Distro called KVMIBM,mainly focus on a KVM hypervious on S390x.
Also add a clitest by using virt-install.
Added cli option to specify on_lockfailure in events.
Also, added various testcases and related output XMLs.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(crobinso: add clitest.py example)
Following some discussion here:
https://bugzilla.redhat.com/show_bug.cgi?id=1171550
jfehlig suggested better defaults for modern xen. End result is:
- Drop the blktap check, since it's deprecated (yaay)
- If xen + block device, use driver_name=phy
- Otherwise if on modern enough libvirt + libxl, do the same thing we
do for qemu.
libvirt qemu default's to accessmode=passthrough, which really only
works correctly when qemu is run as root, which isn't common for libvirt
nowadays. So use accessmode=mapped which has a better chance of working
We are conservative here, only cleaning up disk images if libvirt
fails to even accept the XML. Otherwise the VM may already be
running or defined, and the user has to do some cleanup anyways.
So we can call clear() on a Guest owned VirtualDisk, and it actually
does the correct thing. This allows us to enable clearxml= cli option
for most devices.
Previous commit added support for virtual port profiles
on NICs, but only defined the attributes needed by the
802.1Qbg NIC type.
commit 34e2ca8389
Author: Cole Robinson <crobinso@redhat.com>
Date: Fri Jan 31 16:51:02 2014 -0500
cli: --network: Wire up virtualport options
This commit adds the profileid and interfaceid parameters
needed by 801.Qbh, openvswitch and midonet
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix a regression where we used to report an error message if user
specified pxe installation without any network (--nonetworks or
--network none).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1250382
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
For architecture "s390x",the disk and the network device are base
on "virtio" bus.The cdrom is based on "scsi".So set the default
cdrom bus as "scsi",the default bus as "virtio".Also the default
machine type is set to "s390-ccw-virtio" as it is the only supported
in "s390x".Also add a test cast of virt-install by cdrom in s390x.
(crobinso: Tweak test suite and minor formatting stuff)
Make it clear which ones are used for the caps unit tests, and which
are for cli/UI testing and can be updated at will. And drop a bunch
of outdated stuff.
Decouple it from test-many-devices which is really about manual testing
of virt-manager UI. It's annoying that every time test-many-devices is
extended we need to regenerate all the virtxml tests.
We are just mirroring the behavior that virt-manager (and boxes) have
used for a while now.
In my experience the average user is confused by their VMs suspending,
so for our sake I'd rather make people opt into this feature.
The image compression setting has a noticably detrimental effect on
spice graphics quality. It's meant to be used for spice VDI but the
vast majority of people don't use spice in a way that makes bandwidth
usage matter.
Boxes has already done this for a while as well:
https://mail.gnome.org/archives/commits-list/2013-March/msg14904.html
Turn it off by default if creating the VM on a local connection.
Try to use --boot uefi if the user hasn't already specified loader params,
or a kernel to boot. If we can't determine a UEFI setup, just print a
warning.
Introduced by f16dc4dd34
This will cause test case failure on different machines.
Use '/var' to replace it.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Drop redundant tests, organize things better, add more tests where we
can stick new cli device options and view the output, since that's the
most common extension.
Handle type=network in devicedisk.py, and wire up all the network fields
for virt-install --disk. Right now it requires manually spelling out
all the protocol, name, host/port etc fields.
The one 'magic' bit is that VirtualDisk.path will be a pretty URL when
all those network fields are specified. This is keeps things mostly
working in various parts of the code where we expect 'path' to be an
identifier for a VirtualDisk.
clitest.py used the value 100000000000 (100 PB) for memory size, which
was parsed as 0 by older libvirt. Latest release (1.2.10) has the
parsing fixed and properly reports an error on overflow. Changing the
memory size to 4000000 (4 TB) is still an overcommit, at least most
development machines and it works properly.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
It annoys me that all the other CLI options map to the libvirt XML name,
except this one. Of course, keep the old option around for back compat,
just give precendence to the new option.
auto-clone cases use SUPPORT_CONN_BARE_BACKINGSTORE,
which check libvirt 1.2.4.
Change it to SUPPORT_CONN_LOADER_ROM(1.2.9)
and drop SUPPORT_CONN_BARE_BACKINGSTORE.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
libvirt commit
136ad49740f017aabcac48d02d2df6ab7b0195e9
introduce ./hugepages/page/[@size, @unit, @nodeset]
for memory backing.
This patch will add support in virt-install.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Remove some "Memory Backing" parameters from --memory,
and keep 'hugepages' for backward compatibility.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
commit 797afb3b27
bring a dir depending issue when using
fake iso.
Test output will be undecided when virt-manager source
in different dirs.
This patch will touch a fake iso under /tmp,
so test case will pass on most of the machines.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This patch provides the ability to
tune memroy tunable parameters for the domain.
Also add test cases for --memtune option
and update man page.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This patch will enable configuring idmap.
It could be used as enable user namespace
for LXC containers.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This means if we are passed an unmanaged path, we try to create a
storage pool for the parent directory.
We skip directories like /dev where doing this might be problematic.
This makes things much friendlier to use for remote connections, and
means we can always rely on having libvirt's storage APIs to use
for format probing.
We totally break CLI compat here, but the previous tool wasn't sustainable.
Instead, repurpose the tool as strictly converting external formats
like ovf/vmx to native libvirt XML, and launch the guest.
So we drop vmx/virt-image output, and virt-image input, and a slew of
command line options. I don't think anyone was depending on this in a
scripted fashion, so in practice I don't think anyone will care.
Add much more comprehensive unit tests while we are at it.
Since argparse allows optional arguments, we can back compat handle the
original boolean --sound option. This is nicer than using an option
named --soundhw
This stuff is not very helpful and a pain to maintain. Let's drop it once
and for all. We still accept the CLI options and log a warning so people
hopefully take the hint.