Hello,
I am experiencing some weird problems with TwinCAT (TC) in a Windows-VM. Because these problems do not occur with a different hypervisor (vmware ESX or HyperV), I suspect that the problem is related to Proxmox, KVM and/or their implementation of nesting. But first things first:
I am currently in the process of installing the TwinCAT runtime in a Windows 10-VM. For those who are not familiar with TwinCAT: "The Windows Control and Automation Technology", TwinCAT, is the leading software for a soft-PLC that makes Windows real-time capable through a kernel extension. The most important requirement for 64-bit systems is access to the virtualization extension "VT-x".
There are then two modes for operating TwinCAT: "shared core" or "isolated core". With "shared core", TC shares a CPU core with Windows and both alternate in computing times.
In "isolated core"-mode, Windows is configured to use 1 core less than the CPU provides. This "isolated" core can then be used exclusively by TwinCAT (e.g. 4-core CPU: Windows uses 3 Cores and TwinCAT uses the fourth).
Also, this method is the only way to run TwinCAT in a 64-bit VM; "shared core" is only available on 32-bit VMs.
However, this is exactly where the problem lies:
In a 64-bit Windows VM with nesting enabled and operation mode "isolated core" (4 cores in Proxmox, 3 are for Windows and one for TwinCAT) the PLC can be started and runs without problems. The CPU load of all cores increases from 16% in idle mode to about 19% (visible in Proxmox).
But when I stop the PLC, the CPU usage jumps up by exactly 25% - the isolated core seems to be at 100% load. After that, TC cannot be started anymore and reports "startup of isolated core failed". The core hangs and remains in this state until the VM is rebooted.
However, this identical system configuration (64-Bit, Win10S, nesting enabled) works fine if another hypervisor, e.g. vmware ESX, HyperV or VirtualBox, is used - the PLC can be started and stopped multiple times.
Has anyone here had a similar problem? Is it possible that there is a bug in Proxmox or KVM, especially when a core is not used by Windows?
Thanks!
__
VM-Configuration:
(Most important is the "args"-line: TwinCAT doesn't want to start without it, even if the cpu-config has the same flags)
I am experiencing some weird problems with TwinCAT (TC) in a Windows-VM. Because these problems do not occur with a different hypervisor (vmware ESX or HyperV), I suspect that the problem is related to Proxmox, KVM and/or their implementation of nesting. But first things first:
I am currently in the process of installing the TwinCAT runtime in a Windows 10-VM. For those who are not familiar with TwinCAT: "The Windows Control and Automation Technology", TwinCAT, is the leading software for a soft-PLC that makes Windows real-time capable through a kernel extension. The most important requirement for 64-bit systems is access to the virtualization extension "VT-x".
There are then two modes for operating TwinCAT: "shared core" or "isolated core". With "shared core", TC shares a CPU core with Windows and both alternate in computing times.
In "isolated core"-mode, Windows is configured to use 1 core less than the CPU provides. This "isolated" core can then be used exclusively by TwinCAT (e.g. 4-core CPU: Windows uses 3 Cores and TwinCAT uses the fourth).
Also, this method is the only way to run TwinCAT in a 64-bit VM; "shared core" is only available on 32-bit VMs.
However, this is exactly where the problem lies:
In a 64-bit Windows VM with nesting enabled and operation mode "isolated core" (4 cores in Proxmox, 3 are for Windows and one for TwinCAT) the PLC can be started and runs without problems. The CPU load of all cores increases from 16% in idle mode to about 19% (visible in Proxmox).
But when I stop the PLC, the CPU usage jumps up by exactly 25% - the isolated core seems to be at 100% load. After that, TC cannot be started anymore and reports "startup of isolated core failed". The core hangs and remains in this state until the VM is rebooted.
However, this identical system configuration (64-Bit, Win10S, nesting enabled) works fine if another hypervisor, e.g. vmware ESX, HyperV or VirtualBox, is used - the PLC can be started and stopped multiple times.
Has anyone here had a similar problem? Is it possible that there is a bug in Proxmox or KVM, especially when a core is not used by Windows?
Thanks!
__
VM-Configuration:
(Most important is the "args"-line: TwinCAT doesn't want to start without it, even if the cpu-config has the same flags)
Code:
agent: 1
args: -cpu 'host,+pcid,+spec-ctrl,+ssbd'
boot: order=ide0;net0
cores: 3
cpu: host,flags=+pcid;+spec-ctrl;+ssbd
efidisk0: local-lvm:vm-100-disk-1,size=4M
ide0: local-lvm:vm-100-disk-0,size=32G
kvm: 1
machine: pc-i440fx-6.0
memory: 8192
name: Win10Eval-1
net0: virtio=0A:B1:A8:80:8F:ED,bridge=vmbr1,firewall=1
numa: 1
ostype: win10
parent: Ausgangsbedingungen
scsihw: virtio-scsi-pci
smbios1: uuid=c01feef2-02...
sockets: 1
vmgenid: 50f30ea3...
Last edited: