2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-26 01:34:05 +00:00
Commit Graph

269 Commits

Author SHA1 Message Date
Daniel Hilst 506069061b fix(xcat-core): a match made elsewhere can name a KVM volume
The name of the volume of a node, and the bus of a file-backed disk, could come from a
match made by a routine on the call path. A riscv64 node breaks on it: a leaked value
that is neither scsi nor virtio gives the node an hd* volume, and the riscv64 virt
machine has no IDE controller for that disk.

createstorage and build_diskstruct in xCAT-server/lib/xcat/plugins/kvm.pm read the model
of the disk out of the vmstorage value with s/=(.*)//, then read $1. The substitution is
allowed to fail, because most vmstorage values state no model, and a failed match leaves
$1 as the last successful capture. dohyp gives every node the storage model scsi before
mkvm runs, and a captured value takes priority over it, so a leaked value can only
replace the default that keeps a riscv64 node on sd*.

The leak follows the call path, not the history of the process. Perl restores $1 when the
block that set it ends, so a match made in a routine that has returned cannot reach
createstorage; only a match still live in an enclosing block can, and a later successful
match without a group empties $1 again. A long-running xcatd is not what makes this
happen, and looking for one is a wrong turn.

Both routines now read $1 only when their own substitution matches. A vmstorage value
that states a model, and vmstoragemodel, name the volume as before.

The default itself moves into default_storagemodel, which dohyp calls, so a test can hold
it. It sat inline with a comment, and changing it to ide left every assertion passing.

kvm_createstorage_model.t runs each node twice, once with a capture left live in the
calling block, because a case that leaves $1 empty passes against the defect. Five of its
eleven assertions fail without this change, and a sixth fails if the default changes.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-04 15:20:57 -03:00
Daniel Hilst 0a858b60f4 fix(xcat-core): a pool-backed KVM disk reaches libvirt with no bus
A node whose vmstorage is a libvirt storage pool (dir://, nfs:// or lvm://) got a <disk>
element with no bus attribute. libvirt then chose the controller from the name of the
device alone, so the disk of a riscv64 node worked only while its volume was named sd*.

build_diskstruct in xCAT-server/lib/xcat/plugins/kvm.pm matched the pool entry, a hash
reference, against /^vd/, /^hd/ and /^sd/. A reference in a match is its address as a
string, so no branch ran and the bus was never set. The name of the device is in the
device field of that entry.

The three tests now read that field. The bus each one sets is the bus libvirt gives an
hd*, sd* or vd* name, so no domain changes: a riscv64 node keeps the sd* name its volume
has, and keeps the scsi controller the riscv64 virt machine provides. libvirt stores the
domain built before this change with bus="scsi" on that disk, which is what the domain
built after it states.

kvm_diskstruct_bus.t drives build_diskstruct in a scratch package, with a stub storage
pool in place of the one routine that reaches libvirt, and asserts the bus of an hd*, an
sd* and a vd* volume. It also asserts that a riscv64 node keeps the sd* name of its
volume. Four of its seven assertions fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-04 15:20:47 -03:00
Daniel Hilst 349658d3d7 fix(xcat-core): mkvm builds a riscv64 node as an x86_64 domain
A node with arch=riscv64 got an x86_64 libvirt domain from mkvm. The node took a
DHCP lease, received the riscv64 GRUB binary that nodeset staged, and could not run
it. The firmware fell through to the empty disk and stopped, so both flat
provisioning cases of the riscv64 cell failed with a node that never installed.

build_xmldesc and build_diskstruct in xCAT-server/lib/xcat/plugins/kvm.pm read the
architecture from the hypervisor cpumodel. The arch of the node was never read while
the domain XML was built, so on an x86_64 hypervisor every guest was an x86_64
guest, whatever the node said.

guest_arch_profile now takes the arch of the node as well, and returns the domain
type, the <os> arch and machine, the firmware and the device settings that follow
from them. A riscv64 node becomes a qemu domain with the virt machine type and UEFI
firmware. It drops the parts the riscv64 virt machine has no controller for, or that
libvirt refuses there: the pae, acpi and apic features, the SeaBIOS serial option,
the ich6 sound card, the USB tablet, and the ide disk and hd* optical drive. libvirt
resolves the emulator and the UEFI firmware files itself. POWER and x86_64 domains
do not change.

kvm_guest_arch.t drives build_xmldesc and build_diskstruct in a scratch package,
stubbing only the routines that reach libvirt or the xCAT database, and asserts the
domain and the disks of each architecture. Ten of its twenty assertions fail without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 8d149c856302c8016fb0ead31e9859fd5a1e9dff)
2026-09-04 12:20:34 -03:00
Daniel Hilst 37666b92cd fix(kvm): emit a pseries domain for ppc64le KVM hypervisors
build_xmldesc only recognised cpumodel "ppc64" (big-endian) when deciding to set
<os type arch='ppc64' machine='pseries'>, but ppc64le hosts report cpumodel
"ppc64le" (virNodeGetInfo model). A guest on a ppc64le hypervisor was therefore
emitted as an x86-style domain -- no machine type and with pae/acpi/apic -- and
libvirt rejected it: "machine type 'pseries-*' does not support ACPI".

