Skip to content
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

"setting autostart for network default" fails linux/kvm2/libvirt #10297

Open
gdamjan opened this issue Jan 28, 2021 · 5 comments
Open

"setting autostart for network default" fails linux/kvm2/libvirt #10297

gdamjan opened this issue Jan 28, 2021 · 5 comments
Labels
co/kvm2-driver KVM2 driver related issues kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@gdamjan
Copy link

gdamjan commented Jan 28, 2021

Steps to reproduce the issue:

  1. libvirt 7.0.0
  2. minikube delete
  3. minikube start --interactive=true --container-runtime=cri-o

Full output of failed command:

😄  minikube v1.16.0 on Arch 
✨  Using the kvm2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating kvm2 VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🔥  Deleting "minikube" in kvm2 ...
🤦  StartHost failed, but will try again: creating host: create: Error creating machine: Error in driver during machine creation: ensuring active networks: setting autostart for network default: virError(Code=55, Domain=19, Message='Requested operation is not valid: cannot set autostart for transient network')
🔥  Creating kvm2 VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
😿  Failed to start kvm2 VM. Running "minikube delete" may fix it: creating host: create: Error creating machine: Error in driver during machine creation: ensuring active networks: setting autostart for network default: virError(Code=55, Domain=19, Message='Requested operation is not valid: cannot set autostart for transient network')

❌  Exiting due to GUEST_PROVISION: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: ensuring active networks: setting autostart for network default: virError(Code=55, Domain=19, Message='Requested operation is not valid: cannot set autostart for transient network')

😿  If the above advice does not help, please let us know: 
👉  https://github.com/kubernetes/minikube/issues/new/choose

** Some additional info **
the default network in my libvirt installation is a transient network bridge, i.e. it's defined outside of libvirt and "imported" into it. Even if I try to set it to "autostart" with libvirt tools, libvirt complains that it's not possible:

Error changing network settings: Requested operation is not valid: cannot set autostart for transient network

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/hostnets.py", line 328, in _net_apply
    net.set_autostart(auto)
  File "/usr/share/virt-manager/virtManager/object/network.py", line 89, in set_autostart
    self._backend.setAutostart(value)
  File "/usr/lib/python3.9/site-packages/libvirt.py", line 3241, in setAutostart
    if ret == -1: raise libvirtError ('virNetworkSetAutostart() failed', net=self)
libvirt.libvirtError: Requested operation is not valid: cannot set autostart for transient network

… so maybe minikube shouldn't try to configure the "default" network in libvirt when it is working perfectly fine?

@afbjorklund
Copy link
Collaborator

afbjorklund commented Jan 28, 2021

Currently it is not possible to "opt-out" of this, it is done for both default network and private network.

Having a toggle for it could work. Either to change the network names, or to skip the autostart feature.

        // always ensure autostart is set on the network
        autostart, err := n.GetAutostart()
        if err != nil {
                return errors.Wrapf(err, "checking network %s autostart", name)
        }
        if !autostart {
                if err := n.SetAutostart(true); err != nil {
                        return errors.Wrapf(err, "setting autostart for network %s", name)
                }
        }

        // always ensure the network is started (active)
        active, err := n.IsActive()
        if err != nil {
                return errors.Wrapf(err, "checking network status for %s", name)
        }
        if !active {
                if err := n.Create(); err != nil {
                        return errors.Wrapf(err, "starting network %s", name)
                }
        }

EDIT: We do have a --kvm--network flag, my bad.

      --kvm-hidden=false: Hide the hypervisor signature from the guest in minikube (kvm2 driver only)
      --kvm-network='default': The KVM network name. (kvm2 driver only)
      --kvm-qemu-uri='qemu:///system': The KVM QEMU connection URI. (kvm2 driver only)

@afbjorklund afbjorklund added co/kvm2-driver KVM2 driver related issues kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Jan 28, 2021
@gdamjan
Copy link
Author

gdamjan commented Jan 28, 2021

ok, I'm gonna take a look at it.

what would be the most similar option that does something like this?

@afbjorklund
Copy link
Collaborator

what would be the most similar option that does something like this?

Some kind of mix between kvm-network and kvm-hidden perhaps

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 28, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 28, 2021
@spowelljr spowelljr added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/kvm2-driver KVM2 driver related issues kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

No branches or pull requests

5 participants