Libvirt-cim setup

From Libvirt Wiki
Revision as of 11:38, 25 November 2010 by ChrisBoyle (talk | contribs) (De-spam)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Back

libvirt-cim setup instructions

System requirements
  • libvirt and libvirt-devel
  • CIMOM (Pegasus or sfcb) and the appropriate devel package for the given CIMOM

Setup Options

Fedora 9 / Fedora 10 release rpm

The Fedora development repository has all of the required packages for running libvirt-cim. For people not working directly on libvirt-cim development, this is the best method to get a working libvirt-cim installation. It won't be the most up-to-date version of the providers, but it will "just work". Start by getting a Fedora 9 or Fedora 10 machine installed. Install the CIM server and utility program:

% yum install tog-pegasus sblim-wbemcli

Next, you need to enable HTTP connections and Job support in pegasus:

% cimconfig -p -s enableHttpConnection=true
% cimconfig -p -s repositoryIsDefaultInstanceProvider=true
Planned value for the property enableHttpConnection is set to "true" in
CIMServer.
% service tog-pegasus restart
Shutting down CIM server:                                  [  OK  ]
Starting up CIM server:                                    [  OK  ]

NOTE:Fedora 9 and Fedora 10 don't have Dom0 support. You'll need to install KVM instead. If you do not already have KVM and libvirt installed, do so NOW before you enable the development repository. Similarly, do not install any other packages while fedora-devel is enabled. The development repository is unstable and many packages in it will break your system. To install libvirt and kvm:

% yum install kvm qemu libvirt

Next, enable the development repository by editing /etc/yum.repos.d/fedora-development.repo and enabling the development repository:

[development]
name=Fedora - Development
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/development/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch
enabled=1

Note the only change required is the enabled field from 0 to 1. Leave all other values as they are.

Next, install the provider and the associated support library:

% yum install libvirt-cim
Loading "downloadonly" plugin
development               100% |=========================| 2.1 kB    00:00
primary.sqlite.bz2        100% |=========================| 7.0 MB    00:04
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package libvirt-cim.x86_64 0:0.1-3.fc9 set to be updated
---> Package libvirt-cim.i386 0:0.1-3.fc9 set to be updated
--> Processing Dependency: libcmpiutil.so.0 for package: libvirt-cim
--> Running transaction check
---> Package libcmpiutil.i386 0:0.1-6.fc9 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 libvirt-cim             x86_64     0.1-3.fc9        development       1.7 M
 libvirt-cim             i386       0.1-3.fc9        development       1.6 M
Installing for dependencies:
 libcmpiutil             i386       0.1-6.fc9        development        43 k
Transaction Summary
=============================================================================
Install      3 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 3.3 M
Is this ok [y/N]:

Answer yes and the providers will be downloaded and installed automatically.

You can now test that the providers are working with a command like:

% wbemcli ein  http://root:password@localhost/root/virt:KVM_VirtualSystemManagementService

Which should return something like:

localhost:5988/root/virt:KVM_VirtualSystemManagementService.CreationClassName="KVM_VirtualSystemManagementService",Name="Management Service",SystemCreationClassName="KVM_HostSystem",SystemName="elm3b41"


Install from source

First, install a CIMOM. Next, checkout the libcmpiutil and libvirt-cim trees:

$ hg clone http://libvirt.org/hg/libcmpiutil/
$ hg clone http://libvirt.org/hg/libvirt-cim/

Configure, build and install the libcmpiutil library:

$ cd libcmpiutil
$ ./autogen.sh
$ ./configure (see table below for options)
$ make clean && make
$ sudo make install
32 bit 64 bit
./configure --enable-eoparser --prefix=/usr ./configure --prefix=/usr/lib64

Configure, build and install the libvirt-cim provider:

$ ./autoconfiscate.sh
$ ./configure (see table below for configure options)
Pegasus sfcb
32 bit CIMSERVER=pegasus PROVIDERDIR=/usr/lib/cmpi ./configure --prefix=/usr --disable-werror CIMSERVER=sfcb PROVIDERDIR=/usr/lib/cmpi ./configure --prefix=/usr --disable-werror
64 bit CIMSERVER=pegasus PROVIDERDIR=/usr/lib/cmpi ./configure --prefix=/usr/lib64 --disable-werror CIMSERVER=sfcb PROVIDERDIR=/usr/lib/cmpi ./configure --prefix=/usr/lib64 --disable-werror

Update /etc/ld.so.conf so that it includes the "/usr/lib/cmpi" path. Then run:

$ ldconfig
Start the CIMOM:
  sfcb
    # /etc/init.d/sfcbd start  or /usr/local/sbin/sfcbd -d
  pegasus
   # /etc/init.d/tog-pegasus start or /usr/local/sbin/tog-pegasus &
$ make clean && make
$ sudo make preinstall
$ -----Restart the CIMOM (Pegasus or sfcb)
$ sudo make install
$ sudo make postinstall

Manual testing

You can now test that the providers are working.

For KVM:

% wbemcli ein  http://root:password@localhost/root/virt:KVM_VirtualSystemManagementService

Which should return something like:

localhost:5988/root/virt:KVM_VirtualSystemManagementService.CreationClassName="KVM_VirtualSystemManagementService",Name="Management Service",SystemCreationClassName="KVM_HostSystem",SystemName="elm3b41"

For Xen:

% wbemcli ein  http://root:password@localhost/root/virt:KVM_VirtualSystemManagementService

Which should return something like:

localhost:5988/root/virt:KVM_VirtualSystemManagementService.CreationClassName="KVM_VirtualSystemManagementService",Name="Management Service",SystemCreationClassName="KVM_HostSystem",SystemName="elm3b41"
$ wbemcli ein 'http://localhost:5988/root/virt:Xen_ComputerSystem'
localhost:5988/root/virt:Xen_ComputerSystem.CreationClassName="Xen_ComputerSystem",Name="Domain-0"