Recognise "ppc64le" alongside "ppc64" for the arch/machine block, and omit the
x86-only pae/acpi/apic features on both. Little- and big-endian pseries guests
both use libvirt <os> arch "ppc64".

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-01 06:00:02 -03:00
Daniel Hilst 638f0d75c4 Fix xCAT 2.18 EL10 x86_64 package build issues
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-20 18:48:14 -03:00
Markus Hilger 3930b55550 Merge pull request #7047 from Obihoernchen/vm-macvtap
Create macvtap VM nics
2024-08-28 02:23:21 +02:00
Markus Hilger 2643c1edd6 Remove useless executable bit 2024-05-07 16:19:25 +02:00
Wai Yee Wong 1a751e3379 Reduce the VNC password from 20 characters to 8 2023-03-24 16:58:00 -04:00
Stephane Thiell 100c64b7ec kvm: replace ac97 with ich6 for default audio support
ac97 audio support has been removed from QEMU.
For example in RHEL 9.1 (qemu-kvm-7.0.0), creating new VMs fail
to start with the following error:

	'AC97' is not a valid device model name.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1995819
2023-02-03 23:05:01 -08:00
besawn 71aeb71b85 Spelling correction in chvm output 2022-10-28 10:33:04 -04:00
Markus Hilger 3f244c7ef1 Create macvtap VM nics 2021-10-13 16:40:14 +02:00
Wai Yee Wong 6b344a4c68 Support VM machine types specified through vm.othersettings 2021-08-23 17:36:06 -04:00
Wai Yee Wong 1e768f4d5d Get the correct XML record for a PIC device if it is one of the devices in an iommuGroup 2021-04-12 12:16:05 -04:00
Wai Yee Wong 0e4ce55881 Remove experimental warnings of using given-when and smartmatch. 2020-09-28 21:50:17 -04:00
Mark Gurevich 2d07085122 Display VM disk purge message instead of just logging it 2020-01-15 11:10:03 -05:00
Markus Hilger 98f111538b Add KVM CPU mode to vm.othersettings (see issue #4182)
Initial patch by @ajw1980
2019-12-05 12:31:10 +01:00
Mark Gurevich 35d0728550 Remove old debug statements 2019-09-26 16:06:46 -04:00
GONG Jie c3e7b2d9fd Remove trailing spaces in file xCAT-server/lib/xcat/plugins/kvm.pm 2017-12-31 23:59:59 +00:00
XuWei 691e0ee464 fix issue 4705, modify usage output 2018-01-24 03:16:41 -05:00
Yuan Bai d45f7d4508 Add new PCI format support for pcipassthrough (#3916)
* add devpassthrough support

* add new pci format for pcipassthrough

* add new pci format support

* polished

* update doc
2017-09-14 17:15:47 +08:00
Yuan Bai 7fdffddf9b fix missing graphics label (#3892) 2017-09-11 17:33:02 +08:00
yangsong 970be4a7dd fix issue:rinstall plugin bug when setup SN on sles12.2 ppc64le #3466;fix issue [FVT] rinstall will hung when it failed to terminate sub process with SIGKILL #3094 (#3507) 2017-07-19 17:41:06 +08:00
Mark Gurevich 1c5be50188 Remove : for the output error message 2017-05-03 10:20:14 -04:00
Mark Gurevich 01a9438cbe Updates after a review 2017-04-26 13:44:51 -04:00
Mark Gurevich aa3c152ae2 lsvm to display VM details 2017-03-29 14:32:10 -04:00
Casandra Qiu 865527400f ADD support for power reset of PDU outlet 2017-03-21 12:01:42 -04:00
Mark Gurevich 9763c34e75 Added a warning message 2017-03-13 10:06:40 -04:00
Mark Gurevich 6a2164b6cb Extra checking 2017-03-10 16:15:14 -05:00
Mark Gurevich e265d5401d Handle purging block or raw VM disks when removing a VM 2017-03-10 14:33:55 -05:00
Casandra Qiu f874090137 Syntax Error for issue#2490 2017-02-16 10:01:50 -05:00
Casandra Qiu c4e0f637c9 Add pdu support 2017-02-13 16:33:11 -05:00
Mark Gurevich ff4470e753 Use correct prefix for disks when vmstoragemodel=virtio 2017-01-18 15:30:32 -05:00
ertaozh 555cffdf24 Add debug info for issue 1958: [FVT]Failed to run rmvm when setup SN in x86_64 for rh7.3 and rh6.8 2016-11-17 03:44:44 -05:00
Victor Hu d473bf9f3e Disable ac97 for ppc64le platforms 2016-11-10 13:37:07 -05:00
Mark Gurevich 1e3ce72f09 Changes after review 2016-10-06 13:00:44 -04:00
Mark Gurevich 4f686ebc9e Display errors for rmvm and mkvm 2016-10-05 16:38:41 -04:00
Mark Gurevich c8e7724593 Do not reuse cdrom device label when adding new disks to KVM (#1751)
* Do not reuse cdrom device label when adding new disks to KVM

* Return array of cdrom devices instead of just one
2016-08-27 06:50:07 +08:00
Mark Gurevich 60f54f7fb2 Support --resize option for chvm (#1598)
* Support --resize option for chvm

* Handle generic error from libvirt when resizing VM

* Improve finding the disk to resize
2016-08-16 19:34:15 -05:00
immarvin bae1f51546 add description of subroutine get_disks_by_userspecs 2016-07-29 21:30:16 -04:00
Victor Hu ec2abe3240 Merge pull request #1593 from gurevichmark/chvm_vmstorageformat
Use correct vmstorageformat for chvm
2016-07-26 15:01:53 -04:00
Mark Gurevich 9fc3d2b967 Use correct vmstorageformat for chvm 2016-07-26 14:45:33 -04:00
Mark Gurevich db9a71750e Fix sytax errors reported by perltidy 2016-07-25 08:56:18 -04:00
Mark Gurevich 0a3fbd8d51 perltidy all perl files 2016-07-20 11:40:27 -04:00
XuWei d6e7b250f9 Improve performance of kvm (powering-on) 2016-07-18 22:21:12 -04:00
XuWei 663e41e0d3 Fix issue 1468, modified to check the value of array element 2016-07-04 22:14:53 -04:00
XuWei cc47d51ff6 add status powering-on for blade 2016-07-01 05:20:44 -04:00
XuWei 2a4b0a9caa add powering-on status for PPC-HMC 2016-06-30 20:51:01 -04:00
yangsong 1d3d27bece Merge pull request #1358 from xuweibj/I980
Fix issue 980, add status powering-on
2016-06-23 03:01:15 -05:00
XuWei 704f03bcd0 Fix issue 980, add status powering-on 2016-06-22 01:37:40 -04:00
Mark Gurevich 65246bdc01 Ignore 'File exists' error from storage pool build 2016-06-17 10:35:03 -04:00