[libvirt] Unable to get libvirt working with KVM using direct kernel boot.
by Tiit Kaeeli
Hi,
I am trying to get libvirt to manage a KVM virtual machine on Debian
squeeze with multiple relevant parts included form unstable (because of
need for gpt partition tables, Intel 82576 nic etc).
Unfortunately the VM does not seem to boot. I will see a
quemu prompt on /dev/pts/1. (Tried pressing c on it, but no difference).
Nothing will appear on /dev/pts/2, /dev/pts/3 or when I type
virsh console vm1_storage.
If I grab the kvm command line generated by libvirt using ps and run it
manually, it works fine. (Starts booting after I press c on /dev/pts/1
or remove the -S option from the command line)
Libvirt configuration file:
<domain type='kvm'>
<name>vm1_storage</name>
<uuid>29bfac01-b24d-e4ab-e741-f33f7e880d9d</uuid>
<memory>4096000</memory>
<currentMemory>4096000</currentMemory>
<vcpu>6</vcpu>
<os>
<type>hvm</type>
<kernel>/boot/vmlinuz-2.6.30-1-amd64</kernel>
<initrd>/boot/initrd.img-2.6.30-1-amd64</initrd>
<cmdline>"root=UUID=98d6d3d7-3782-4f6b-a94f-bc0272c0289d ro
console=tty0 console=ttyS0,115200n8"</cmdline>
</os>
<features>
<acpi/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='block' device='disk'>
<source dev='/dev/vm_lvm/vm01_storage_root'/>
<target dev='vda' bus='virtio'/>
</disk>
<interface type='ethernet'>
<mac address='52:54:00:12:34:56'/>
<target dev='tap0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
</devices>
</domain>
KVM command line that I see in ps after running
virsh define /etc/libvirt/qemu/vm1_storage.xml
virsh start vm1_storage
(Works fine after I remove the -S option or press 'c' on quemu monitor on
/dev/pts/1):
/usr/bin/kvm -S -M pc -m 4000 -smp 6 -name vm1_storage -uuid
29bfac01-b24d-e4ab-e741-f33f7e880d9d -nographic -monitor pty -boot
c -kernel /boot/vmlinuz-2.6.30-1-amd64 -initrd
/boot/initrd.img-2.6.30-1-amd64 -append
"root=UUID=98d6d3d7-3782-4f6b-a94f-bc0272c0289d ro console=tty0
console=ttyS0,115200n8" -drive
file=/dev/vm_lvm/vm01_storage_root,if=virtio,index=0,boot=on -net
nic,macaddr=52:54:00:12:34:56,vlan=0 -net tap,ifname=tap0,vlan=0 -serial
pty -parallel none -usb
/var/log/libvirt/qemu/vm1_storage.log shows:
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/ /usr/bin/kvm -S -M pc -m 4000 -smp 6 -name vm1_storage -uuid
29bfac01-b24d-e4ab-e741-f33f7e880d9d -nographic -monitor pty -boot c
-kernel /boot/vmlinuz-2.6.30-1-amd64 -initrd
/boot/initrd.img-2.6.30-1-amd64 -append
"root=UUID=98d6d3d7-3782-4f6b-a94f-bc0272c0289d ro console=tty0
console=ttyS0,115200n8" -drive
file=/dev/vm_lvm/vm01_storage_root,if=virtio,index=0,boot=on -net
nic,macaddr=52:54:00:12:34:56,vlan=0 -net tap,ifname=tap0,vlan=0 -serial
pty -parallel none -usb
char device redirected to /dev/pts/1
char device redirected to /dev/pts/2
qemu: loading initrd (0x76055b bytes) at 0x000000007f89f000
Versions in use:
kvm 85+dfsg-4
libvirt0 0.6.5-2
libvirt-bin 0.6.5-2
linux-image-2.6.30-1-amd64
Thanks for any ideas.
15 years, 4 months
Re: [libvirt] VMware support and libcurl on rhel-u1
by Shahar Klein
I'll try with 7.15
can I test with ESX4i?
Shahar
________________________________
From: Matthias Bolte <matthias.bolte(a)googlemail.com>
To: Shahar Klein <shaharklein(a)yahoo.com>
Sent: Sunday, July 26, 2009 5:56:18 PM
Subject: Re: [libvirt] VMware support and libcurl on rhel-u1
2009/7/26 Shahar Klein <shaharklein(a)yahoo.com>:
> It doesn't because I built libcurl on a different path (/usr/local/lib)
> So I won't damage other stuff on this box.
> I thought that this is what the LIBCURL_LIBS and LIBCURL_CFLAGS env vars are
> for.
No, but installing in the /usr/local prefix should also work with
pkg-config. The .pc for libcurl should be located at
/usr/local/lib/pkgconfig/libcurl.pc and pkg-config should find it.
Maybe you have to set PKG_CONFIG_PATH in order to have pkg-config pick
it up.
Check the output of:
pkg-config libcurl --modversion
It should output 7.18 or what ever your version is, if installed correctly.
> btw - Do I really need libcurl 7.18? trying to install it pushing me into
> the depnendncy hell:
[...]
Hm... I just looked at the changelist of libcurl and something older
like version 7.15 may also work, but I haven't tested it. You could
give it a try and edit the configure.in file and change 7.18 to 7.15
and see if that works out.
Regards,
Matthias
15 years, 4 months
[libvirt] [PATCH] Power Hypervisor support
by Eduardo Otubo
Hello everyone,
This should be the official patch for the libvrt-0.7.0 release. Here
I'll comment all the features already implemented and the roadmap we
have ahead:
Features supported:
* Connects to HMC/VIOS or IVM systems.
* Life cycle commands (resume and shutdown).
* dumpxml
* 'list' and 'list --all'
What is being implemented:
* better and centralized control for UUID
* definexml
* CPU management commands
Any comment are always welcome.
[]'s
--
Eduardo Otubo
Software Engineer
Linux Technology Center
IBM Systems & Technology Group
Mobile: +55 19 8135 0885
otubo(a)linux.vnet.ibm.com
15 years, 4 months
[libvirt] [PATCH] test: Implement BlockStats and InterfaceStats
by Cole Robinson
We fake stats values based on the current time, similar to how it's done
for cpu time.
---
src/test.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 114 insertions(+), 2 deletions(-)
diff --git a/src/test.c b/src/test.c
index f02b58b..6db3825 100644
--- a/src/test.c
+++ b/src/test.c
@@ -2093,6 +2093,118 @@ cleanup:
return ret;
}
+static int testDomainBlockStats(virDomainPtr domain,
+ const char *path,
+ struct _virDomainBlockStats *stats)
+{
+ testConnPtr privconn = domain->conn->privateData;
+ virDomainObjPtr privdom;
+ struct timeval tv;
+ unsigned long long statbase;
+ int i, found = 0, ret = -1;
+
+ testDriverLock(privconn);
+ privdom = virDomainFindByName(&privconn->domains,
+ domain->name);
+ testDriverUnlock(privconn);
+
+ if (privdom == NULL) {
+ testError(domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+ goto error;
+ }
+
+ for (i = 0 ; i < privdom->def->ndisks ; i++) {
+ if (STREQ(path, privdom->def->disks[i]->dst)) {
+ found = 1;
+ break;
+ }
+ }
+
+ if (!found) {
+ testError(domain->conn, VIR_ERR_INVALID_ARG,
+ _("invalid path: %s"), path);
+ goto error;
+ }
+
+ if (gettimeofday(&tv, NULL) < 0) {
+ virReportSystemError(domain->conn, errno,
+ "%s", _("getting time of day"));
+ goto error;
+ }
+
+ /* No significance to these numbers, just enough to mix it up*/
+ statbase = (tv.tv_sec * 1000UL * 1000UL) + tv.tv_usec;
+ stats->rd_req = statbase / 10;
+ stats->rd_bytes = statbase / 20;
+ stats->wr_req = statbase / 30;
+ stats->wr_bytes = statbase / 40;
+ stats->errs = tv.tv_sec / 2;
+
+ ret = 0;
+error:
+ if (privdom)
+ virDomainObjUnlock(privdom);
+ return ret;
+}
+
+static int testDomainInterfaceStats(virDomainPtr domain,
+ const char *path,
+ struct _virDomainInterfaceStats *stats)
+{
+ testConnPtr privconn = domain->conn->privateData;
+ virDomainObjPtr privdom;
+ struct timeval tv;
+ unsigned long long statbase;
+ int i, found = 0, ret = -1;
+
+ testDriverLock(privconn);
+ privdom = virDomainFindByName(&privconn->domains,
+ domain->name);
+ testDriverUnlock(privconn);
+
+ if (privdom == NULL) {
+ testError(domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+ goto error;
+ }
+
+ for (i = 0 ; i < privdom->def->nnets ; i++) {
+ if (privdom->def->nets[i]->ifname &&
+ STREQ (privdom->def->nets[i]->ifname, path)) {
+ ret = 0;
+ break;
+ }
+ }
+
+ if (!found) {
+ testError(domain->conn, VIR_ERR_INVALID_ARG,
+ _("invalid path, '%s' is not a known interface"), path);
+ goto error;
+ }
+
+ if (gettimeofday(&tv, NULL) < 0) {
+ virReportSystemError(domain->conn, errno,
+ "%s", _("getting time of day"));
+ goto error;
+ }
+
+ /* No significance to these numbers, just enough to mix it up*/
+ statbase = (tv.tv_sec * 1000UL * 1000UL) + tv.tv_usec;
+ stats->rx_bytes = statbase / 10;
+ stats->rx_packets = statbase / 100;
+ stats->rx_errs = tv.tv_sec / 1;
+ stats->rx_drop = tv.tv_sec / 2;
+ stats->tx_bytes = statbase / 20;
+ stats->tx_packets = statbase / 110;
+ stats->tx_errs = tv.tv_sec / 3;
+ stats->tx_drop = tv.tv_sec / 4;
+
+ ret = 0;
+error:
+ if (privdom)
+ virDomainObjUnlock(privdom);
+ return ret;
+}
+
static virDrvOpenStatus testOpenNetwork(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED) {
@@ -4117,8 +4229,8 @@ static virDriver testDriver = {
NULL, /* domainMigratePrepare */
NULL, /* domainMigratePerform */
NULL, /* domainMigrateFinish */
- NULL, /* domainBlockStats */
- NULL, /* domainInterfaceStats */
+ testDomainBlockStats, /* domainBlockStats */
+ testDomainInterfaceStats, /* domainInterfaceStats */
NULL, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
testNodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
--
1.6.0.6
15 years, 4 months
[libvirt] VMware support and libcurl on rhel-u1
by Shahar Klein
I'm trying to play with the new ESX driver on a rhel5-u1 x86_64
but I get this:
checking for libcurl libraries >= 7.18.0... configure: error: libcurl >= 7.18.0 is required for the ESX driver
according to http://curl.haxx.se/download.html
there is no rpm for rhel x86_64
so I built it and tried:
export LIBCURL_LIBS="-L/usr/local/lib -lcurl -L/usr/kerberos/lib64"
export LIBCURL_CFLAGS="-I/usr/local/include"
but configure didn't care about it
am I doing something wrong here?
tnx
Shahar Klein
15 years, 4 months
[libvirt] How to get access to QEMU monitor?
by Jun Koi
Hi,
I am running QEMU via libvirt (using virsh & virt-manager). Now I want
to get access to the monitor interface of QEMU, so I can issue some
commands to monitor. Is there anyway to do that?
Thanks,
J
15 years, 4 months
[libvirt] VMware ESX driver progress
by Matthias Bolte
Hi,
the development was hindered by our testing cluster being offline
since 2 weeks due to server room cooling system maintenance. But I
finally got a basic version of dump-XML done, that fills all fields of
the virDomainDef that the VMX file contains data for.
Changes since first announcement:
- Move code into esx subdirectory
- Add esxNodeGetInfo()
- Fix esxDomainGetInfo() to report the correct value for memory
- Add memory and max-memory getter/setters
- Add CPU scheduler getter/setters
- Validate a migration before trying to perform it
- Replace esxUtil_Strdup() with strdup() and remove
esxUtil_MigrateStringFromLibXML()
- Add esxVI_EnsureSession() to handle expiring sessions
- Separate VI client code into multiple files and generate most of the
type handling code with macros
- Add esxDomainDumpXML() based on esxVMX_ParseConfig()
The ESX driver isn't complete yet, currently it supports:
- domain lookup by ID, UUID and name
- domain listing
- domain info retrieval
- domain suspend and resume
- domain start and destroy
- domain reboot and shutdown, if the VMware tools are installed inside
the domain
- domain migration with previous validation
- domain memory configuration
- domain CPU amount and scheduler configuration
- domain XML-dump
- domain XML-from-native (VMX)
- node info retrieval
- node hostname retrieval
The next milestone is creating/defining a new domain from a domain XML
config, but this will not be finished until feature freeze for 0.7.0
on friday.
Regards,
Matthias
15 years, 4 months
[libvirt] [PATCH 1/1] Support for Callbacks and VirtualBox Version 3.
by Pritesh Kothari
Hi All,
I have added support for callbacks and VirtualBox version 3.
I have attached the patch for the same, it is made against the head as of
today.
To check if the callbacks work you can run the example from examples/domain-
events/events-c directory and then start a domain to see if you get any
callback events.
Regards,
Pritesh
15 years, 4 months