lxd
lxd copied to clipboard
Add required=false option for nic devices with an unavailable parent
Required information
- Distribution: Ubuntu
- Distribution version: 20.04 ("Focal Fossa")
- Kernel version: 5.15.x (x86_64, aarch64)
- LXC, LXD version: 5.3
Issue description
If a container uses a network which is unavailable, it cannot be started (even if additional, available networks exist).
It would be helpful to be able to mark certain networks (network types?) – in my case: an OVN network – as required: "false"
like with devices/disk paths so that it's not necessary to modify the container's configuration in order to bring it up after, e.g., rebooting the host machine. (Note that running containers are "unaffected" if the network becomes unavailable.)
Steps to reproduce
- Ensure that a certain network used by one or more containers is available
- Start all containers
- Bring down the network in question (while all containers from the previous step are still up)
- Stop and try to restart one of the above containers; the last step will now fail:
Error: Failed pre-start check for device "eth0": Network "ovn01" unavailable on this server
If no one else has taken this issue, I would like to try to tackle it. It would help me considerably if you could show me where are the related files and any tips.
Thanks assigned to you.
If you look for the PreStartCheck()
functions in the code base, you'll see some of the NICs have this bit:
// If managed network is not available, don't try and start instance.
if d.network.LocalStatus() == api.StoragePoolStatusUnvailable {
return api.StatusErrorf(http.StatusServiceUnavailable, "Network %q unavailable on this server", d.network.Name())
}
You'll need to introduce a NIC device setting called required
(similar to the disk
one here https://linuxcontainers.org/lxd/docs/master/instances/#type-disk) that defaults to true
if not specified. If set to false
then you can skip the check in PreStartCheck() and then in Start()
if the network isn't available just return nil
.
@bakhtiar56 perhaps you would like to look at this one as it looks like @SooryR has not been available to do it.
sure, I would love to tackle it.
Hi! Is this issue still open to be worked on? My partner and I are students from UT Austin, and we were wondering if we could tackle this as a good first issue for our virtualization class?
@bakhtiar56 are you ok for @jxie0615 to take this one?
sure
Sincerely Bakhtiar Rasheed
From: Tom Parrott @.> Sent: Friday, February 17, 2023 11:42:36 PM To: lxc/lxd @.> Cc: Bakhtiar Rasheed @.>; Mention @.> Subject: Re: [lxc/lxd] Add required=false option for nic devices with an unavailable parent (Issue #10660)
@bakhtiar56https://github.com/bakhtiar56 are you ok for @jxie0615https://github.com/jxie0615 to take this one?
— Reply to this email directly, view it on GitHubhttps://github.com/lxc/lxd/issues/10660#issuecomment-1435087411, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATLWB7Y6TXPR4D4KRADBPD3WX7BBZANCNFSM53KKIZAA. You are receiving this because you were mentioned.Message ID: @.***>
Hi,
Forgive me for not having extensive knowledge on lxc, but is there a way to easily bring down a network made by lxc?
@jeffreyxie0615 which network/nic type are you working on first? ovn
?
Yes! I'm currently working on ovn.
Cleared assignment due to inactivity