-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected JSON Output #77
Comments
This is related to libvirt/libvirt@0f87054 since libvirt doesn't use a dnsmasq file for this anymore ( As you say, the error format is misleading. It should probably have been "file not found", not that it would have helped... |
Actually it was not only using the correct code (status instead of leases), it also needs to use a different network card. It is possible to backport code from minikube to this driver, but since it is not supported anymore there will be no releases. diff --git a/kvm.go b/kvm.go
index 1e6c891..c73de61 100644
--- a/kvm.go
+++ b/kvm.go
@@ -665,11 +667,22 @@ func (d *Driver) GetIP() (string, error) {
if err != nil {
return "", err
}
- /*
- * TODO - Figure out what version of libvirt changed behavior and
- * be smarter about selecting which algorithm to use
- */
- ip, err := d.getIPByMACFromLeaseFile(mac)
+ conn, err := d.getConn()
+ if err != nil {
+ return "", err
+ }
+ defer conn.Close()
+
+ var ip string
+ libVersion, err := conn.GetLibVersion()
+ if err != nil {
+ return "", err
+ }
+
+ // Earlier versions of libvirt use a lease file instead of a status file
+ if libVersion < 1002006 {
+ ip, err = d.getIPByMACFromLeaseFile(mac)
+ }
if ip == "" {
ip, err = d.getIPByMacFromSettings(mac)
} |
As newbie to all of this, some questions:
|
Those were the virtual nics, the"rtl8139" is the default and I changed it to "e1000" in a local build: --- a/kvm.go
+++ b/kvm.go
@@ -60,9 +60,11 @@ const (
</graphics>
<interface type='network'>
<source network='{{.Network}}'/>
+ <model type='e1000'/>
</interface>
<interface type='network'>
<source network='{{.PrivateNetwork}}'/>
+ <model type='e1000'/>
</interface>
</devices>
</domain>` The lease file used to carry the IPs allocated, but it is now in the status file (in dnsmasq) instead.
See #67 Only the VirtualBox driver was officially supported by Docker Inc., and now Machine is deprecated too. So far there has been no volunteers to take over the development and release, in the "new" organization. As the name implies, it was originally only for drivers: https://github.com/machine-drivers/discussion/issues |
@darkn3rd : You can find a prebuilt binary here: https://github.com/afbjorklund/docker-machine-kvm |
The missing kernel configuration for "rtl8139cp" was reported here: boot2docker/boot2docker#1407 |
That solved this exact issue for me |
I tried to use the latest released version with docker-machine, and I am getting this error. I am not deeply familiar with KVM or libvirt, so I am not sure how this works. I have libvirt working fine with vagrant and mini-kube (using their embedded kvm2 docker-machine driver) without any problems. I am not sure how I could debug further.
There's no such file
/var/lib/libvirt/dnsmasq/docker-machines.leases
.$ ls -la /var/lib/libvirt/dnsmasq total 24 drwxr-xr-x 2 root root 4096 Oct 11 03:46 . drwxr-xr-x 7 root root 4096 Oct 11 02:00 .. -rw-r--r-- 1 root root 0 Oct 11 02:01 default.addnhosts -rw------- 1 root root 619 Oct 11 02:01 default.conf -rw-r--r-- 1 root root 0 Oct 11 02:01 default.hostsfile -rw-r--r-- 1 root root 0 Oct 11 03:25 docker-machines.addnhosts -rw------- 1 root root 688 Oct 11 03:25 docker-machines.conf -rw-r--r-- 1 root root 0 Oct 11 03:25 docker-machines.hostsfile -rw-r--r-- 1 root root 85 Oct 11 03:46 virbr0.macs -rw-r--r-- 1 root root 0 Oct 11 01:02 virbr0.status -rw-r--r-- 1 root root 85 Oct 11 03:46 virbr1.macs -rw-r--r-- 1 root root 0 Oct 11 03:25 virbr1.status
The text was updated successfully, but these errors were encountered: