[libvirt-users] Query:: Reg: Libvirt Networking
by Nehal J Wani
Currently, I have two networks configured via xml:
virsh # net-dumpxml TestNetwork1
<network connections='2'>
<name>TestNetwork1</name>
<uuid>a76f665a-0196-4edb-81b4-340944a6869c</uuid>
<forward dev='p1p1' mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
<interface dev='p1p1'/>
</forward>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:0b:e9:35'/>
<ip address='192.168.100.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.100.128' end='192.168.100.254'/>
</dhcp>
</ip>
</network>
virsh # net-dumpxml default6
<network connections='1'>
<name>default6</name>
<uuid>6e57d831-f09e-4b33-950d-6d51c89f9786</uuid>
<forward mode='nat'/>
<bridge name='virbr3' stp='on' delay='0'/>
<mac address='52:54:00:cb:c5:50'/>
<ip family='ipv6' address='2001:db8:ca2:2::1' prefix='64'>
<dhcp>
<range start='2001:db8:ca2:2:1::10' end='2001:db8:ca2:2:1::ff'/>
</dhcp>
</ip>
</network>
# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.5254000be935 yes virbr0-nic
vnet0
vnet1
virbr3 8000.525400cbc550 yes virbr3-nic
vnet2
My queries are:
(i) For each interface that I attach to my guests, will a new vnetX
(X=0,1,2,3,...) be created?
(ii) Can two different active networks share the same bridge? Example, can
the xml of two active networks have the same line <bridge name='virbr0'
stp='on' delay='0'/> ?
(iii) If the answer for (ii) is false, how can I obtain the interface name
for a given bridge name in libvirt?
--
Nehal J Wani
10 years, 9 months
[libvirt-users] centos4.8 system container not working on fedora 19 machine
by Rahul Khengare
Hi All,
I am trying to evaluate whether centos-4.8 system container work on
Fedora-19 machine or not.
Host machine : Fedora 19
Guest (LXC container) : CentOS4 .8
For creation of of container i followed following steps,
1. Installed libvirt packages on fedora19
2. For installation of rootfs using yum, I have created the LOCAL
YUM REPO using CentOS-4.8 ISO files
3. Created rootfs using yum
4. Made changes in container xml file required for system container
5 .Define container using container xml file
Whenever I start system container it get started successfully but when I am
trying to access it using console then It show errors regarding /etc/fstab
files and filesystem corruption. I am not able to access the container.
Refer below for container xml file and error message,
contents of xml file for Centos container, *Centos4_8.xml:*
<domain type='lxc'>
<name>BasicCentos</name>
<memory unit='KiB'>102400</memory>
<currentMemory unit='KiB'>102400</currentMemory>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/centos4.8'/>
<target dir='/'/>
</filesystem>
<interface type='bridge'>
<source bridge='br0'/>
</interface>
<console type='pty' port='0'></console>
</devices>
</domain>
-------------
*ERROR LOG* When trying to access container using CONSOLE command,
virsh # console BasicCentos
Connected to domain BasicCentos
Escape character is ^]
INIT: version 2.85 booting
/etc/rc.d/rc.sysinit: line 36: [: /sys/fs/selinux: binary operator expected
Setting default font (): [ OK ]
Welcome to CentOS release 4.8 (Final)
Press 'I' to enter interactive startup.
hwclock: KDGHWCLK ioctl failed, errno=25: Inappropriate ioctl for device.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access
method.
Setting clock : Thu Nov 21 01:48:58 EST 2013 [ OK ]
Starting udev: MAKEDEV: error making /dev/tty1: Operation not permitted
[FAILED]
Initializing hardware... storage network audio done [ OK ]
raidautorun: unable to autocreate /dev/md0
mount: can't find /dev/pts in /etc/fstab or /etc/mtab
Configuring kernel parameters: [ OK ]
Setting hostname centos: [ OK ]
Checking root filesystem
fsck.ext2: Is a directory while trying to open /
/:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
[FAILED]
*** An error occurred during the file system check.
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
*** Warning -- SELinux is active
*** Disabling security enforcement for system recovery.
*** Run 'setenforce 1' to reenable.
/etc/rc.d/rc.sysinit: line 52: $selinuxfs/enforce: ambiguous redirect
Press enter for maintenance
(or type Control-D to continue):
(Repair filesystem) 1 # exit
Unmounting file systems
mount: can't find / in /etc/fstab or /etc/mtab
Automatic reboot in progress.
thanks in advance.
Regards,
Rahul Khengare,
NTT OSS Center, Pune, India.
10 years, 9 months
[libvirt-users] facing some error in launching VM
by cool dharma06
hi,
i am using libvirt-1.1.3 in eucalyptus 2.0.3. When starting the Vm i am
facing the following error:
i got these error from the nc.log:
[EUCAERROR ] ERROR: key injection / tune2fs command failed
[EUCAERROR ] libvirt: internal error: client socket is closed (code=1)
[EUCAFATAL ] hypervisor failed to start domain
i checked in libvirtd.log its not showing any error.
How to solve this error.?
Any suggestions.??
regards,
cooldharma06.
10 years, 9 months
[libvirt-users] how to install libvirt-python
by Mahmood Naderan
Hi,
I have successfully installed libvirt-.0.10.0 from source
./configure
make
make install
How can I check that if libvirt-python is installed? Search the folders, it seems there is no such file
[root@tiger ~]# find /usr/ -name libvirt-python
[root@tiger ~]# find . -name libvirt-python
[root@tiger ~]#
Regards,
Mahmood
10 years, 9 months
[libvirt-users] how to use virtio-blk-data-plane in libvirt
by Hui Kai Ran
Hi,
I learned that there is a new technology - virtio-blk-data-plane
introduced in qemu to bring a leap in IO performance to KVM. Has this
feature been supported in libvirt? if it's, how to configure xml to
support this feature?
thanks.
10 years, 9 months
[libvirt-users] libvirt-sandbox on Ubuntu with SELinux
by boden
I'm attempting to build/use libvirt-sandbox on Ubuntu 12.xx. Although
I'm still working through dependency issues (including the need for
libvirt >= 1.0.2 which is not packaged for ubuntu 12.xx) to build the
sandbox code, I have a forward looking question.
It appears libvirt-bin for Ubuntu likes apparmor as does most Ubuntu
based packages using a LSM impl. However, as I understand
libvirt-sandbox is integrated with SELinux to provide security isolation
of containers...
My question becomes -- *should* libvirt-sandbox work on Ubuntu assuming
I use the ubuntu libvirt-bin package and replace apparmor with selinux?
Or am I flat out walking into quicksand on Ubuntu here?
Without the security aspect of libvirt-sandbox, I wonder if its viable
on ubuntu for those looking to mitigate container security?
Thanks
10 years, 9 months
[libvirt-users] Error facing when starting the VM.
by cool dharma06
Hi,
i am using eucalyptus -2.0.3 and libvirt 1.1.3 for xen -4.2.1.
i found this error when starting the Vm via euca2ools(euca-run-instances)
the error details are as follows:
*libvirt: internal error: client socket is closed (code=1) *
*hypervisor failed to start domain*
But from virsh i checked everything is working fine. I dont know why the
socket is getting closed when accessing from eucalyptus.
GIve some suggestions to solve this error.
Regards,
cooldharma06.
10 years, 9 months
[libvirt-users] Unable to configure libvirt
by Mahmood Naderan
Hello,
When I want to install libvirt-0.10.0 from source, I get this error at the configure stage
checking for libdevmapper.h... no
configure: error: You must install device-mapper-devel/libdevmapper >= 1.0.0 to compile libvirt
However the package is installed on my system
# yum list device-mapper-libs.x86_64
Installed Packages
device-mapper-libs.x86_64 1.02.74-10.el6 @base/$releasever
What is the problem then?
Regards,
Mahmood
10 years, 9 months
[libvirt-users] Failed to access the console after starting the lxc container
by Aarti Sawant
Hello,
I am starting the system container without "/" directory So that it can
share the host /bin /sbin /lib and /lib64 and i have sepeartely mounted
/var, /etc and /usr directory for the container
Below is xml file
<domain type='lxc'>
<name>test6</name>
<memory>102400</memory>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<vcpu>1</vcpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<console type='pty'/>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/test6/etc'/>
<target dir='/etc'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/test6/var'/>
<target dir='/var'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/test6/usr'/>
<target dir='/usr'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/pg_data/'/>
<target dir='/pg_data'/>
</filesystem>
<filesystem type='ram' accessmode='passthrough'>
<source usage='0' units='KiB'/>
<target dir='/dev/shm'/>
</filesystem>
<interface type='bridge'>
<source bridge='br0' />
</interface>
</devices>
</domain>
when i start the container it get start , but when i try to access console
it get stuck
virsh # list
Id Name State
----------------------------------------------------
18238 test4 running
20435 test6 running
virsh #
virsh # start test6
Domain test6 started
virsh # console test6
Connected to domain test6
Escape character is ^]
But when i mount the "/" in xml it works, i have also share host
/bin,/sbin, /lib and /lib64.
<domain type='lxc'>
<name>test4</name>
<memory>102400</memory>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<vcpu>1</vcpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<console type='pty'/>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/test4/'/>
<target dir='/'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/bin'/>
<target dir='/bin'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/sbin'/>
<target dir='/sbin'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lib'/>
<target dir='/lib'/>
</filesystem>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lib64'/>
<target dir='/lib64'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/pg_data/'/>
<target dir='/pg_data'/>
</filesystem>
<filesystem type='ram' accessmode='passthrough'>
<source usage='0' units='KiB'/>
<target dir='/dev/shm'/>
</filesystem>
<interface type='bridge'>
<source bridge='br0' />
</interface>
</devices>
</domain>
as i am new , can anyone explain me why my test6 container get stuck?
And in system container if we need to share host filesystem y we need to
mount them explicitly?
Thanks,
Aarti Sawant
NTTDATA OSS Center Pune
10 years, 9 months
[libvirt-users] virsh and multi source-dev
by Matthieu Simonin
Hi,
I'm using LVM based storage pools and I'm wondering
if there is a way to specify several source-dev on the command line
for creating a volume group spread over several devices :
one device /dev/sdc1 is ok:
* virsh pool-define-as --name lvmpool --type logical --source-dev /dev/sdc1 --source-name vg --target /dev/vg
I would like something like (but sadly doesn't work):
? virsh pool-define-as --name lvmpool --type logical --source-dev /dev/sdc1 --source-dev /dev/sdb1 --source-name vg --target /dev/vg ?
Best regards,
Matt
10 years, 9 months