spheromak / knife-xapi Goto Github PK
View Code? Open in Web Editor NEWKnife Plugin For XAPI to control xenserver
License: Apache License 2.0
Knife Plugin For XAPI to control xenserver
License: Apache License 2.0
I am able to create/destroy vm's on XenServer but I can't get the vm to bootstrap chef. I have been trying with a few different vm's OEL, CentOS, Ubuntu.... As soon as the vm starts (before it finishes booting) the knife command completes successfully.
braden@braden-desktop:~/chef-repo$ knife xapi guest create "ubuntu" "Private" --xapi-vm-template "Ubuntu 12.04" --xapi-skip-disk --bootstrap-template chef-full --ssh-user hwa --ssh-password w4rr4nty --run-list "recipe[git]"
Waiting on Template Clone
success
Provisioning new Guest: ubuntu
Boot Args: graphical utf8 hostname=ubuntu domain= dnsdomain=
Install Repo: http://isoredirect.centos.org/centos/6/os/x86_64/
Memory: 1g
CPUs: 1
Disk:
Starting new Guest
OK!
I have been playing with Chef for a little while (and feel fairly comfortable) but have always manually created vm's and the used the knife bootstrap command.... so I may be missing something basic. Any help would be appreciated (the plugin looks really nice)
Good morning,
I'm in an environment that requires a lot of turnaround to provision an IP address. I would like to pass a MAC address to knife xapi guest create and it use that MAC address.
I am having an issue with remote_directory when it comes to file permissions. So as an example the remote directory that I want to pull down from the cookbook has a file that is set to 755 but when it gets pulled its get set to 644.
I do not want to use files_mode 755 because that will change all files to 755 even files in other directories that should be set to 644. So is there a way to just preserve the file permissions based on what it is set in the cookbook? The directory has many files with different permissions set would be hard for me to tackle each file individually so that I can specifically set the right permission.
Also symlinks they are not preserved is there a setting to preserve symlinks?
When I create a VM using a existed template with this command
knife xapi guest create "test05" "Pool-wide network associated with eth0" -c test-xapi.rb -VV
There are two virtual disks were created, one named as template disk name, and another is named with "test05-root", so there is an error logged in xensource.log
[20120618T05:09:47.706Z|debug|fred-227|3418|Async.VBD.create R:930bd64e4414|dispatcher] Server_helpers.exec exception_handler: Got exception DEVICE_ALREADY_EXISTS: [ 0 ]
and failed to create the guest VM with latest knife-xapi gem
after I comment one line of code in xapi_guest_create.rb
line 288 #cleanup(vm_ref) unless vbd_ref
it's ok to create the VM.
Cloud you have a look why this happen? Thanks
I am attempting to clone a vm from an existing template (which works fine without the bootstrap) and then have it run the default chef-full bootstrap on the node. This doesn't work. The knife xapi call exits as soon as the vm comes up - similar to a previous issue noted here. Here is my call, please let me know if I am doing this incorrectly.
knife xapi guest create "node01-test" "Bond 4+5" --xapi-vm-template "BKFD-Ubuntu-14.04-Template-Vol07" --xapi-skip-disk --bootstrap-template chef-full --ssh-user someuser --ssh-password somepass --host http://ipaddresshere/ -C 2
Thanks.
The "knife xapi vdi" subcommands seem to have issues with XS 6.2.
"vdi list" Example:
knife xapi vdi list -VV -h http://dlaghv321
VDI Name: vdi_dlagapp32t1_home
UUID: fb24324c-65d1-4517-bdf0-c6ffc54ef522
Description: VDI_dlagapp32t1_home
Type: user
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/chef/knife/xapi_base.rb:465:in print_vdi_info': undefined method
bytes' for 10737418240:Fixnum (NoMethodError)
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/chef/knife/xapi_vdi_list.rb:61:in block in run' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/chef/knife/xapi_vdi_list.rb:60:in
each'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/chef/knife/xapi_vdi_list.rb:60:in run' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife.rb:466:in
run_with_pretty_exceptions'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife.rb:173:in run' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/application/knife.rb:123:in
run'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/bin/knife:25:in <top (required)>' from /usr/bin/knife:23:in
load'
from /usr/bin/knife:23:in `
"vdi create" Example:
knife xapi vdi create -VV -h http://dlaghv321 -D 20g -S sata vdi_dlagdbs321_backup
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/xenapi/xenapi/client.rb:378:in _do_call': ["FIELD_TYPE_ERROR", "self"] (XenApi::Errors::GenericError) from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/xenapi/xenapi/client.rb:257:in
_call'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/xenapi/xenapi/dispatcher.rb:45:in method_missing' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/chef/knife/xapi_base.rb:299:in
get_sr_by_name'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-xapi-0.5.4/lib/chef/knife/xapi_vdi_create.rb:54:in run' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife.rb:466:in
run_with_pretty_exceptions'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/knife.rb:173:in run' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/lib/chef/application/knife.rb:123:in
run'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.2/bin/knife:25:in <top (required)>' from /usr/bin/knife:23:in
load'
from /usr/bin/knife:23:in `
I have a pool of xenservers, there is one master and 2 slaves.
I want to be able to build a VM on a specific host in the pool even though the host is a slave vs a pool master.
I figured if I use the --xapi-sr command I would be able to select the slave host local storage SR and then the VM would be created on that host....
I cannot find an example anywhere of how to use the --xapi-sr command...
Basically what i am doing now is the below not sure that is correct...
--xapi-sr {SR UUID} --host http://{pool master}
I have some issues by this knife plugin, version 0.3.2
command line
knife xapi guest create "test" "Network 0" --xapi-vm-template "CentOS54T" -C 1 -M 512m --host http://172.16.233.227 -VV
Error message:
Network 0
WARNING: Network 0 not found, moving on
After the VM was created, there is no network, so it always report
.VM.get_guest_metrics
OpaqueRef:2550f8c8-348d-38ad-2900-726e37117843
OpaqueRef:58c7e0ad-d15d-6f06-fd68-0f668d5842bb
And failed with
.Timeout waiting for XAPI to report IP address
ip seems wrong using host+domain name instead
Did you patch xenapi for SSL support yourself? On [1] is says you pulled it in, but not the source. I'd like to do a similar project as knife-xapi for capistrano (I don't use chef), and I'd like to reuse the SSL xenapi fork, if I can find it.
Thanks,
Patrick
[1] https://github.com/spheromak/knife-xapi/blob/master/lib/xenapi/README
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.