Re: [libvirt-users] Suggestions on building VM disks from scratch
by Richard W.M. Jones
> Then I created my blank 'disk' file and tried to
> run virt-rescue on it. It crashed out with an
> error from febootstrap.
First of all, debug this properly:
(1) What is the full error message?
(2) What is the complete, unedited output of 'libguestfs-test-tool'?
(3) What version of libguestfs & febootstrap are using and where did
you get them from?
You can post the details on our mailing list libguestfs(a)redhat.com
(no need to subscribe if you don't want to).
> After finding nothing terribly
> useful or current on this in searching, I tried
> guestfish instead. After some fiddling I got it
> to attach my blank disk. However I cannot find a
> reasonable way to partition it with the part-add which
> seems to want me to count sectors. All I want is
> a 9G linux and a 2G swap.
Assuming the filesystem was in /tmp/root.tar.gz, the following code
will do this:
guestfish <<EOF
sparse /tmp/test.img 11G
run
part-init /dev/sda mbr
# 9GB sda1
part-add /dev/sda p 64 $(( 9*1024*1024*2 ))
# remainder in sda2
part-add /dev/sda p $(( 9*1024*1024*2 + 1 )) -64
mkfs ext4 /dev/sda1
mkswap /dev/sda2
mount /dev/sda1 /
tgz-in /tmp/root.tar.gz /
EOF
Example:
$ sh test.sh
$ virt-df -a test.img -h
Filesystem Size Used Available Use%
test.img:/dev/sda1 9.0G 276M 8.3G 4%
$ ll -h test.img
-rw-rw-r--. 1 rjones rjones 11G Apr 4 09:39 test.img
Whether this would actually boot is another question: you may also
need to add some grub commands to set up the bootloader, *or* (better
and easier IMHO) set up libvirt so that it boots from an external
kernel + initrd.
> It also lacks access to rsync.
It's not the first time that someone has asked for rsync, and it
wouldn't be too hard to add. However note that rsync really gives you
no benefit when you're creating a filesystem from scratch, because
there's no original to rsync against. If you are updating a
filesystem image then rsync makes sense.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
12 years, 8 months
[libvirt-users] Is this Race Condition?
by Zhihua Che
Hi, everyone
I'm writing application using libvirt and I need call
virDomainGetCPUStats to get domain cpu stats . I learn from API
reference that this function has to be called when domain is running.
So my question is if there is an atomic way to test the domain's state
and get its stats?
Or, it's ok to call this function when domain is not active, but
caller just gets error returned.
In my code, I just call it directly and return error. I wonder if
this programming practice has subtle problem like race condition.
12 years, 8 months
[libvirt-users] Bare libvirt web interface
by RaSca
Hi,
I set up a virtual environment based upon KVM/libvirt/pacemaker. When
managing this I cannot use virt-manager or virsh, since everything is
managed by the cluster. So when I need to migrate a vm I must drive the
operation from pacemaker (via crm shell program).
I'm ok with this kind of management, but what I need now is just a bare
web interface to make the users see just the position (= on which node)
and the state of the vm (cpu, memory and so on, like virt-top output).
I don't want to use things like ovirt or similar, because I'm managing
everything with the cluster and also I cannot use LCMC
(http://lcmc.sourceforge.net/) since it is java based and is not as
simple as I want.
I need just those information to be printed in a self refreshing web
page, and before doing it by myself I was just wondering if something
already exists. I saw projects like http://karesansui-project.info and
https://fedorahosted.org/virt_web but maybe there is something easier
and more focused to obtain just the informations I need.
Thanks to all of you for your suggestions,
--
RaSca
Mia Mamma Usa Linux: Niente è impossibile da capire, se lo spieghi bene!
rasca(a)miamammausalinux.org
http://www.miamammausalinux.org
12 years, 8 months
[libvirt-users] vcpupin and kvm
by Geoff Galitz
Hi.
Can anyone confirm if vcpupin works correctly with kvm? If set I pin a
vcpu it shows up correctly via vcpuinfo, but querying via taskset shows
the cpu is not pinned.
Thanks,
-Geoff
--
----
Geoff Galitz, ggalitz(a)shutterstock.com
WebOps Engineer, Europe
Shutterstock Images
http://wwww.shutterstock.com/
12 years, 8 months
[libvirt-users] [Building Error] cannot stat `t-af.gmo': No such file or directory
by Zhihua Che
Hi, everyone
I'm building the newest libvirt from git repository, of version
782afa98e4a5fa9a0927a9e32f9cf36082a2e8e7
and failed complaining as the following.
make[3]: Entering directory `/home/harvey/open-projects/libvirt-build/po'
cd ../../libvirt/po && : --update af.po libvirt.pot
cd ../../libvirt/po && rm -f af.gmo && : -c --statistics -o af.gmo af.po
mv: cannot stat `t-af.gmo': No such file or directory
make[3]: *** [../../libvirt/po/af.gmo] Error 1
make[3]: Leaving directory `/home/harvey/open-projects/libvirt-build/po'
make[2]: *** [stamp-po] Error 2
make[2]: Leaving directory `/home/harvey/open-projects/libvirt-build/po'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/harvey/open-projects/libvirt-build'
make: *** [all] Error 2
My building steps are
cd <build-dir>
<src-dir>/autogen.sh --help
./configure --prefix=xxx
make
12 years, 8 months
[libvirt-users] Suggestions on building VM disks from scratch
by Dale Amon
This may not be the best forum to ask, but it does
seem to be one where it is as likely as anywhere
that someone will have dealt with a similar problem.
I need to define a procedure for last resort disaster
recovery from an incremental file level backup of the
root partition (and any others that are critical.)
Now it is easy enough to create a raw virtual disk
with dd, then to losetup and do a cfdisk and mkfs,
then mount it and rsync the backup onto it.
At this point I would like to be able to install
grub and make the virtual disk bootable. I have
'issues' with the way grub does things and the way
it seems to make certain assumptions for you. The
virtual disk is in actuality going to become an hd(0)
on the virtual machine; but my past experience with
grub is that it is going to assume you really
intend to install the MBR on your running system disk;
but if you tell it hd(1) then when you try to boot
it ain't gonna work.
Has anyone dealt with these issues? It's more than
just a VM one; I run up against it time and again.
A few months ago I attempted to attach a brand
new SATA disk via a USB converter to my laptop so
I could build a system on it for a machine that
has not CD, no floppy, etc, etc. I damn near clobbered
my laptop but fortunately caught the problem in time
and fixed it before a reboot... in which case I'd
have *really* had issues.
12 years, 8 months
[libvirt-users] setvcpus
by Bhasker C V
Hi all,
I am facing a bit of a trouble with setvcpus on a kvm libvirt
The guest is crashing right after the command is given.
I have no trouble with virtio_balloon and that is working fine when I
use setmem command in virsh. The guest is running 3.3.1 kernel (the
command fails both on the stock kernel 2.6.X as-well-as the latest 3.3.1)
I have seen it working in xen. But this is kvm. Does this feature work
with kvm ? Am I missing any kernel config which enables this ?
thanks
eg:-
virsh # start fedora12
Domain fedora12 started
virsh # vcpuinfo fedora12
VCPU: 0
CPU: 1
State: running
CPU time: 7.3s
CPU Affinity: yyyy
VCPU: 1
CPU: 3
State: running
CPU time: 2.3s
CPU Affinity: yyyy
virsh # vcpu fedora12
vcpucount vcpuinfo vcpupin
virsh # vcpucount fedora12
maximum config 8
maximum live 8
current config 2
current live 2
virsh # list
Id Name State
----------------------------------
14 fedora12 running
virsh # setvcpus fedora12 4
error: operation failed: could not change CPU online status
virsh # list
Id Name State
----------------------------------
virsh #
virsh # version
Compiled against library: libvir 0.9.1
Using library: libvir 0.9.1
Using API: QEMU 0.9.1
Running hypervisor: QEMU 0.14.1
--
Bhasker C V
Secure Mails:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x4D05FEEC54E47413
12 years, 8 months
[libvirt-users] Openvswitch support - port tagging
by Daniele Milani
I was looking at the release candidate of libvirt (0.9.11-rc2) and I have not been able to understand if the openvswitch support includes the port tagging support.
So my question is: is it possible to create a tagged port? How?
Otherwise, would it be useful to add this functionality?
Thanks,
Daniele Milani
12 years, 9 months
[libvirt-users] Reality check requested...
by Dale Amon
Is this going to do what I think it will
do? ie will the output be runable on a
current licensed vmware server?
qemu-img convert -f raw test.img -O vmdk test.vmdk
12 years, 9 months