Comments (9)
First of all, I think I need to start libvirt plugin, right?
But it looks like it isn't available for some reason:
infrakit plugin start
INFO[10-11|04:02:06] config module=cli/plugin url= fn=github.com/docker/infrakit/cmd/infrakit/plugin.Command.func2
Plugins available:
KIND EXEC
aws inproc
combo inproc
digitalocean inproc
docker inproc
enrollment inproc
file inproc
gc inproc
google inproc
group inproc
hyperkit inproc
ibmcloud inproc
image inproc
ingress inproc
inventory inproc
kubernetes inproc
maas inproc
manager inproc
oneview inproc
oracle inproc
packet inproc
pool inproc
rackhd inproc
resource inproc
selector/spread inproc
selector/tiered inproc
selector/weighted inproc
simulator inproc
swarm inproc
tailer inproc
terraform inproc
time inproc
vagrant inproc
vanilla inproc
vars inproc
vsphere inproc
This led me to assuming that this function didn't run for some reason:
https://github.com/docker/infrakit/blob/a10d75ee2d0a8992edf415630a47b0633b04b0b0/pkg/run/v0/libvirt/libvirt.go#L33-L35
from deploykit.
After trying to set a breakpoint it says No source file named pkg/run/v0/libvirt/libvirt.go.
So it means it isn't imported anywhere, right?
So I went to see where all providers are imported and look what I found:
Git blame led to this: #872
So libvirt isn't built by default?
Looking back found this: #718
Along with instructions on how to build it with libvirt.
Apparently there are some issues with go buildings for libvirt.
README of this package says it requires libvirt-dev
package installed.
And in runtime it requires libvirt.so even if you don't use it. Authors suggest to provide libvirt as a separate binary: libvirt/libvirt-go#8
It probably makes sense to make plugins/providers actually installable as separate binaries. Not sure whether it is designed that way.
from deploykit.
So, this is how I build infrakit with libvirt provider:
sudo apt-get install libvirt-dev
GO_BUILD_TAGS="libvirt builtin providers" make build/infrakit
And it works:
$ infrakit plugin start libvirt
...
$ infrakit plugin ls
INTERFACE NAME LISTEN
Instance/0.6.1 libvirt/default /home/john/.infrakit/plugins/libvirt
Now I need to figure out how to provide libvirt URI and then - how to start some instances, and then - how to configure those instances.
from deploykit.
It was quite hard to find. To provide libvirt URIs we use this:
For example:
$ export INFRAKIT_LIBVIRT_URIS=default=qemu+ssh://server/system
$ infrakit plugin start libvirt
To start instances the command line is this:
$ infrakit local libvirt/default provision -y libvirt.yml
Where libvirt.yml
looks like this:
Properties:
MetadataStoragePool: default
Domain:
Domain:
Type: kvm
Memory:
Unit: GiB
Value: 1
VCPU:
Value: 1
OS:
Type:
Arch: x86_64
Machine: pc-i440fx-2.8
Type: hvm
Initrd: ./initrd.img
Kernel: ./bzImage
KernelArgs: console=ttyS0
BIOS:
UseSerial: 'yes'
RebootTimeout: '1000'
Boot:
Dev: hd
Devices:
Interfaces:
- Type: bridge
Source:
Bridge: virbr0
Model:
Type: virtio
Serials:
- Type: pty
Consoles:
- Type: pty
Target:
Type: serial
Name: "0"
Channels:
- Type: unix
Target:
Type: virtio
Name: org.qemu.guest_agent.0
OnCrash: destroy
OnPoweroff: destroy
OnReboot: restart
Now I need to figure out how to generate those kernel and initrd files.
from deploykit.
It looks like linuxkit can generate those files. Installed linuxkit like this:
wget https://github.com/linuxkit/linuxkit/releases/download/v0.6/linuxkit-linux-amd64 -O ~/bin/linuxkit
chmod +x ~/bin/linuxkit
Running it like this
linuxkit build --format kernel+initrd linuxkit.yml
where linuxkit is here:
https://github.com/linuxkit/linuxkit/blob/master/linuxkit.yml
Unfortunately, kernel 4.14.74 causes kernel panic when running in qemu. So I switched to 4.4.159
Now I need to solve the next problem: how to build those images or copy them to the remote libvirtd host (when using INFRAKIT_LIBVIRT_URIS=default=qemu+ssh://server/system
). Maybe a simple NFS share for now?
from deploykit.
We could perhaps extend the functionality from here https://github.com/docker/infrakit/tree/master/pkg/x/remoteboot ?
from deploykit.
Not sure I understand. remoteboot
looks like a PXE server. How does it help?
Currently I'm struggling to find steps needed to provision kvm instances according to some yaml file. And configure those instances with docker swarm/kubernetes.
Here's a list of problems I found along the way (some of them solved):
- libvirt is not builtin to infrakit
- providing libvirt remote URI is not documented (
INFRAKIT_LIBVIRT_URIS
) - example libvirt.yaml doesn't work
- you have to build kernel and initrd using thirdparty tool (at least linuxkit integration is not documented)
- you have to copy kernel and initrd on remote host is using remote libvirt URI (at least didn't find a way to copy automatically)
- video device is not working for some reason
- can't figure out how to specify random device (libvirt/libvirt-go-xml#25)
- init section doesn't work (something with permissions for "metadata volume")
- figuring out networking (should I use portforwarding, ip routing or something else to reach VMs)
- what's linuxkit configuration to build images with docker installed
- how to setup container orchestration (say, I want 3 manager and 7 worker VMs), what flavors/groups should I use
- should I reach container orchestrator directly or through infrakit
- should I install loadbalancer on metal, VM or container
I'm currently on step 7. It looks like something to do with libvirtxml (libvirt/libvirt-go-xml#25)
from deploykit.
BTW VNC instead of video device working fine (problem 6):
Graphics:
- Type: "vnc"
AutoPort: "yes"
Port: -1
Listen: "127.0.0.1"
Listeners:
- Type: "address"
Address: "127.0.0.1"
from deploykit.
Ok, the problem with RNG is that vendored copy isn't updated for more than a year:
libvirt/libvirt-go-xml@7ea4465
from deploykit.
Related Issues (20)
- New local CLI returning 0 if the plugin does not exist
- Enrollment controller template indexing rendering "<no value>" HOT 2
- Move repo to infrakit/infrakit
- Group controller always calling instance plugin with "properties=true" HOT 4
- Force manager leadership change on during manager rolling update HOT 3
- Cascading deletes using the terraform plugin HOT 3
- Pacing of Rolling updates HOT 1
- Swarm node garbage collection HOT 4
- Error: Property 'Box' must be set
- Request canceled client timeout HOT 2
- Update group rolling update polices
- Confusing/Outdated LinuxKit tutorial HOT 5
- Issues with the Cloudformation Example
- feat: Homebrew HOT 2
- Tutorial Fails with Client.Timeout HOT 2
- Libvirt init section doesn't work: Permission denied
- Please upgrade libvirt HOT 1
- Renaming this project HOT 6
- Is deploykit going to support Apache CloudStack?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deploykit.