[libvirt-users] [virtual interface] detach interface during boot succeed with no changes
by Yalan Zhang
Hi guys,
when I detach an interface from vm during boot (vm boot not finished), it
always fail. I'm not sure if there is an existing bug. I have
confirmed with someone that for disk, there is similar behavior, if
this is also acceptable?
# virsh destroy rhel7.2; virsh start rhel7.2 ;sleep 2; virsh
detach-interface rhel7.2 network 52:54:00:98:c4:a0; sleep 2; virsh
dumpxml rhel7.2 |grep /interface -B9
Domain rhel7.2 destroyed
Domain rhel7.2 started
Interface detached successfully
<address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
</controller>
<interface type='network'>
<mac address='52:54:00:98:c4:a0'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
When I detach after the vm boot, expand the sleep time to 10, it will succeed.
# virsh destroy rhel7.2; virsh start rhel7.2 ;sleep 10; virsh
detach-interface rhel7.2 network 52:54:00:98:c4:a0; sleep 2; virsh
dumpxml rhel7.2 |grep /interface -B9
Domain rhel7.2 destroyed
Domain rhel7.2 started
Interface detached successfully
-------
Best Regards,
Yalan Zhang
IRC: yalzhang
Internal phone: 8389413
2 years, 1 month
Need more doc for libvirt-console-proxy
by Guy Godfroy
Hello,
I'm making a web app for my company that will enable different teams to
manage their own VMs. I wish to make possible to interact with each VM
console, so I plan to use some xterm.js with websockets.
So I discovered libvirt-console-proxy [1] when I looked for something to
put a libvirt console into a websocket. That seems like the right tool
for the job.
The only doc I found is this article from 2017 [2]. After trying to
understand from this article and from --help, I still have many
questions. I am really bad at reading code so I can't even get answers
from the sources.
My main concern is: How a client is supposed to talk to the proxy? It is
said that a security token must be provided. How? HTTP header? Which
header? Am I missing something in websocket protocol? I think an example
client implementation would help a lot.
Also, I tried to use virtconsoleresolveradm to set up metadata on my
domains like explained in the article [1] :
./virtconsoleresolveradm enable milou
Enabled access to domain 'milou'
But that doesn't seem to do anything (except defining the metadata
namespace in the XML):
virsh metadata milou http://libvirt.org/schemas/console-proxy/1.0
<consoles/>
I precise that I have already this in my XML:
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
Should I remove that? Should I edit that?
Thanks for your help.
Guy Godfroy
[1] https://gitlab.com/libvirt/libvirt-console-proxy
[2]
https://www.berrange.com/posts/2017/01/26/announce-new-libvirt-console-pr...
3 years
virtiofs mounted filesystems & SELinux
by Link Dupont
I am mounting a filesystem into a domain using the virtiofs driver.
<filesystem accessmode="passthrough" type="mount">
<source dir="/home"/>
<target dir="/home"/>
<driver type="virtiofs"/>
</filesystem>
Both my host (Fedora 34) and guest (CentOS 8.4) are running with SELinux
enforcing. From my host, I can see that the SELinux context type is set to
user_home_dir_t.
$ ls -ldZ /home/link
drwxr-xr-x. 61 link link system_u:object_r:user_home_dir_t:s0 8192 May 21
12:41 /home/link
>From within the guest however, the volume is unlabeled_t
$ ls -lZd /home/link
drwxr-xr-x. 61 link link system_u:object_r:unlabeled_t:s0 8192 May 21 12:53 /
home/link
Is there a way to pass the SELinux context through to the guest? Or mount the
volume with the correct options to map SELinux contexts?
3 years, 4 months
Re: How to hot plugin a new vhost-user-blk-pci device to running VM?
by 梁朝军
Thanks all of you for your help.
One more question regarding vhost-user-blk-pci type device, how to identify a vhost-blk disk in QEUM VM ? for example, disk name looks like vda,vdb,..., but that some application in VM want to detect that a certain entry is really the device it is waiting for. Specific for windows , they always show as disk 0, 1, 2….etc
Is there any way to identify those disk with each other in VM?
thanks
> 在 2021年5月17日,下午3:13,Michal Prívozník <mprivozn(a)redhat.com> 写道:
>
> On 5/17/21 7:08 AM, Liang Chaojun wrote:
>>
>> Thanks Michal and Peter for your response. I‘ m running it on qemu 5.1 build by myself. BTW, follow Peter’s suggestion, where I can get the latest rpms if I want to upgrade to Libvirt 7.1? As I know it seems need more than twenty related rpms not include dependency.
>
> Well, since you're building qemu yourself you could also build libvirt.
> Just be aware that the v7.3.0 release was the last one that supports
> RHEL-7. Newer releases might still work, but upstream does not aim to
> make everything work.
>
> https://libvirt.org/platforms.html
>
> Michal
>
3 years, 4 months
how to increase vram in windows guest?
by gansteed
Hello:
I'm using kvm to host a windows 7 guest vm, I've install the latest
spice guest tools from
https://spice-space.org/download/windows/spice-guest-tools/spice-guest-to...,
and I've set video section like this:
<video>
<model type="qxl" ram="262144" vram="262144" vram64="262144"
vgamem="131072" heads="1" primary="yes"/>
<alias name="video0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01"
function="0x0"/>
</video>
but the graphics in windows guest is laggy, I' found that the guest have
only use 16MB as vram:
How can I increase the real usage of vram in the windows guest vm?
3 years, 5 months
Console of P2V?
by Ken D'Ambrosio
Hey, all. For one, apologies if this isn't quite the right list, I tried
to get the right one. But, my problem: I'm firing up a Centos 6.5 box
with virt-install, recently converted from a physical (I did a 'dd' to a
raw image, and converted it to qcow2), and it boots fine, etc., etc.,
but I can't get to the console except through vnc; "virsh console" just
shows a blank screen. Do I need to tell the kernel to boot in ASCII
mode or somesuch?
Thanks!
-Ken
3 years, 5 months
virHostdevIsPCINodeDeviceUsed
by Simon Fairweather
I am looking to be able to check if a specific PCI device is allocated to a
guest.
An error is produced if a domain is started and the device is in use within
another domain via this function.
I cannot see a publicly available function to use to get this information,
is there one available or is there another way to check the state of the
PCI device.
Regards
Simon
3 years, 5 months
How to hot plugin a new vhost-user-blk-pci device to running VM?
by Liang Chaojun
Hi Guy,
Does anyone clear how to hot plugin a new vhost-user-blk-pci device to a running VM?
Before staring vm , I pass the disk through QEMU command line like below.
<qemu:commandline>
<qemu:arg value='-object'/>
<qemu:arg value='memory-backend-file,id=mem0,size=4G,mem-path=/dev/hugepages,share=on'/>
<qemu:arg value='-numa'/>
<qemu:arg value='node,memdev=mem0'/>
<qemu:arg value='-chardev'/>
<qemu:arg value='socket,id=spdk_vhost_blk721ea46a-b306-11eb-a280-525400a98761,path=/var/tmp/vhost.721ea46a-b306-11eb-a280-525400a98761,reconnect=1'/>
<qemu:arg value='-device'/>
<qemu:arg value='vhost-user-blk-pci,chardev=spdk_vhost_blk721ea46a-b306-11eb-a280-525400a98761,bootindex=1,num-queues=4'/>
<qemu:arg value='-chardev'/>
<qemu:arg value='socket,id=spdk_vhost_blk2f699c58-d222-4629-9fdc-400c3aadc55e,path=/var/tmp/vhost.2f699c58-d222-4629-9fdc-400c3aadc55e,reconnect=1'/>
<qemu:arg value='-device'/>
<qemu:arg value='vhost-user-blk-pci,chardev=spdk_vhost_blk2f699c58-d222-4629-9fdc-400c3aadc55e,num-queues=4'/>
</qemu:commandline>
But I don’t know how to live add a vhost-user-blk-pci device on running VM even with calling attachDevice API now.
OS: redhat 7.4 Libvirt version: 3.4
Your help will be appreciated.
Thanks!
3 years, 5 months
boot arm64 guest stuck
by Jiatong Shen
hello community,
I am stuck at a problem where a virtual machine stuck at "guest has not
initialized the display" on a arm64 (FT2000+) server and the relevant qemu
process will continue to have a cpu usage of 100%.
I do try with different qemu and qemu-efi combined and found out that if I
use qemu build qemu-system-arm/now 1:2.11+dfsg-1ubuntu7.15~cloud1 arm64
with qemu-efi/now 0~20160408.ffea0a2c-2 all and set gic-version to 2, the
vm could boot.
the virtual machine uses a kylink 4.0 image. I am scrubbing my head to
debug the bug and find out the reason...
any idea or advice will be appreciated. thank you very much for the help
--
Best Regards,
Jiatong Shen
3 years, 5 months