1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
# Fog::Libvirt
fog-libvirt is a libvirt provider for [fog](https://github.com/fog/fog).
[](https://github.com/fog/fog-libvirt/actions/workflows/ruby.yml)
[](https://gemnasium.com/fog/fog-libvirt)
[](https://codeclimate.com/github/fog/fog-libvirt)
[](http://badge.fury.io/rb/fog-libvirt)
[](https://www.gittip.com/geemus/)
## Installation
fog-libvirt can be used as a module for fog or installed separately as:
```
$ sudo gem install fog-libvirt
```
## Usage
Example REPL session:
```
>> require "fog/libvirt"
=> true
>> compute = Fog::Compute.new(provider: :libvirt, libvirt_uri: "qemu:///session")
=> #<Fog::Libvirt::Compute::Real:46980 @uri=#<Fog::Libvirt::Util::URI:0x0000000002def920 @parsed_uri=#<URI::Generic qemu:/session>, @uri="qemu:///session"...
>> server = compute.servers.create(name: "test")
=>
<Fog::Libvirt::Compute::Server
id="bbb663e4-723b-4165-bc29-c77b54b12bca",
cpus=1,
cputime=0,
os_type="hvm",
memory_size=262144,
max_memory_size=262144,
name="test",
arch="x86_64",
persistent=true,
domain_type="kvm",
uuid="bbb663e4-723b-4165-bc29-c77b54b12bca",
autostart=false,
nics=[ <Fog::Libvirt::Compute::Nic
mac="52:54:00:d1:18:23",
id=nil,
type="network",
network="default",
bridge=nil,
model="virtio"
>],
volumes=[ <Fog::Libvirt::Compute::Volume
id=nil,
pool_name="1Download",
key=nil,
name="test.img",
path="/home/lzap/1Download/test.img",
capacity="10G",
allocation="1G",
owner=nil,
group=nil,
format_type="raw",
backing_volume=nil
>],
active=false,
boot_order=["hd", "cdrom", "network"],
display={:type=>"vnc", :port=>"-1", :listen=>"127.0.0.1"},
cpu={},
hugepages=false,
guest_agent=true,
virtio_rng={},
state="shutoff"
>
```
See [README.md](https://github.com/fog/fog-libvirt/blob/master/lib/fog/libvirt/models/compute/README.md).
## Contributing
Please refer to [CONTRIBUTING.md](https://github.com/fog/fog/blob/master/CONTRIBUTING.md).
## License
Please refer to [LICENSE.md](https://github.com/fog/fog-libvirt/blob/master/LICENSE.md).
|