Re: [vdsm] start vm which in pool failed-please help test the code

2013-09-29 Thread bigclouds





At 2013-09-24 09:01:45,bigclouds bigclo...@163.com wrote:


my code is attached
1. modify hooks.py  in function _runHooksDir , add 'scriptenv['M_vmName'] = 
vmconf.get('vmName', )'  for script needs vmname
2.modify vdsm service which call hooks.pyc  from hooks.pyc to hooks.py , for  u 
modify it above.
3.cp 40_guestname to  /usr/.../.../hooks/before_vm_start/
4. yum install 
libguestfs-winsupport-1.0-7.el6.x86_64
libguestfs-tools-c-1.16.34-2.el6.x86_64
python-libguestfs-1.16.34-2.el6.x86_64
libguestfs-1.16.34-2.el6.x86_64
libguestfs-tools-1.16.34-2.el6.x86_64
5.restart vdsm service
6.u need create a vm of a pool


thanks.






At 2013-09-23 16:51:40,Dan Kenigsberg dan...@redhat.com wrote:
On Sun, Sep 22, 2013 at 05:57:25PM +0800, bigclouds wrote:
 hi, Dan
 i am happy to contribute my code until it is tested.
 

Could you at least share the offending domxml?

 
 i am not sure if it is related to selinux because no matter i enable or 
 disable selinux (SELINUX=disabled mode) the error remain.
 
 
 i define a xml recording to vdsm.log infos, and 'virsh start myvm', the same 
 error occurs
 i copy the comand line which is recorded in libvirtd.log or myvm.log  when  
 start a vm, and lauch it directly, it starts without error.
 
 
 do u notice the confision, u can start it throught command line, but fail 
 throught libvirt.
 i have checked almost every place like perm,ownner ship, lv active, backing 
 file.etc
 
 
   i am going to cry. (._.)

No need for that ;-)

Which libvirt version do you use? which storage (nfs/block)?
Could it be another case of the the libvirt regression about
supplementarry groups? If so,
https://rhn.redhat.com/errata/RHSA-2013-1272.html is out and a libvirt
upgrade is most welcome.

 
 
 
 
 
 
 -error log-  testname-1.log---
 2013-09-22 00:50:15.430+: starting up
 LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=spice 
 /usr/libexec/qemu-kvm -name testname-1 -S -M rhel6.4.0 -cpu Nehalem 
 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -uuid 
 24f7e975-9aa5-4a14-b0f0-590add14c8b5 -smbios 
 type=1,manufacturer=mcVdi,product=mcVdi 
 Node,version=6-4.el6.centos.10,serial=25F59E10-794D-11E1-8835-3440B587CE3F_34:40:b5:87:ce:3f,uuid=24f7e975-9aa5-4a14-b0f0-590add14c8b5
  -nodefconfig -nodefaults -chardev 
 socket,id=charmonitor,path=/var/lib/libvirt/qemu/testname-1.monitor,server,nowait
  -mon chardev=charmonitor,id=monitor,mode=control -rtc 
 base=localtime,driftfix=slew -no-shutdown -device 
 piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device 
 virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive 
 file=/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/c04b1d4f-abeb-4e64-8932-2f325a0a5af4,if=none,id=drive-ide0-0-0,format=qcow2,serial=ac025dc1-4e25-4b71-8c56-88dcb61b9f09,cache=none,werror=stop,rerror=stop,aio=native
  -device 
 ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 
 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw,serial= 
 -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev 
 tap,fd=31,id=hostnet0 -device 
 rtl8139,netdev=hostnet0,id=net0,mac=00:1a:4a:a8:05:b9,bus=pci.0,addr=0x3 
 -chardev 
 socket,id=charchannel0,path=/var/lib/libvirt/qemu/channels/testname-1.com.redhat.rhevm.vdsm,server,nowait
  -device 
 virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm
  -chardev 
 socket,id=charchannel1,path=/var/lib/libvirt/qemu/channels/testname-1.org.qemu.guest_agent.0,server,nowait
  -device 
 virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0
  -chardev spicevmc,id=charchannel2,name=vdagent -device 
 virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel2,id=channel2,name=com.redhat.spice.0
  -chardev pty,id=charconsole0 -device 
 virtconsole,chardev=charconsole0,id=console0 -spice 
 port=5904,tls-port=5905,addr=192.168.5.100,x509-dir=/etc/pki/vdsm/libvirt-spice,tls-channel=main,tls-channel=display,tls-channel=inputs,tls-channel=cursor,tls-channel=playback,tls-channel=record,tls-channel=smartcard,tls-channel=usbredir,seamless-migration=on
  -k en-us -vga qxl -global qxl-vga.ram_size=67108864 -global 
 qxl-vga.vram_size=67108864 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device 
 virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
 char device redirected to /dev/pts/4
 qemu-kvm: -drive 
 file=/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/c04b1d4f-abeb-4e64-8932-2f325a0a5af4,if=none,id=drive-ide0-0-0,format=qcow2,serial=ac025dc1-4e25-4b71-8c56-88dcb61b9f09,cache=none,werror=stop,rerror=stop,aio=native:
  could not open disk image 
 

