How to get qemu guest agent and text based console to work with latest 0.9.0 release? #1231
Replies: 7 comments 1 reply
-
|
Just as an fyi, I do have working code https://github.com/mrmcmuffinz/my-ai-journey/blob/v0.1.1/infra/terraform/main.tf but that uses provider 0.8.3 which I have read in numerous issues it has been replaced with 0.9.0. |
Beta Was this translation helpful? Give feedback.
-
|
I'm also trying to figure out these issues while converting from 0.8.3 to 0.9.0. I THINK this will solve your console issue. Still trying to figure out the agent issue. |
Beta Was this translation helpful? Give feedback.
-
|
This is the XML that's required in order to connect the agent: I determined this by playing around with Virtual Machine Manager, and confirmed it by having v0.9.0 create a VM, modifying the XML, giving it a reboot, and confirming the agent is working. That means that the following SHOULD work: However, that isn't working for me. I don't see anything that references any of the devices (except interfaces) by name, so it isn't a function of the provider that is including/excluding it. I think there's some code around cleaning up the devices to remove invalid things, maybe it's hitting on that? I need to dig into it further... |
Beta Was this translation helpful? Give feedback.
-
|
Smooth brain moment. The reason I couldn't find anything killing it, yet it wasn't being processed, is because I was looking at the wrong version of the code. In v0.9.0, only defined device types (seen here) can be defined. Channels is not in that list. Unless I'm missing something, I don't see a way that we could define Channels in v0.9.0. The good news (if I'm understanding it correctly) is that the next release (and potentially one you could build from main) is going to be a lot more flexible and allow us to do whatever we want, then just check if it looks close enough to being valid. |
Beta Was this translation helpful? Give feedback.
-
|
I have attempted all the prior suggestions with release 0.9.0 but it does not work. In fact one weird behavior I noticed is that you can actually define channels as a device but it does absolutely nothing. Which I think is a bug. relevant domain code:
<domain type='kvm' id='83'>
<name>txgrid-cp0</name>
<uuid>2f3e6291-673f-48cc-8024-60867f8d1bcd</uuid>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<vcpu placement='static'>4</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-q35-8.2'>hvm</type>
<boot dev='hd'/>
</os>
<cpu mode='custom' match='exact' check='full'>
<model fallback='forbid'>qemu64</model>
<feature policy='require' name='x2apic'/>
<feature policy='require' name='hypervisor'/>
<feature policy='require' name='lahf_lm'/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='volume' device='disk'>
<driver name='qemu' type='qcow2'/>
<source pool='default' volume='cp0.qcow2' index='2'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</disk>
<disk type='volume' device='cdrom'>
<driver name='qemu' type='raw'/>
<source pool='default' volume='cp0-seed.iso' index='1'/>
<backingStore/>
<target dev='sda' bus='sata'/>
<readonly/>
<alias name='sata0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0' model='qemu-xhci'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</controller>
<controller type='sata' index='0'>
<alias name='ide'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pcie-root'>
<alias name='pcie.0'/>
</controller>
<controller type='pci' index='1' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='1' port='0x10'/>
<alias name='pci.1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
</controller>
<controller type='pci' index='2' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='2' port='0x11'/>
<alias name='pci.2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
</controller>
<controller type='pci' index='3' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='3' port='0x12'/>
<alias name='pci.3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
</controller>
<controller type='pci' index='4' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='4' port='0x13'/>
<alias name='pci.4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
</controller>
<controller type='pci' index='5' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='5' port='0x14'/>
<alias name='pci.5'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
</controller>
<controller type='pci' index='6' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='6' port='0x15'/>
<alias name='pci.6'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
</controller>
<interface type='bridge'>
<mac address='34:97:f6:aa:bb:c0'/>
<source bridge='br0'/>
<target dev='vnet164'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:b2:ce:4f'/>
<source network='hostnet' portid='1e63ab08-3b6d-40eb-8b87-d5d943b48e8e' bridge='virbr0'/>
<target dev='vnet165'/>
<model type='virtio'/>
<alias name='net1'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</interface>
<input type='mouse' bus='ps2'>
<alias name='input0'/>
</input>
<input type='keyboard' bus='ps2'>
<alias name='input1'/>
</input>
<graphics type='spice' port='5901' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<audio id='1' type='spice'/>
<video>
<model type='virtio' heads='1' primary='yes'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</video>
<watchdog model='itco' action='reset'>
<alias name='watchdog0'/>
</watchdog>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'>
<label>libvirt-2f3e6291-673f-48cc-8024-60867f8d1bcd</label>
<imagelabel>libvirt-2f3e6291-673f-48cc-8024-60867f8d1bcd</imagelabel>
</seclabel>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>+64055:+993</label>
<imagelabel>+64055:+993</imagelabel>
</seclabel>
</domain> |
Beta Was this translation helpful? Give feedback.
-
|
this one worked for me, I'm using main branch: |
Beta Was this translation helpful? Give feedback.
-
|
How did you switch over to main branch? I tried switching by
However when I do that my terraform code doesn't even get past the plan phase. Atleast with 0.9.0 I could actually provision something but with latest main code it breaks. My code is at https://github.com/mrmcmuffinz/my-ai-journey/blob/upgrade_libvirt_provider_to_0_9_x/infra/terraform/main.tf |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Below is the code I have so far for standing up my virtual machines.
I'm able to login to the virtual machines using Virtual Machine Manager however I can't seem to do it over console. I also have to go a round about way of logging in via gui to find out the network information and then I can SSH to my KVM. The issue is I used to be able to run the below command but since the channel is not configured to allow the KVM to communicate with the agent it fails.
I have tried looking for examples and read through the docs. I have had no luck and it isn't clear to me how to proceed.
In summary
Beta Was this translation helpful? Give feedback.
All reactions