dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.59k stars 458 forks source link

filesystem via 9p are always only readable #837

Open mslacken opened 3 years ago

mslacken commented 3 years ago

openSUSE 15.2

Terraform v0.12.26

Compiled against library: libvirt 5.1.0
Using library: libvirt 6.0.0
Running hypervisor: QEMU 4.2.1
Running against daemon: 6.0.0

I have created following entry for a shred filesystem between host and guest:

  filesystem {
    source = "/home/chris/shared"
    target = "shared"
    readonly = false
  }

and mounted it via

mount -t  9p -o trans=virtio,version=9p2000.L,rw shared /srv/shared

but the filesystem is readonly.

The qemu run is also missing the right option:

UID        PID  PPID  C STIME TTY          TIME CMD
qemu      1611     1  6 10:08 ?        00:00:48 /usr/bin/qemu-system-x86_64 -name guest=terraform-vm-kiwi-977de2d4,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-53-terraform-vm-kiwi-97/master-key.aes -machine pc-i440fx-4.2,accel=kvm,usb=off,dump-guest-core=off -cpu qemu64 -m 12288 -overcommit mem-lock=off -smp 12,sockets=12,cores=1,threads=1 -uuid f3b253ba-03eb-4c22-9fea-06ee738a74ba -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=36,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -blockdev {"driver":"file","filename":"/var/tmp/terraform-vdisk-977de2d4.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":null} -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 -fsdev local,security_model=mapped,id=fsdev-fs0,path=/home/chris/shared -device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=shared,bus=pci.0,addr=0x3 -netdev tap,fd=38,id=hostnet0,vhost=on,vhostfd=39 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:f2:9f:91,bus=pci.0,addr=0x4 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,fd=40,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -chardev pty,id=charconsole1 -device virtconsole,chardev=charconsole1,id=console1 -vnc 127.0.0.1:1 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -object rng-random,id=objrng0,filename=/dev/urandom -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x8 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on