Re: [vdsm] start vm which in pool failed

2013-09-24 Thread Ayal Baron


- Original Message -
 hi, Dan
 i am happy to contribute my code until it is tested.
 
 i am not sure if it is related to selinux because no matter i enable or
 disable selinux (SELINUX= disabled mode) the error remain.
 
 i define a xml recording to vdsm.log infos, and 'virsh start myvm', the same
 error occurs
 i copy the comand line which is recorded in libvirtd.log or myvm.log when
 start a vm, and lauch it directly, it starts without error.
 
 do u notice the confision, u can start it throught command line, but fail
 throught libvirt.
 i have checked almost every place like perm,ownner ship, lv active, backing
 file.etc

what version of libvirt are you using?

 
 i am going to cry. (._.)
 
 
 
 -error log- testname-1.log---
 2013-09-22 00:50:15.430+: starting up
 LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=spice
 /usr/libexec/qemu-kvm -name testname-1 -S -M rhel6.4.0 -cpu Nehalem
 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -uuid
 24f7e975-9aa5-4a14-b0f0-590add14c8b5 -smbios
 type=1,manufacturer=mcVdi,product=mcVdi
 Node,version=6-4.el6.centos.10,serial=25F59E10-794D-11E1-8835-3440B587CE3F_34:40:b5:87:ce:3f,uuid=24f7e975-9aa5-4a14-b0f0-590add14c8b5
 -nodefconfig -nodefaults -chardev
 socket,id=charmonitor,path=/var/lib/libvirt/qemu/testname-1.monitor,server,nowait
 -mon chardev=charmonitor,id=monitor,mode=control -rtc
 base=localtime,driftfix=slew -no-shutdown -device
 piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device
 virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive
 file=/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/c04b1d4f-abeb-4e64-8932-2f325a0a5af4,if=none,id=drive-ide0-0-0,format=qcow2,serial=ac025dc1-4e25-4b71-8c56-88dcb61b9f09,cache=none,werror=stop,rerror=stop,aio=native
 -device
 ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1
 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw,serial=
 -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev
 tap,fd=31,id=hostnet0 -device
 rtl8139,netdev=hostnet0,id=net0,mac=00:1a:4a:a8:05:b9,bus=pci.0,addr=0x3
 -chardev
 socket,id=charchannel0,path=/var/lib/libvirt/qemu/channels/testname-1.com.redhat.rhevm.vdsm,server,nowait
 -device
 virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm
 -chardev
 socket,id=charchannel1,path=/var/lib/libvirt/qemu/channels/testname-1.org.qemu.guest_agent.0,server,nowait
 -device
 virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0
 -chardev spicevmc,id=charchannel2,name=vdagent -device
 virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel2,id=channel2,name=com.redhat.spice.0
 -chardev pty,id=charconsole0 -device
 virtconsole,chardev=charconsole0,id=console0 -spice
 port=5904,tls-port=5905,addr=192.168.5.100,x509-dir=/etc/pki/vdsm/libvirt-spice,tls-channel=main,tls-channel=display,tls-channel=inputs,tls-channel=cursor,tls-channel=playback,tls-channel=record,tls-channel=smartcard,tls-channel=usbredir,seamless-migration=on
 -k en-us -vga qxl -global qxl-vga.ram_size=67108864 -global
 qxl-vga.vram_size=67108864 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device
 virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
 char device redirected to /dev/pts/4
 qemu-kvm: -drive
 file=/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/c04b1d4f-abeb-4e64-8932-2f325a0a5af4,if=none,id=drive-ide0-0-0,format=qcow2,serial=ac025dc1-4e25-4b71-8c56-88dcb61b9f09,cache=none,werror=stop,rerror=stop,aio=native:
 could not open disk image
 /rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/c04b1d4f-abeb-4e64-8932-2f325a0a5af4:
 Operation not permitted
 
 
 
 
 
 
 At 2013-09-22 17:23:29,Dan Kenigsberg dan...@redhat.com wrote:
 On Sun, Sep 22, 2013 at 09:59:08AM +0800, bigclouds wrote:
  i find a bug fixed 1 year ago.
   
  type=VIRT_CONTROL msg=audit(1379813127.359:42015): user pid=1637 uid=0
   auid=4294967295 ses=4294967295
   subj=system_u:system_r:virtd_t:s0-s0:c0.c1023 msg='virt=kvm op=start
   reason=booted vm=testname-1 uuid=24f7e975-9aa5-4a14-b0f0-590add14c8b5
   vm-pid=-1 exe=/usr/sbin/libvirtd hostname=? addr=? terminal=?
   res=failed'
  https://bugzilla.redhat.com/show_bug.cgi?id=835936
   
  but in my case, i have 'setenforce 0',
 
 If there's an SELinux-related regression, we should understand it, not
 hide it with `setenforce 0` ;-)
 Which is the version of your selinux-policy rpm?
 
  i had not noticed both of you online on irc channel. how could you review
   my code and talk about it.
  thanks
 
 Sorry, we have plenty of holidays this time of year.
 
 You are most welcome to post the code on-list, or to vdsm's gerrit (if
 you would like to contribute it to 

