Path: | README.rdoc |
Last Update: | Wed Sep 19 00:07:43 -0400 2012 |
Simple to use ruby interface to libvirt.
Libvirt is located at libvirt.org/ruby
for full API please visit rdoc.info/github/ohadlevy/virt
uri = "qemu:///system" # libvirt running locally uri = "qemu:/fqdn//system" # used for QEMU+TLS connection uri = "qemu+ssh:/user@fqdn//system" # used for SSH connection uri = "qemu+tcp:/fqdn//system" # used for non secured tcp connection
conn = Virt.connect(uri)
host = conn.host
host.running_guests
host.defined_guests
host.guests
guest=Virt::Guest.new({:name => "test123"}) guest.vcpu = 2 guest.volume.size = 10 # in GB guest.save guest.start puts guest.mac guest.shutdown # initiate a shutdown guest.poweroff # forces a shutdown
Many more options exists, make sure checkout the api/tests
host.interfaces # physical interfaces host.networks # virtual / NAT interfaces
host.storage_pools host.volumes
Copyright (c) 2011 Ohad Levy
This program and entire repository is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>.