Knife kvm vm


#1

Hi , I added have the following kvm knife configuration in my ~/.chef/knife.rb
file :

knife[:kvm_host] = "10.10.10.1"
knife[:kvm_username] = "root"
knife[:kvm_password] = “password”

When I test this command the knife looks for local KVM :

knife kvm vm list

Connecting to KVM host 127.0.0.1 (ssh)…
ERROR: LoadError: no such file to load – libvirt

Wrong config ?

/Vlad


#2

Vlad,

It looks like knife-kvm has Fog as a dependency, which itself relies upon the libvirt library to work properly. You should be able to download this using your OS package manager. For example (on Ubuntu):

sudo apt-get install libvirt-dev

Thanks,

-Tim

On Thursday, August 2, 2012 at 9:23 AM, vlad.berezovski@gmail.com wrote:

Hi , I added have the following kvm knife configuration in my ~/.chef/knife.rb
file :

knife[:kvm_host] = "10.10.10.1"
knife[:kvm_username] = "root"
knife[:kvm_password] = “password”

When I test this command the knife looks for local KVM :

knife kvm vm list

Connecting to KVM host 127.0.0.1 (ssh)…
ERROR: LoadError: no such file to load – libvirt

Wrong config ?

/Vlad


#3

I ran this command command on my Chef workstation ( CentOS 6) .
Added libvirt* packages and started libvirt services - didn’t help .

starce log indicates the command cannot find libvirt.so and libvirt.rb
in the /usr/lib64/ruby/gems/1.8/gems/ folders .
Suspect this is the problem .

Thanks .

/Vlad .

On Thu, Aug 2, 2012 at 5:01 PM, Tim Green tgreen@opscode.com wrote:

Vlad,

It looks like knife-kvm has Fog as a dependency, which itself relies upon
the libvirt library to work properly. You should be able to download this
using your OS package manager. For example (on Ubuntu):

sudo apt-get install libvirt-dev

Thanks,

-Tim

On Thursday, August 2, 2012 at 9:23 AM, vlad.berezovski@gmail.com wrote:

Hi , I added have the following kvm knife configuration in my
~/.chef/knife.rb
file :

knife[:kvm_host] = "10.10.10.1"
knife[:kvm_username] = "root"
knife[:kvm_password] = “password”

When I test this command the knife looks for local KVM :

knife kvm vm list

Connecting to KVM host 127.0.0.1 (ssh)…
ERROR: LoadError: no such file to load – libvirt

Wrong config ?

/Vlad


#4

Vlad,

You also need to install the ruby-bindings for libvirt if you haven’t already done so (I just noticed this in Fog’s libvirt code):

gem install libvirt

Thanks,

-Tim

On Thursday, August 2, 2012 at 10:25 AM, Vladimir Berezovski wrote:

I ran this command command on my Chef workstation ( CentOS 6) .
Added libvirt* packages and started libvirt services - didn’t help .

starce log indicates the command cannot find libvirt.so and libvirt.rb in the /usr/lib64/ruby/gems/1.8/gems/ folders .
Suspect this is the problem .

Thanks .

/Vlad .

On Thu, Aug 2, 2012 at 5:01 PM, Tim Green <tgreen@opscode.com (mailto:tgreen@opscode.com)> wrote:

Vlad,

It looks like knife-kvm has Fog as a dependency, which itself relies upon the libvirt library to work properly. You should be able to download this using your OS package manager. For example (on Ubuntu):

sudo apt-get install libvirt-dev

Thanks,

-Tim

On Thursday, August 2, 2012 at 9:23 AM, vlad.berezovski@gmail.com (mailto:vlad.berezovski@gmail.com) wrote:

Hi , I added have the following kvm knife configuration in my ~/.chef/knife.rb
file :

knife[:kvm_host] = "10.10.10.1"
knife[:kvm_username] = "root"
knife[:kvm_password] = “password”

When I test this command the knife looks for local KVM :

knife kvm vm list

Connecting to KVM host 127.0.0.1 (ssh)…
ERROR: LoadError: no such file to load – libvirt

Wrong config ?

/Vlad


#5

Great !

Now this works ;

knife kvm vm list

Connecting to KVM host 127.0.0.1 (ssh)…
root@ password:
±--------±--------±--------±-----±--------±-------+
| NAME | STATE | MAX_MEM | CPUS | OS_TYPE | ARCH |
±--------±--------±--------±-----±--------±-------+
| centos5 | shutoff | 1024 MB | 1 | hvm | x86_64 |
±--------±--------±--------±-----±--------±-------+

Thanks ,

/Vlad .

On Thu, Aug 2, 2012 at 5:30 PM, Tim Green tgreen@opscode.com wrote:

Vlad,

You also need to install the ruby-bindings for libvirt if you haven’t
already done so (I just noticed this in Fog’s libvirt code):

gem install libvirt

Thanks,

-Tim
*
*

On Thursday, August 2, 2012 at 10:25 AM, Vladimir Berezovski wrote:

I ran this command command on my Chef workstation ( CentOS 6) .
Added libvirt* packages and started libvirt services - didn’t help .

starce log indicates the command cannot find libvirt.so and libvirt.rb
in the /usr/lib64/ruby/gems/1.8/gems/ folders .
Suspect this is the problem .

Thanks .

/Vlad .

On Thu, Aug 2, 2012 at 5:01 PM, Tim Green tgreen@opscode.com wrote:

Vlad,

It looks like knife-kvm has Fog as a dependency, which itself relies upon
the libvirt library to work properly. You should be able to download this
using your OS package manager. For example (on Ubuntu):

sudo apt-get install libvirt-dev

Thanks,

-Tim

On Thursday, August 2, 2012 at 9:23 AM, vlad.berezovski@gmail.com wrote:

Hi , I added have the following kvm knife configuration in my
~/.chef/knife.rb
file :

knife[:kvm_host] = "10.10.10.1"
knife[:kvm_username] = "root"
knife[:kvm_password] = “password”

When I test this command the knife looks for local KVM :

knife kvm vm list

Connecting to KVM host 127.0.0.1 (ssh)…
ERROR: LoadError: no such file to load – libvirt

Wrong config ?

/Vlad