OVM CPU Pinning

If you clone or recover an Oracle VM guest, and the source used CPU pinning (Hard Partitioning), the target may not work.  The error is entirely non-intuitive, and I could not find it on the interwebs, so here is a sanitized version.

OVMAPI_5001E Job: 1416254413024/QueuedVmStartDbImpl_1416254413023/OVMJOB_1500J Start/resume vm: PRODVM, on server: PRODSERVER, failed. 
Job Failure Event: 1416254413902/Server Async Command Failed/OVMEVT_00C014D_001 Async command failed on server: PRODSERVER. 
Object: PRODVM, PID: 15431, Server error: 
Command: [‘xm’, ‘create’, ‘/OVS/Repositories/000dead000beef00cafe0421cab55bad/VirtualMachines/000dead000beef00cafef207cabdbbad/vm.cfg’] failed (1): 
stderr: Error: (22, ‘Invalid argument’) 
stdout: Using config file “/OVS/Repositories/000dead000beef00cafe0421cab55bad/VirtualMachines/000dead000beef00cafef207cabdbbad/vm.cfg”. , 
on server: PRODSERVER, associated with object: 000dead000beef00cafef207cabdbbad [Thu Apr 15 00:12:19 EDT 2021]

 

You can remove the “cpus = ‘#-#'” line from vm.cfg to reset this.

References about OVM hard partitioning includes:

xm info

xm list

xenpm get-cpu-topology

xm vcpu-list

# cd /u01/app/oracle/ovm-manager-3/ovm_utils
# ./ovm_vmcontrol -u admin -p YourPassword -h ovm-manager -v my-first-vm -c vcpuset -s 0-7
Oracle VM VM Control utility 0.6.3.
Connected.
Command : vcpuset
Pinning virtual CPUs
Pinning of virtual CPUs to physical threads  '0-7' 'my-first-vm' completed.

After that, vcpu-list will show VM names in column 1 for dedicated CPUs.

GRC VM Template

Installed base OS

Ubuntu 16.04.4 LTS  because only LTS releases are worthy.  No auto-updates.
Copy over home directory and /etc/apt from my current TESTNET system

Split /home /usr /var /tmp into separate LVs.

lvcreate, edit /etc/fstab, mount on temp space, copy over, move old dir, reboot, remove old dir.

Shrunk root filesystem

grub
e
root=/dev/ram0 rw
^X

Wait for mdadm to finish complaining.
alias ll='ls -laF'
mkdir /mnt
lvm pvscan
lvm vgscan
lvm vgchange -a y
e2fsck -f /dev/ubuntu-vg/root
mount /dev/ubuntu-vg/root /mnt
cd /mnt
cp -a lib lib65 bin sbin /
cd /
umount /mnt
e2fsck -f /dev/ubuntu-vg/root
resize2fs -M /dev/ubuntu-vg/root
lvreduce -L 1120M /dev/ubuntu-vg/root
e2fsck -f /dev/ubuntu-vg/root
resize2fs /dev/ubuntu-vg/root
umount -a

power off VM since halt and reboot do not work.

Cleared free space

lvcreate -l 100%FREE -n deleteme ubuntu-vg
dd if=/dev/zero of=/dev/null bs=256k
lvremove /dev/ubuntu-vg/deleteme
swapoff /dev/ubuntu-vg/swap_1
dd if=/dev/zero of=/dev/ubuntu-vg/swap_1 bs=256k
for i in / /home /var /tmp /boot /usr ; do dd if=/dev/null of=${i}/deleteme bs=256k & rm ${i}/deleteme ; done
halt -p

Compacted

"\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd --compact "Xenial GRC Build.vdi"

Plans

Snapshot, test building.


PPC64 Linux on Intel

QEMU on Windows will run ppc64 and ppc64le emulation.
It emulates the same as what PowerKVM on an S812L would provide.
It’s kind of slow because there is no KVM module, AND Intel vs PPC,
AND emulator mode is single-core/proc/thread.

You can get Windows installer here:
https://qemu.weilnetz.de/

You really want ANSI/VT100 escape codes on you “cmd.exe” also:
https://github.com/adoxa/ansicon

To build a blank disk:
qemu-img create -f qcow2 qemu-disk-ppc64.img 32G

You can boot with this:
set SDL_STDIO_REDIRECT=NO
qemu-system-ppc64 -M type=pseries -m 1G,slots=4,maxmem=8G
-cpu POWER8E -smp 1 -vga none -nographic
-netdev user,id=net0 -device spapr-vlan,netdev=net0
-device spapr-vscsi -device scsi-hd,drive=drive0
-drive id=drive0,if=none,file=qemu-disk-ppc64.img
-cdrom D:\Downloads\debian-testing-ppc64el-DVD-1.iso

The QEMU part is all one line. The cdrom image is up to you. I like Debian.

Other Notes:
Any issues with cursor keys, use ctrl-i for TAB, ctrl-n and ctrl-p for next/previous.

Emulation mode is flaky with more than one core.

There is a QEMU AIX build on PERZL.ORG which would be faster, especially for ppc64 BigEndian.

PowerKVM is just PPC Linux, QEMU, KVM, and LIBVIRT. KVM is just a kernel module for spee-dup. LIMVIRT is just a GUI and CLI tool to build VM definitions. QEMU is the emulator. Works best on POWER8, with hypervisor disabled (OPAL mode).

QEMU still does not have enough RTAS and NVRAM to boot AIX. AIX hangs during “Starting AIX”, and Diags just says it’s an unsupported machine type. There is a little bit of dev for this, but not much.​