Date: Wed, 14 Dec 2022 08:28:06 +0100 From: Alexander Leidinger <Alexander@leidinger.net> To: "Bjoern A. Zeeb" <bz@freebsd.org>, Kristof Provost <kp@freebsd.org> Cc: freebsd-jail@freebsd.org Subject: Re: What's going on with vnets and epairs w/ addresses? Message-ID: <20221214082806.Horde.fnrSehaAFQsAtgLgj_MkKpA@webmail.leidinger.net> In-Reply-To: <5r22os7n-ro15-27q-r356-rps331o06so5@mnoonqbm.arg>
next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format and has been PGP signed. --=_u8b1FlGjBkWKpOnADRhAnyV Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting "Bjoern A. Zeeb" <bz@freebsd.org> (from Tue, 13 Dec 2022=20=20 23:03:42=20+0000 (UTC)): > Hi, > > I have used scripts like the below for almost a decade and a half > (obviously doing more than that in the middle). I haven't used them > much lately but given other questions I just wanted to fire up a test. > > I have an end-November kernel doing the below my eapirs do not come back > to be destroyed (immediately). > I have to start polling for the jid to be no longer alive and not in > dying state (hence added the jls/ifconfig -l lines and removed the > error checking from ifconfig destroy). That seems sometimes rather > unreasonably long (to the point I give up). > > If I don't configure the addresses below this isn't a problem. > > Sorry I am confused by too many incarnations of the code; I know I once > had a version with an async shutdown path but I believe that never made > it into mainline, so why are we holding onto the epairs now and not > nuking the addresses and returning them and are clean? Kristof, isn't this (epair destruction in jails) one of the issues you=20= =20 looked=20at? Sorry if I remember incorrectly. What I have in my jails-shutdown is to do an "ifconfig $epair_in_jail=20=20 -vnet=20$jail; sleep 2; ifconfig $epair destroy". With this I don't see=20= =20 any=20issues, Everything is cleaned up when the stop finishes. Bye, Alexander. > It's a bit more funny; I added a twiddle loop at the end and nothing > happened. So I stop the script and start it again and suddenly another > jail or two have cleaned up and their epairs are back. Something feels > very very wonky. Play around with this and see ... and let me know if > you can reproduce this... I quite wonder why some test cases haven't > gone crazy ... > > /bz > > ------------------------------------------------------------------------ > #!/bin/sh > > set -e > set -x > > js=3D`jail -i -c -n jl host.hostname=3Dleft.example.net vnet persist` > jb=3D`jail -i -c -n jr host.hostname=3Dright.example.net vnet persist` > > # Create an epair connecting the two machines (vnet jails). > ep=3D`ifconfig epair create | sed -e 's/a$//'` > > # Add one end to each vnet jail. > ifconfig ${ep}a vnet ${js} > ifconfig ${ep}b vnet ${jb} > > # Add an IP address on the epairs in each vnet jail. > # XXX Leave these out and the cleanup seems to work fine. > jexec ${js} ifconfig ${ep}a inet 192.0.2.1/24 > jexec ${jb} ifconfig ${ep}b inet 192.0.2.2/24 > > # Clean up. > jail -r ${jb} > jail -r ${js} > > # You want to be able to remove this line ... > set +e > > # No epairs to destroy with addresses configured; fine otherwise. > ifconfig ${ep}a destroy > # echo $? > > # Add this is here only as things are funny ... > # jls -av jid dying > # ifconfig -l > > # end > ------------------------------------------------------------------------ > > --=20 >=20Bjoern A. Zeeb r15:= 7 --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_u8b1FlGjBkWKpOnADRhAnyV Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIzBAABCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmOZewUACgkQEg2wmwP4 2Iaeww/5AQdUYL0r/txzh4ftRY9NNDRMeD9U3Dzkmn59JOg+1yRGAFtVRd5E2dq2 NMYHgweNDDkuDxfOt0fHpdlGRkxA2x6OeguKB0F3kJjuG0Le9wcuTdCm9meMoyt2 QBjATXHQjLHfSM2ZHWr4lZXdAb5cMRUExQjRwneXnxLoRo86yhMHabiul2ufc8KC AnlCbZjgrRE7hc56s6Is0FeUkVL/yW2T26jus9YGU/JjUoJ3IaPlnWnEWwqP5seg 1Kdv1JD7Q0Zf5ABMZ/pdDiWIQhU4PIFwECYDyKNDMoRAAr0S2sNdNwIRH/5h0tdV ihomEvCZB+N/GSPuQGtHH5n4eaC8M2FO2khwJxCoRBiOclzESOOaQ5ZUtusR42j7 xw9ceILQs2cF4dh2lnDnEI0wFZ6YqsnFTAG24yd2JUZEzWxAyWR+v4qB+7EhtB3f 7t/A5tbxZ3yshfofGVATwCJsWydX0B7KGnQjmE1EcbyEX2bsRl5sx00p0X1Kqw67 JqbKEcNxzQX3R6deV0XvT2anG+II1+OTRZq15fKOf2ftxneeuBSWk39VeFHij6M/ HKBLmKh5P0s/4CHZZtcynnM9XnUK/ktvMSqgmzJ+F0yRnBOpXFIeuCZj32FYIb3r eTldv+DvZaFmZ7/6cTadhkWBJAoFcfPiRMrOVUREacyRFWuVJUQ= =D9Bc -----END PGP SIGNATURE----- --=_u8b1FlGjBkWKpOnADRhAnyV--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20221214082806.Horde.fnrSehaAFQsAtgLgj_MkKpA>