Re: [vdsm] start vm which in pool failed

2013-09-18 Thread Itamar Heim

On 09/18/2013 08:03 AM, bigclouds wrote:

when starting a vm of a pool  fails.in the process of hooks, i
modify guestvm hostname, and modify the path of backing file of chain.
do nothing else.
i can munually define a xml(after hooks), and start it without error.
env:
libvirt-0.10.2-18.el6_4.5.x86_64
2.6.32-358.6.2.el6.x86_64
centos6.4
1.where does this error message come from ?
Storage.StorageDomain WARNING Could not find mapping for lv
d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/cae1bb2d-0529-4287-95a3-13dcb14f082f
2.
Thread-6291::ERROR::2013-09-18
12:44:21,205::vm::683::vm.Vm::(_startUnderlyingVm)
vmId=`24f7e975-9aa5-4a14-b0f0-590add14c8b5`::The vm start process failed
Traceback (most recent call last):
   File /us r/share/vdsm/vm.py, line 645, in _startUnderlyingVm
 self._run()
   File /usr/share/vdsm/libvirtvm.py, line 1529, in _run
 self._connection.createXML(domxml, flags),
   File /usr/lib64/python2.6/site-packages/vdsm/libvirtconnection.py,
line 83, in wrapper
 ret = f(*args, **kwargs)
   File /usr/lib64/python2.6/site-packages/libvirt.py, line 2645, in
createXML
 if ret is None:raise libvirtError('virDomainCreateXML() failed',
conn=self)
libvirtError: internal error Process exited while reading console log
output: char device redirected to /dev/pts/4
qemu-kvm: -drive
file=/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/cae1bb2d-0529-4287-95a3-13dcb14f082f,if=none,id=drive-ide0-0-0,format=qcow2,serial=ac025dc1-4e25-4b71-8c56-88dcb61b9f09,cache=none,werror=stop,rerror=stop,aio=n
ative: could not open disk image
/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/cae1bb2d-0529-4287-95a3-13dcb14f082f:
Operation not permitted




___
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel



can you share your hook?
(if it works without your hook, i suspect a bug there)
___
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel


Re: [vdsm] start vm which in pool failed

2013-09-18 Thread Dan Kenigsberg
On Wed, Sep 18, 2013 at 01:03:08PM +0800, bigclouds wrote:
 when starting a vm of a pool  fails.in the process of hooks, i modify 
 guestvm hostname, and modify the path of backing file of chain.  do nothing 
 else. 
 i can munually define a xml(after hooks), and start it without error.

