dhiltgen / docker-machine-kvm

KVM driver for docker-machine
Apache License 2.0
377 stars 117 forks source link

Diver Parameter --kvm-network "Network not found" #27

Open Arytas opened 7 years ago

Arytas commented 7 years ago

Hey there,

i tried your kvm driver for docker-machine. The machine will be created if i use the cmd "docker-machine create -d kvm foobar"

but i want to add a bridged network to the vm at the creation step. i used the --kvm-network parameter for my bridged network on the host (this bridged network is working with virtualbox)

but if i run this cmd "docker-machine create --kvm-network br1 -d kvm foobar" following error appears Error with pre-create check: "[Code-43] [Domain-19] Network not found: no network with matching name 'br1'"

any idea?

Arytas commented 7 years ago

brctl show list the br1 network

also if i add a new network with virsh, (available in virsh net-list) i get the same error

Arytas commented 7 years ago

hm i guess i have misinterpreted the flag

i try to configure the machine with a bridged network but i have no solution yet

dhiltgen commented 7 years ago

I'm not sure what your objective is, so it's hard to say exactly how you should configure the system.

Ultimately this machine driver should work against valid libvirt networks. If you have a specific scenario that you feel should work and doesn't, please provide the reproduction steps so I (or others) can reproduce it in our environment. (e.g., how was the bridge set up, what was the libvirt network definition XML, etc.)

You might find some useful insight by reading through http://libvirt.org/formatnetwork.html

webloginwu commented 7 years ago

--kvm-network parameter only support "kvm VirtualNetworking",which means kvm virtual machine should be in a virtual network(using NAT mode or routed mode), --kvm-network does not support to create kvm virtual machine using the bridge on the physical host directly, in which case virt-install support , I need docker-machine support this feature too.

CharlotteLock commented 6 years ago

@webloginwu i want to do like you, can tell me how to add bridge, let public network can access machine

CharlotteLock commented 6 years ago

@Arytas

webloginwu commented 6 years ago

use following command to attach a new network card to kvm virtual machine, this network card is bridged to br1(br1 is on my host,and can be seen by using "brctrl show" ) virsh attach-interface --domain centos64-template --type bridge --source br1 --model virtio --config --live

abel408 commented 6 years ago

I'm struggling to figure out the best setup for my docker-machine and wondering if the --kvm-network argument will help me out. I have my Ubuntu host set up on br0 from it's physical interface on 10.10.10.50. I have other KVM VM guests set up on tap interfaces I've created with tunctl. These guests are all accessible from my 10.10.10.0/24 network and have addresses in that range. I would like to setup my docker-machine to be in the same network, but instead it is put in the host-only network 192.168.122.0. Is it possible to get it on the same network that my VM host is on? If not, how would I go about making my docker containers accessible from machines on the 10.10.10.0/24 network? Would I have to forward ports from my VM host to the docker-machine? If so, how would I do that?