> From: libvirt-users-request@redhat.com
> Subject: libvirt-users Digest, Vol 40, Issue 26
> To: libvirt-users@redhat.com
> Date: Thu, 11 Apr 2013 07:34:17 -0400
>
> Send libvirt-users mailing list submissions to
> libvirt-users@redhat.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://www.redhat.com/mailman/listinfo/libvirt-users
> or, via email, send a message with subject or body 'help' to
> libvirt-users-request@redhat.com
>
> You can reach the person managing the list at
> libvirt-users-owner@redhat.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of libvirt-users digest..."
>
>
> Today's Topics:
>
> 1. How can I open a libvirt remote connection with ssh
> (Wangkai (Kevin,C))
> 2. Re: How can I open a libvirt remote connection with ssh
> (Daniel P. Berrange)
> 3. Re: How can I open a libvirt remote connection with ssh
> (Wangkai (Kevin,C))
> 4. Re: How can I open a libvirt remote connection with ssh
> (Henrik Ahlgren)
> 5. Re: reboot command lost? (Michal Privoznik)
> 6. Re: virt-install on powerpc64 issues (Martin Kletzander)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 11 Apr 2013 09:45:18 +0000
> From: "Wangkai (Kevin,C)" <wangkai86@huawei.com>
> To: "libvirt-users@redhat.com" <libvirt-users@redhat.com>
> Subject: [libvirt-users] How can I open a libvirt remote connection
> with ssh
> Message-ID:
> <87B246BB5ED53A4C98E4F9A35839EDE128F1136D@nkgeml506-mbs.china.huawei.com>
>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
>
> When I use 'virConnectOpenAuth' function to connect to '192.168.1.102' libvirtd with ssh,
> Code below, the screen print the dialog "root@192.168.1.102's password:" , and only
> After I type the password, the connection can be created.
>
> How can I connect to libvirtd with ssh automatically? No need to type the password manually.
>
> char *au[2] = {"root", "xxxx"};
> virConnectAuth auth = {
> credTypes,
> sizeof(credTypes) / sizeof(int),
> virConnCb,/* callback function, actually was not be called after connect*/
> au /* user and password */
> };
> conn = virConnectOpenAuth("qemu+ssh://192.168.1.102/system", &auth, 0);
>
>
> Thanks,
> Kevin
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://www.redhat.com/archives/libvirt-users/attachments/20130411/10a9246b/attachment.html>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 11 Apr 2013 10:54:36 +0100
> From: "Daniel P. Berrange" <berrange@redhat.com>
> To: "Wangkai (Kevin,C)" <wangkai86@huawei.com>
> Cc: "libvirt-users@redhat.com" <libvirt-users@redhat.com>
> Subject: Re: [libvirt-users] How can I open a libvirt remote
> connection with ssh
> Message-ID: <20130411095436.GF29791@redhat.com>
> Content-Type: text/plain; charset=utf-8
>
> On Thu, Apr 11, 2013 at 09:45:18AM +0000, Wangkai (Kevin,C) wrote:
> > Hi,
> >
> > When I use 'virConnectOpenAuth' function to connect to '192.168.1.102' libvirtd with ssh,
> > Code below, the screen print the dialog "root@192.168.1.102's password:" , and only
> > After I type the password, the connection can be created.
>
> Libvirt has to spawn an external SSH process for +ssh URIs, so we can't hook
> it up into our auth callbacks.
>
> > How can I connect to libvirtd with ssh automatically? No need to type the password manually.
>
> You need to setup SSH public keys + SSH agent
>
> >
> > char *au[2] = {"root", "xxxx"};
> > virConnectAuth auth = {
> > credTypes,
> > sizeof(credTypes) / sizeof(int),
> > virConnCb,/* callback function, actually was not be called after connect*/
> > au /* user and password */
> > };
> > conn = virConnectOpenAuth("qemu+ssh://192.168.1.102/system", &auth, 0);
>
> virConnectOpenAuth() doesn't do anything useful for '+ssh' URIs.
>
> There is however a alternative 'libssh2' URI that does use the
> callbacks. eg qemu+libssh2://hostname/system
>
> This is less tested & potentially buggy, but it might be ok for your needs
>
> Regards,
> Daniel
> --
> |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org -o- http://virt-manager.org :|
> |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 11 Apr 2013 09:59:46 +0000
> From: "Wangkai (Kevin,C)" <wangkai86@huawei.com>
> To: "Daniel P. Berrange" <berrange@redhat.com>
> Cc: "libvirt-users@redhat.com" <libvirt-users@redhat.com>
> Subject: Re: [libvirt-users] How can I open a libvirt remote
> connection with ssh
> Message-ID:
> <87B246BB5ED53A4C98E4F9A35839EDE128F11384@nkgeml506-mbs.china.huawei.com>
>
> Content-Type: text/plain; charset="utf-8"
>
>
>
> > -----Original Message-----
> > From: Daniel P. Berrange [mailto:berrange@redhat.com]
> > Sent: Thursday, April 11, 2013 5:55 PM
> > To: Wangkai (Kevin,C)
> > Cc: libvirt-users@redhat.com
> > Subject: Re: [libvirt-users] How can I open a libvirt remote connection
> > with ssh
> >
> > On Thu, Apr 11, 2013 at 09:45:18AM +0000, Wangkai (Kevin,C) wrote:
> > > Hi,
> > >
> > > When I use 'virConnectOpenAuth' function to connect to
> > '192.168.1.102' libvirtd with ssh,
> > > Code below, the screen print the dialog "root@192.168.1.102's
> > password:" , and only
> > > After I type the password, the connection can be created.
> >
> > Libvirt has to spawn an external SSH process for +ssh URIs, so we can't
> > hook
> > it up into our auth callbacks.
>
> [Wangkai (Kevin,C)]
> Which type of URI can be hooked by auth callback? Qemu+tls?
>
> >
> > > How can I connect to libvirtd with ssh automatically? No need to type
> > the password manually.
> >
> > You need to setup SSH public keys + SSH agent
> [Wangkai (Kevin,C)]
> Maybe I will try this later.
>
> >
> > >
> > > char *au[2] = {"root", "xxxx"};
> > > virConnectAuth auth = {
> > > credTypes,
> > > sizeof(credTypes) / sizeof(int),
> > > virConnCb,/* callback function, actually was not be
> > called after connect*/
> > > au /* user and password */
> > > };
> > > conn = virConnectOpenAuth("qemu+ssh://192.168.1.102/system", &auth,
> > 0);
> >
> > virConnectOpenAuth() doesn't do anything useful for '+ssh' URIs.
> >
> > There is however a alternative 'libssh2' URI that does use the
> > callbacks. eg qemu+libssh2://hostname/system
> >
> > This is less tested & potentially buggy, but it might be ok for your
> > needs
> >
> > Regards,
> > Daniel
> > --
> > |: http://berrange.com -o-
> > http://www.flickr.com/photos/dberrange/ :|
> > |: http://libvirt.org -o- http://virt-
> > manager.org :|
> > |: http://autobuild.org -o-
> > http://search.cpan.org/~danberr/ :|
> > |: http://entangle-photo.org -o- http://live.gnome.org/gtk-
> > vnc :|
>
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 11 Apr 2013 13:01:45 +0300
> From: Henrik Ahlgren <pablo@seestieto.com>
> To: "Wangkai (Kevin,C)" <wangkai86@huawei.com>
> Cc: "libvirt-users@redhat.com" <libvirt-users@redhat.com>
> Subject: Re: [libvirt-users] How can I open a libvirt remote
> connection with ssh
> Message-ID: <20130411100144.GL17558@seestieto.com>
> Content-Type: text/plain; charset=us-ascii
>
> On Thu, Apr 11, 2013 at 09:45:18AM +0000, Wangkai (Kevin,C) wrote:
> >
> > How can I connect to libvirtd with ssh automatically? No need to type the password manually.
>
> Just use SSH public key authentication with an empty passphrase, just
> as you would with any other automated SSH connection.
>
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 11 Apr 2013 13:06:06 +0200
> From: Michal Privoznik <mprivozn@redhat.com>
> To: ??? <dhc3@hotmail.com>
> Cc: "libvirt-users@redhat.com" <libvirt-users@redhat.com>
> Subject: Re: [libvirt-users] reboot command lost?
> Message-ID: <5166991E.1020300@redhat.com>
> Content-Type: text/plain; charset=UTF-8
>
> On 11.04.2013 10:04, ??? wrote:
> > when i send a reboot command to libvirtd to reboot a domain, it does not
> > receive and print the following warn:
> >
> > 2013-04-10 06:01:39.080+0000: 2908: warning : qemuDomainObjTaint:1311 :
> > Domain id=56 name='69751ca7-3198-4f3c-8265-cb8cb70ad750'
> > uuid=69751ca7-3198-4f3c-8265-cb8cb70ad750 is tainted: high-privileges
> >
>
> with reboot you may choose what mode do you want to use:
> 'acpi', 'agent', 'initctl' or 'signal'
>
> By default, ACPI is used, meaning an ACPI event is send to the guest.
> However, when there is no acpid running, this event is silently ignored.
> So you have two options:
>
> 1) install acpid into the guest
>
> 2) use a different method.
>
> Michal
>
>
>
> ------------------------------
>
> Message: 6
> Date: Thu, 11 Apr 2013 13:34:13 +0200
> From: Martin Kletzander <mkletzan@redhat.com>
> To: Alexey Kardashevskiy <aik@ozlabs.ru>
> Cc: libvirt-users@redhat.com
> Subject: Re: [libvirt-users] virt-install on powerpc64 issues
> Message-ID: <51669FB5.4030600@redhat.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On 04/10/2013 07:15 AM, Alexey Kardashevskiy wrote:
> > Hi!
> >
> > I am trying to setup a guest using virt-install script:
> >
> > /usr/bin/virt-install -n fc18guest5 -r 1024 \
> > --disk path=/home/aik/virtimg/fc18guest,size=8 \
> > -c /home/aik/virtimg/Fedora-18-ppc64-DVD.iso \
> > --video vga --arch=ppc64 -d --machine=pseries
> >
> > And it fails. I could not find any relevant log in /var/log/libvirt/ so
>
> It should be stored in '/var/log/libvirt/qemu/fc18guest5.log'. If
> there's nothing related, look for errors in '/var/log/libvirt/libvirtd.log'.
>
> > I simply hacked /usr/local/bin/qemu-system-ppc64 to print all the
> > parameters passed into it. So I got the command line (below, after the
> > second question) where the "-device scsi-cd" parameter is cut in a
> > middle so QEMU fails to start. 788 chars long - is there a limit?
> >
>
> I don't think it has anything to do with the fact that there is a
> newline between '-device' and 'scsi-cd'. That's just debug output of
> virt-install.
>
> > The second question is - where does virt-install store those xmls? I
> > have to choose a new name for a machine even if virt-install failed, in
> > the example it is "fc18guest5" (5 at the end). "virsh -c qemu:///system
> > list" prints an empty list with no domains.
> >
>
> Command 'virsh list' (by default) lists only running domains, try adding
> '--all' as a parameter.
>
>
>
> > Thanks!
> >
> >
> >
> >
> > /usr/local/bin/qemu-system-ppc64 -name fc18guest5 -S -M pseries
> > -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -uuid
> > 71f8b17f-ca48-80fe-db58-4d933c66fe2d -no-user-config -nodefaults
> > -chardev
> > socket,id=charmonitor,path=/home/aik/.config/libvirt/qemu/lib/fc18guest5.monitor,server,nowait
> > -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
> > -no-reboot -no-shutdown -device pci-ohci,id=usb,bus=pci,addr=0x1.0x2
> > -device spapr-vscsi,id=scsi0,reg=0x2000 -drive
> > file=/home/aik/virtimg/fc18guest,if=none,id=drive-scsi0-0-0-0,format=raw
> > -device
> > scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2
> > -drive
> > file=/home/aik/virtimg/Fedora-18-ppc64-DVD.iso,if=none,id=drive-scsi0-0-0-1,readonly=on,format=raw
> > -device scsi-cd,bus=scsi0.0,ch
> >
> >
> >
> > The full log is here:
> >
> >
> > [aik@vpl2 ~]$ ./start_installation.sh
> > ++ /usr/bin/virt-install -n fc18guest5 -r 1024 --disk
> > path=/home/aik/virtimg/fc18guest,size=8 -c
> > /home/aik/virtimg/Fedora-18-ppc64-DVD.iso --video vga --arch=ppc64 -d
> > --machine=pseries
> > [Wed, 10 Apr 2013 15:06:10 virt-install 9880] DEBUG (cli:221) Launched
> > with command line:
> > /usr/bin/virt-install -n fc18guest5 -r 1024 --disk
> > path=/home/aik/virtimg/fc18guest,size=8 -c
> > /home/aik/virtimg/Fedora-18-ppc64-DVD.iso --video vga --arch=ppc64 -d
> > --machine=pseries
> > [Wed, 10 Apr 2013 15:06:10 virt-install 9880] DEBUG (cli:326) Requesting
> > libvirt URI default
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (cli:328) Received
> > libvirt URI qemu:///session
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (virt-install:259)
> > Requesting virt method 'default', hv type 'default'.
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (virt-install:469)
> > Received virt method 'hvm'
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (virt-install:470)
> > Hypervisor name is 'kvm'
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (cli:935) DISPLAY is
> > set: graphics defaulting to VNC.
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (cli:953) --graphics
> > compat generated: vnc
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG
> > (DistroInstaller:209) DistroInstaller location is a local file/path:
> > /home/aik/virtimg/Fedora-18-ppc64-DVD.iso
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (virt-install:626)
> > Guest.has_install_phase: True
> >
> > Starting install...
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (Guest:1296)
> > Generated install XML:
> > <domain type='kvm'>
> > <name>fc18guest5</name>
> > <uuid>56b64ac6-9596-6e8e-5321-4fc583960065</uuid>
> > <memory>1048576</memory>
> > <currentMemory>1048576</currentMemory>
> > <vcpu>1</vcpu>
> > <os>
> > <type arch='ppc64' machine='pseries'>hvm</type>
> > <boot dev='cdrom'/>
> > <boot dev='hd'/>
> > </os>
> > <features>
> > <acpi/><apic/><pae/>
> > </features>
> > <clock offset="utc"/>
> > <on_poweroff>destroy</on_poweroff>
> > <on_reboot>destroy</on_reboot>
> > <on_crash>destroy</on_crash>
> > <devices>
> > <emulator>/usr/local/bin/qemu-system-ppc64</emulator>
> > <disk type='file' device='disk'>
> > <driver name='qemu'/>
> > <source file='/home/aik/virtimg/fc18guest'/>
> > <target dev='sda' bus='scsi'/>
> > </disk>
> > <disk type='file' device='cdrom'>
> > <driver name='qemu'/>
> > <source file='/home/aik/virtimg/Fedora-18-ppc64-DVD.iso'/>
> > <target dev='sdb' bus='scsi'/>
> > <readonly/>
> > </disk>
> > <interface type='user'>
> > <mac address='52:54:00:ca:ed:7a'/>
> > </interface>
> > <input type='mouse' bus='ps2'/>
> > <graphics type='vnc' port='-1'/>
> > <console type='pty'/>
> > <video>
> > <model type='vga'/>
> > </video>
> > </devices>
> > </domain>
> >
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (Guest:1297)
> > Generated boot XML:
> > <domain type='kvm'>
> > <name>fc18guest5</name>
> > <uuid>56b64ac6-9596-6e8e-5321-4fc583960065</uuid>
> > <memory>1048576</memory>
> > <currentMemory>1048576</currentMemory>
> > <vcpu>1</vcpu>
> > <os>
> > <type arch='ppc64' machine='pseries'>hvm</type>
> > <boot dev='hd'/>
> > </os>
> > <features>
> > <acpi/><apic/><pae/>
> > </features>
> > <clock offset="utc"/>
> > <on_poweroff>destroy</on_poweroff>
> > <on_reboot>restart</on_reboot>
> > <on_crash>restart</on_crash>
> > <devices>
> > <emulator>/usr/local/bin/qemu-system-ppc64</emulator>
> > <disk type='file' device='disk'>
> > <driver name='qemu'/>
> > <source file='/home/aik/virtimg/fc18guest'/>
> > <target dev='sda' bus='scsi'/>
> > </disk>
> > <disk type='block' device='cdrom'>
> > <target dev='sdb' bus='scsi'/>
> > <readonly/>
> > </disk>
> > <interface type='user'>
> > <mac address='52:54:00:ca:ed:7a'/>
> > </interface>
> > <input type='mouse' bus='ps2'/>
> > <graphics type='vnc' port='-1'/>
> > <console type='pty'/>
> > <video>
> > <model type='vga'/>
> > </video>
> > </devices>
> > </domain>
> >
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] ERROR (cli:439) internal
> > error process exited while connecting to monitor: char device redirected
> > to /dev/pts/4 (label charserial0)
> >
> >
> >
> > [0]/usr/local/bin/qemu-system-ppc64 [1]-name [2]fc18guest5 [3]-S [4]-M
> > [5]pseries [6]-enable-kvm [7]-m [8]1024 [9]-smp
> > [10]1,sockets=1,cores=1,threads=1 [11]-uuid
> > [12]56b64ac6-9596-6e8e-5321-4fc583960065 [13]-no-user-config
> > [14]-nodefaults [15]-chardev
> > [16]socket,id=charmonitor,path=/home/aik/.config/libvirt/qemu/lib/fc18guest5.monitor,server,nowait
> > [17]-mon [18]chardev=charmonitor,id=monitor,mode=control [19]-rtc
> > [20]base=utc [21]-no-reboot [22]-no-shutdown [23]-device
> > [24]pci-ohci,id=usb,bus=pci,addr=0x1.0x2 [25]-device
> > [26]spapr-vscsi,id=scsi0,reg=0x2000 [27]-drive
> > [28]file=/home/aik/virtimg/fc18guest,if=none,id=drive-scsi0-0-0-0,format=raw
> > [29]-device
> > [30]scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2
> > [31]-drive
> > [32]file=/home/aik/virtimg/Fedora-18-ppc64-DVD.iso,if=none,id=drive-scsi0-0-0-1,readonly=on,format=raw
> > [33]-device [34]scsi-cd,bus=scsi0.0,ch
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (cli:442)
> > Traceback (most recent call last):
> > File "/usr/bin/virt-install", line 636, in start_install
> > noboot=options.noreboot)
> > File "/usr/lib/python2.7/site-packages/virtinst/Guest.py", line 1249,
> > in start_install
> > noboot)
> > File "/usr/lib/python2.7/site-packages/virtinst/Guest.py", line 1317,
> > in _create_guest
> > dom = self.conn.createLinux(start_xml or final_xml, 0)
> > File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2775, in
> > createLinux
> > if ret is None:raise libvirtError('virDomainCreateLinux() failed',
> > conn=self)
> > libvirtError: internal error process exited while connecting to monitor:
> > char device redirected to /dev/pts/4 (label charserial0)
> >
> >
> >
> > [0]/usr/local/bin/qemu-system-ppc64 [1]-name [2]fc18guest5 [3]-S [4]-M
> > [5]pseries [6]-enable-kvm [7]-m [8]1024 [9]-smp
> > [10]1,sockets=1,cores=1,threads=1 [11]-uuid
> > [12]56b64ac6-9596-6e8e-5321-4fc583960065 [13]-no-user-config
> > [14]-nodefaults [15]-chardev
> > [16]socket,id=charmonitor,path=/home/aik/.config/libvirt/qemu/lib/fc18guest5.monitor,server,nowait
> > [17]-mon [18]chardev=charmonitor,id=monitor,mode=control [19]-rtc
> > [20]base=utc [21]-no-reboot [22]-no-shutdown [23]-device
> > [24]pci-ohci,id=usb,bus=pci,addr=0x1.0x2 [25]-device
> > [26]spapr-vscsi,id=scsi0,reg=0x2000 [27]-drive
> > [28]file=/home/aik/virtimg/fc18guest,if=none,id=drive-scsi0-0-0-0,format=raw
> > [29]-device
> > [30]scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2
> > [31]-drive
> > [32]file=/home/aik/virtimg/Fedora-18-ppc64-DVD.iso,if=none,id=drive-scsi0-0-0-1,readonly=on,format=raw
> > [33]-device [34]scsi-cd,bus=scsi0.0,ch
> > [Wed, 10 Apr 2013 15:06:12 virt-install 9880] DEBUG (cli:451) Domain
> > installation does not appear to have been successful.
> > If it was, you can restart your domain by running:
> > virsh --connect qemu:///session start fc18guest5
> > otherwise, please restart your installation.
> > Domain installation does not appear to have been successful.
> > If it was, you can restart your domain by running:
> > virsh --connect qemu:///session start fc18guest5
> > otherwise, please restart your installation.
> >
> > [aik@vpl2 ~]$ virsh -c qemu:///system list
> > Id Name State
> > ----------------------------------------------------
> >
> > [aik@vpl2 ~]$
> >
> >
>
>
>
> ------------------------------
>
> _______________________________________________
> libvirt-users mailing list
> libvirt-users@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
>
> End of libvirt-users Digest, Vol 40, Issue 26
> *********************************************