Could you compare (or share) the manual domxml and the one produced by
your hook? It might be easier to spot the bug that way.

  
  
 env:
 libvirt-0.10.2-18.el6_4.5.x86_64
 2.6.32-358.6.2.el6.x86_64
 centos6.4
  
  
 1.where does this error message come from ?
 Storage.StorageDomain WARNING Could not find mapping for lv 
 d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/cae1bb2d-0529-4287-95a3-13dcb14f082f
  
 2.
 Thread-6291::ERROR::2013-09-18 
 12:44:21,205::vm::683::vm.Vm::(_startUnderlyingVm) 
 vmId=`24f7e975-9aa5-4a14-b0f0-590add14c8b5`::The vm start process failed
 Traceback (most recent call last):
   File /usr/share/vdsm/vm.py, line 645, in _startUnderlyingVm
 self._run()
   File /usr/share/vdsm/libvirtvm.py, line 1529, in _run
 self._connection.createXML(domxml, flags),
   File /usr/lib64/python2.6/site-packages/vdsm/libvirtconnection.py, line 
 83, in wrapper
 ret = f(*args, **kwargs)
   File /usr/lib64/python2.6/site-packages/libvirt.py, line 2645, in 
 createXML
 if ret is None:raise libvirtError('virDomainCreateXML() failed', 
 conn=self)
 libvirtError: internal error Process exited while reading console log output: 
 char device redirected to /dev/pts/4
 qemu-kvm: -drive 
 file=/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/cae1bb2d-0529-4287-95a3-13dcb14f082f,if=none,id=drive-ide0-0-0,format=qcow2,serial=ac025dc1-4e25-4b71-8c56-88dcb61b9f09,cache=none,werror=stop,rerror=stop,aio=native:
  could not open disk image 
 /rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/cae1bb2d-0529-4287-95a3-13dcb14f082f:
  Operation not permitted

 ___
 vdsm-devel mailing list
 vdsm-devel@lists.fedorahosted.org
 https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel

___
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel


[vdsm] start vm which in pool failed

2013-09-17 Thread bigclouds
when starting a vm of a pool  fails.in the process of hooks, i modify 
guestvm hostname, and modify the path of backing file of chain.  do nothing 
else. 
i can munually define a xml(after hooks), and start it without error.
 
 
env:
libvirt-0.10.2-18.el6_4.5.x86_64
2.6.32-358.6.2.el6.x86_64
centos6.4
 
 
1.where does this error message come from ?
Storage.StorageDomain WARNING Could not find mapping for lv 
d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/cae1bb2d-0529-4287-95a3-13dcb14f082f
 
2.
Thread-6291::ERROR::2013-09-18 
12:44:21,205::vm::683::vm.Vm::(_startUnderlyingVm) 
vmId=`24f7e975-9aa5-4a14-b0f0-590add14c8b5`::The vm start process failed
Traceback (most recent call last):
  File /usr/share/vdsm/vm.py, line 645, in _startUnderlyingVm
self._run()
  File /usr/share/vdsm/libvirtvm.py, line 1529, in _run
self._connection.createXML(domxml, flags),
  File /usr/lib64/python2.6/site-packages/vdsm/libvirtconnection.py, line 83, 
in wrapper
ret = f(*args, **kwargs)
  File /usr/lib64/python2.6/site-packages/libvirt.py, line 2645, in createXML
if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirtError: internal error Process exited while reading console log output: 
char device redirected to /dev/pts/4
qemu-kvm: -drive 
file=/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/cae1bb2d-0529-4287-95a3-13dcb14f082f,if=none,id=drive-ide0-0-0,format=qcow2,serial=ac025dc1-4e25-4b71-8c56-88dcb61b9f09,cache=none,werror=stop,rerror=stop,aio=native:
 could not open disk image 
/rhev/data-center/7828f2ae-955e-4e4b-a4bb-43807629dc52/d028d521-d4a9-4dd7-a0fe-3e9b60e7c4e4/images/ac025dc1-4e25-4b71-8c56-88dcb61b9f09/cae1bb2d-0529-4287-95a3-13dcb14f082f:
 Operation not permitted___
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel