From owner-freebsd-testing@freebsd.org Mon Mar 12 15:43:53 2018 Return-Path: Delivered-To: freebsd-testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F39DF50184 for ; Mon, 12 Mar 2018 15:43:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F301681BF2 for ; Mon, 12 Mar 2018 15:43:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x234.google.com with SMTP id e64-v6so12015186ita.5 for ; Mon, 12 Mar 2018 08:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=emcJtpFu2IR/apdiZDRGI+zgKOJIpyFnvnLEh/svCi4=; b=QjIrmAATlUzKdbZxfRwTesLnbJkqDy3rq+1NL3S01a6DdP8pro5KUGAURRcqiJp8Qt PwMlkZS1+9nO+VBqgCfCtAm2J0dMCWd5QbVL0j+Tedoj8PnnHNZfDDdAXsjpeKN7r16i TqE9TnSbIpO/IDtp3uZG0JkcD/2PVkXGxlLWpb5AZvfGPfZRXobTH6v6MhEoWMFoXdeD /pPLNszOOrzFX4RhtwOC2neVIjD6/nAq39VBXmPeYs6kA5ydNRR4uhKVorrbNsOaC0NV NwKPi62Sprl2KoGa+e6AygFFh3XzXVaJl3hmpmXXLRimXC72koTXGGHaj4r09P5JWQdt +JYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :mime-version:content-disposition:user-agent; bh=emcJtpFu2IR/apdiZDRGI+zgKOJIpyFnvnLEh/svCi4=; b=iCwqHJFDdf7OSQq87lJVtNT5rySpJFM7ErP9wmkUeyyPOkxHq/bGPI1G9l5U/2x+hY mlzIcvoMQR/HjRpVR+8WZuoxIlS38QBsne6rfRVfNK56t1Dqlid2aTJTkfjk/20hkzH5 8lYcoxpHPhnfU0v8md2jvcMRgQY6iAoFEX4Dq7/JYwTBc7f/HTB4JT3szpl5DMXht0nW 8O8TEU5bz9BOGPYkAtCB/L/2HxHOSlsdnUDZn3bDMv5IFuofvcawCEa/y0dKTDJMxiNG OH1DjU08wH+oZXzEmw/irn10nmseEVGru4/0kEBooKoSzdUoQLBLfo0wy5fUhB3MMfJR 2B/w== X-Gm-Message-State: AElRT7GG/rXe6hh6R2XN7ag90qeJHhP7wx+gXEiDExI/ZL4q6LD6RTn6 HRCVQpB7oGwEkPn199iBoM3ywA== X-Google-Smtp-Source: AG47ELsXBTDM1ctFdYgRgh+mnOO7y2Qm8Y6yI9dY1uSmpsuy1u9EMpDpjQVIZtFG8QRFigCFSUsGNQ== X-Received: by 10.36.84.79 with SMTP id t76mr9014751ita.47.1520869431888; Mon, 12 Mar 2018 08:43:51 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id k6sm5104170ioc.75.2018.03.12.08.43.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 08:43:50 -0700 (PDT) Sender: Mark Johnston Date: Mon, 12 Mar 2018 11:43:46 -0400 From: Mark Johnston To: freebsd-testing@FreeBSD.org Subject: automatically provisioning a bhyve test VM Message-ID: <20180312154346.GA97195@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 15:43:53 -0000 Hi, I have some tests for FreeBSD's kernel dump code that I'd like to make more robust. They use bhyve to test a variety of combinations of kernel dump configurations: e.g., full dump vs. minidump, encryption, compression, dump device block size, etc.. Each test triggers a kernel panic and dump, and upon reboot opens the dump in kgdb, in the VM, to get some confidence that the dump is valid. I use sysutils/vm-bhyve to simplify some aspects of VM management, and that works pretty well. I use some hacks to configure networking for the VM, and this is the part that I don't like. The tests run on the host and use ssh to run commands in the VM. For this to work, I need to hardcode an IP for the guest and for the bridge to which the guest's tap interface is connected, which of course only works if those IPs aren't already somehow in use by the host. I'd prefer something that makes zero assumptions about the host and just provides the bare minimum needed to establish a private communication channel to run commands on the guest (which includes getting the output and exit status of said commands). Ideally this would still involve assigning private IPv4 addresses to each side since I'd like to expand my test suite to cover netdump, which makes it possible for a panicking kernel to transmit a dump to a remote host. Does anyone have any suggestions for a more elegant way to go about this? Does anyone else automatically provision and tear down bhyve VMs as part of a test suite? From owner-freebsd-testing@freebsd.org Mon Mar 12 20:57:36 2018 Return-Path: Delivered-To: freebsd-testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C910BF49F80 for ; Mon, 12 Mar 2018 20:57:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D35A71FD9; Mon, 12 Mar 2018 20:57:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x229.google.com with SMTP id w16-v6so4330932lfc.13; Mon, 12 Mar 2018 13:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2fYd371wLY7IEnl0jCeEHX9IpInfITCHFasMUUWL/ZY=; b=VqBqG/74f9/duJZRDjAcVlFohnhb8afZClGXh73PiOMPIvMIAeK9mhCwzokpggrG8y zuu2WLTAhUGgQpKBMScHlf8lro+HALed6D1rII3MpYmoLrKPpgy7yN4hWcBddPf1OFBS yuSjxjYR6wwICTqdLqODTsZbt4t7E/0X1pSB4tzA21RTEDg4CCEUm+dtPhhc7qyDTcxx l/0M8BOvQhiEJujNiqrCunH2ixlOV8n7L3/pXHrJrN/69ySB93T9Awg8O3Q+dpb2buMr rVneXRkmdp5fLMOnqzM9if1/pLAbY0yWuh5VhKyeKf1G9A9qw6iZIPSv3viXPZDUkFWc DREA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2fYd371wLY7IEnl0jCeEHX9IpInfITCHFasMUUWL/ZY=; b=kugfLKTTlIZf8X+Y0E+LNZNcJWv/SO5poOb3jhax/nsm1EBkZgGqkKKX6CHj51OpZ4 WLQDgS8nvB+1jBGRTP5KBKq3pHf/akZmZJINm9YfgS3V3P6eVO3xJ/69hiAensW8A/hJ 4A44W9RuxhA5BHPSYyYXt63GQZdcKUdEH1/pePfNGLXsFIdl1Z0ysw6lYlkiCef/qe2J LkozTlamUXRzLWuG4J7UZeYqg9oK4SFfKaASCYVwbbEXWCWhc2BFalHfD0d136N7HW2E Ng1GXb+TUK/sMBx7ko5FFdvuA078l2I2HrA+fNtUOMRHiX0V4OZG0S1CCU7oD6xsp8Cx eNEQ== X-Gm-Message-State: AElRT7E+EAblh4pYfYXVAHi/x22ResCdOw864DUSPdi57jOno2NO4e6a QiK1ZaafDdR0KDjf4lI+/96pGpf5vyIUhY3p2kc= X-Google-Smtp-Source: AG47ELvM6+yRUo0QeKAIgQP+uoIr3bJxl4Wyv3P+/iNyxw2D7z5btn6xMxGyWpK9VvpT9MOXLbevJfLrAJ2zozjdS6Y= X-Received: by 2002:a19:b593:: with SMTP id g19-v6mr6420626lfk.47.1520888253106; Mon, 12 Mar 2018 13:57:33 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Mon, 12 Mar 2018 13:57:32 -0700 (PDT) In-Reply-To: <20180312154346.GA97195@raichu> References: <20180312154346.GA97195@raichu> From: Alan Somers Date: Mon, 12 Mar 2018 14:57:32 -0600 X-Google-Sender-Auth: M8eJl1ZQCk5g8kLvbyanWOCj74E Message-ID: Subject: Re: automatically provisioning a bhyve test VM To: Mark Johnston Cc: "freebsd-testing@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 20:57:36 -0000 On Mon, Mar 12, 2018 at 9:43 AM, Mark Johnston wrote: > Hi, > > I have some tests for FreeBSD's kernel dump code that I'd like to make > more robust. They use bhyve to test a variety of combinations of kernel > dump configurations: e.g., full dump vs. minidump, encryption, > compression, dump device block size, etc.. Each test triggers a kernel > panic and dump, and upon reboot opens the dump in kgdb, in the VM, to > get some confidence that the dump is valid. > > I use sysutils/vm-bhyve to simplify some aspects of VM management, and > that works pretty well. I use some hacks to configure networking for the > VM, and this is the part that I don't like. The tests run on the host > and use ssh to run commands in the VM. For this to work, I need to > hardcode an IP for the guest and for the bridge to which the guest's tap > interface is connected, which of course only works if those IPs aren't > already somehow in use by the host. I'd prefer something that makes zero > assumptions about the host and just provides the bare minimum needed to > establish a private communication channel to run commands on the guest > (which includes getting the output and exit status of said commands). > Ideally this would still involve assigning private IPv4 addresses to > each side since I'd like to expand my test suite to cover netdump, which > makes it possible for a panicking kernel to transmit a dump to a remote > host. Does anyone have any suggestions for a more elegant way to go > about this? Does anyone else automatically provision and tear down bhyve > VMs as part of a test suite? > _______________________________________________ > freebsd-testing@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-testing > To unsubscribe, send any mail to "freebsd-testing-unsubscribe@freebsd.org" > Could you use the virtual serial port instead of a virtual network? That would eliminate the assumption about a suitable IP address for the guest. You could also try using an IPv6-only guest with a link-local address. Thanks to IPv6's scoping rules, this would be guaranteed not to interfere with any other interface on the host, so long as you don't bridge it. -Alan From owner-freebsd-testing@freebsd.org Mon Mar 12 21:33:23 2018 Return-Path: Delivered-To: freebsd-testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B00B4F4CC8D for ; Mon, 12 Mar 2018 21:33:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C26774925; Mon, 12 Mar 2018 21:33:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x236.google.com with SMTP id w63so13098834ita.3; Mon, 12 Mar 2018 14:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gKCUeGWsfZBYrdmMXB3ZBtPZu+VtzOGVjAguDCdtODg=; b=jQY/MDNhxnCTNfjw+ZHT3+fBdzaNjDhU3gUP3hXvwTKVvfWCvsjZcoS4l3V9bEb2/T qXQCTGTmFKFyDaefpVMPaO6fEHAAdp6LxRGkKuq/Li4VVdQMFCZmP3cGLfa93K2WDhdO fNrorI0qCETym7Uv6NEXgdzNbrgKOU26np9VlIFOeg3slbDTfSMsh0THOM/67ShQVCc1 3eZdHcihiLVNjOQAdOpctnlgu+2hZU15I60nGtjiVeUNbm70ZNAqWnBMTtxz3swZk8+K 03TQ1tgGyDuuv2wSO+ithMe4LMXkiw4UX4R+K1N5t4maFesdaNmkxMCaZWVbqB9j1yR3 SbaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=gKCUeGWsfZBYrdmMXB3ZBtPZu+VtzOGVjAguDCdtODg=; b=J7I/oaExhZjpXIhfXgWUD2h/v6H558X+N45gkWyStpFec8vb2H0F2hOpEWGR19rKsw 8epxW3KxFspMOcXqCNhpXHmd8V2xAkK3X0nRHiJ1TxUiVqSITk/XhjB9Iggoypo0WML1 homOi3sfWyjrtakWIq/Mwy0ni0c+T+dot4hEjWwcPdfEzwxxaTune6A5lUUrOc3k/Wxm T05PA249kKreTpbNoaJahvQsnkwvlW692KvPFBOPry+R1o32SM2csBWjToV6JNWuEW4c 4liLT50kMmTH7BAb4iBrne0mMX3CSDT+oSZQoO08trYnY4hhwvExD0pqbD32SRuIXMCt AD5Q== X-Gm-Message-State: AElRT7FXAhH6SfOr1gFco08NaYjiSFYo6S9YPLYXwWUplkhPDrZnzgy7 sLJc6vY8VYaghmNfhotcNV9BJw== X-Google-Smtp-Source: AG47ELuiDP3yWgcGAFphpeSDL7+Nb0kEdWQy/AzaDHlkmmzcEd7nE+pPJygudiWMpvU2M3gRo4xQBg== X-Received: by 10.36.79.12 with SMTP id c12mr10312159itb.37.1520890402156; Mon, 12 Mar 2018 14:33:22 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id 195sm4169215itm.13.2018.03.12.14.33.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 14:33:21 -0700 (PDT) Sender: Mark Johnston Date: Mon, 12 Mar 2018 17:33:19 -0400 From: Mark Johnston To: Alan Somers Cc: "freebsd-testing@freebsd.org" Subject: Re: automatically provisioning a bhyve test VM Message-ID: <20180312213319.GB97195@raichu> References: <20180312154346.GA97195@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:33:23 -0000 On Mon, Mar 12, 2018 at 02:57:32PM -0600, Alan Somers wrote: > On Mon, Mar 12, 2018 at 9:43 AM, Mark Johnston wrote: > > > Hi, > > > > I have some tests for FreeBSD's kernel dump code that I'd like to make > > more robust. They use bhyve to test a variety of combinations of kernel > > dump configurations: e.g., full dump vs. minidump, encryption, > > compression, dump device block size, etc.. Each test triggers a kernel > > panic and dump, and upon reboot opens the dump in kgdb, in the VM, to > > get some confidence that the dump is valid. > > > > I use sysutils/vm-bhyve to simplify some aspects of VM management, and > > that works pretty well. I use some hacks to configure networking for the > > VM, and this is the part that I don't like. The tests run on the host > > and use ssh to run commands in the VM. For this to work, I need to > > hardcode an IP for the guest and for the bridge to which the guest's tap > > interface is connected, which of course only works if those IPs aren't > > already somehow in use by the host. I'd prefer something that makes zero > > assumptions about the host and just provides the bare minimum needed to > > establish a private communication channel to run commands on the guest > > (which includes getting the output and exit status of said commands). > > Ideally this would still involve assigning private IPv4 addresses to > > each side since I'd like to expand my test suite to cover netdump, which > > makes it possible for a panicking kernel to transmit a dump to a remote > > host. Does anyone have any suggestions for a more elegant way to go > > about this? Does anyone else automatically provision and tear down bhyve > > VMs as part of a test suite? > > _______________________________________________ > > freebsd-testing@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-testing > > To unsubscribe, send any mail to "freebsd-testing-unsubscribe@freebsd.org" > > > > Could you use the virtual serial port instead of a virtual network? That > would eliminate the assumption about a suitable IP address for the guest. Is there an easy way to programmatically run commands over that serial port from the host? > You could also try using an IPv6-only guest with a link-local address. > Thanks to IPv6's scoping rules, this would be guaranteed not to interfere > with any other interface on the host, so long as you don't bridge it. I'd thought a bit about this, but there's also a discoverability problem in that I'd need a way for the host to figure out the guest's link-local address without talking to the guest. The serial port might let me work around this though. From owner-freebsd-testing@freebsd.org Tue Mar 13 00:31:26 2018 Return-Path: Delivered-To: freebsd-testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F20BA7BA6E for ; Tue, 13 Mar 2018 00:31:26 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFCD17C296; Tue, 13 Mar 2018 00:31:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id q69-v6so26023638lfi.10; Mon, 12 Mar 2018 17:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=N7mLGXG4EiTzBwoLDhwNztqAx94e14eGwDnQAQNyeHU=; b=lqTZziOnNIDYWB0tAt722R6ad7o+65BoYIKNCWrRGtg9Imw9QnOLcLm6ZKQpNnXbJj 7gbRgiDzZe7/dqNXvbhCLUq5PTQmZWpq+IgTyi/zdNT3LDTHnPFa2dDV9qcQiPOV75Y2 Ecnb5kk1PfJt37oxP+DcAFuHgcZOD/rqinkCoLyu9q3oX9dRd6kAKX9Lh4ByC8ZgatXD 1IMIOwNENn6r45JDpXj0SgbWBQhQpez1oc4X4uH6IO6Ttuzug1eeoQXwd30stVY+/ZRJ eGur72FTFKVJkinedx26CgHgexASVTEO/Rdwzj1j/lGW6hyHvdChJehRw7L2zPQtCIXD W75A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=N7mLGXG4EiTzBwoLDhwNztqAx94e14eGwDnQAQNyeHU=; b=ZXSKThPBC6L6k5pQCE47k/hDUQQVbv3e4xqmX55zDp82+dZhProKW/VgDBS/jaNoqn eMplLYIYoXtfYUsoX0M3YlJa6lRvIBTdoX5cj5j17OmtNKbHlmsdVxC0MUlZZIkxYgXq A8mj+dCqvsEsuQSc2LncHLco1pEicEFk6zYM55kSISCsPfkU6y0ryby4yuWFD+QRAU0a WgqntGeiMFb5ju5/vB71t+Qmffk2K4EHI9QV8YY+ppGLiaYS9nTpevC9f4kylNHB8O+f 8mWMCXr4HuTA/wXSjAN2jXBV6f8H4ZQC7VuHnJhiaOZt+yKZF8mKS6+r3rFSajM/LxQr akNw== X-Gm-Message-State: AElRT7GroGrRo7d3HB6d6sjwQJAhGlUgBjltWwZcw7vsGs3RwYqmGug9 nG7V7kehLGsyp+m/Fh8dkfh9Q0Mr8qiZ6FA7zvk= X-Google-Smtp-Source: AG47ELuV40u8AUQGgGwJ2QnBQjrDGR/0Ynz4fY5xOK5oI+hyZ3hkx9beYyHFPEenRtyNMEMPsh/ehLmabTXAOkHGHdI= X-Received: by 10.46.77.135 with SMTP id c7mr710773ljd.116.1520901083127; Mon, 12 Mar 2018 17:31:23 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Mon, 12 Mar 2018 17:31:22 -0700 (PDT) In-Reply-To: <20180312213319.GB97195@raichu> References: <20180312154346.GA97195@raichu> <20180312213319.GB97195@raichu> From: Alan Somers Date: Mon, 12 Mar 2018 18:31:22 -0600 X-Google-Sender-Auth: UBmHVixbbs51Nb2z0wyB48i6LtI Message-ID: Subject: Re: automatically provisioning a bhyve test VM To: Mark Johnston Cc: "freebsd-testing@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 00:31:26 -0000 On Mon, Mar 12, 2018 at 3:33 PM, Mark Johnston wrote: > On Mon, Mar 12, 2018 at 02:57:32PM -0600, Alan Somers wrote: > > On Mon, Mar 12, 2018 at 9:43 AM, Mark Johnston > wrote: > > > > > Hi, > > > > > > I have some tests for FreeBSD's kernel dump code that I'd like to make > > > more robust. They use bhyve to test a variety of combinations of kernel > > > dump configurations: e.g., full dump vs. minidump, encryption, > > > compression, dump device block size, etc.. Each test triggers a kernel > > > panic and dump, and upon reboot opens the dump in kgdb, in the VM, to > > > get some confidence that the dump is valid. > > > > > > I use sysutils/vm-bhyve to simplify some aspects of VM management, and > > > that works pretty well. I use some hacks to configure networking for > the > > > VM, and this is the part that I don't like. The tests run on the host > > > and use ssh to run commands in the VM. For this to work, I need to > > > hardcode an IP for the guest and for the bridge to which the guest's > tap > > > interface is connected, which of course only works if those IPs aren't > > > already somehow in use by the host. I'd prefer something that makes > zero > > > assumptions about the host and just provides the bare minimum needed to > > > establish a private communication channel to run commands on the guest > > > (which includes getting the output and exit status of said commands). > > > Ideally this would still involve assigning private IPv4 addresses to > > > each side since I'd like to expand my test suite to cover netdump, > which > > > makes it possible for a panicking kernel to transmit a dump to a remote > > > host. Does anyone have any suggestions for a more elegant way to go > > > about this? Does anyone else automatically provision and tear down > bhyve > > > VMs as part of a test suite? > > > _______________________________________________ > > > freebsd-testing@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/freebsd-testing > > > To unsubscribe, send any mail to "freebsd-testing-unsubscribe@ > freebsd.org" > > > > > > > Could you use the virtual serial port instead of a virtual network? That > > would eliminate the assumption about a suitable IP address for the guest. > > Is there an easy way to programmatically run commands over that serial > port from the host? > Um, you could try expect? > > > You could also try using an IPv6-only guest with a link-local address. > > Thanks to IPv6's scoping rules, this would be guaranteed not to interfere > > with any other interface on the host, so long as you don't bridge it. > > I'd thought a bit about this, but there's also a discoverability problem > in that I'd need a way for the host to figure out the guest's link-local > address without talking to the guest. The serial port might let me work > around this though. > That's what mDNS is for. Or, since there won't be any unexpected neighbors, you could simply assign link-local addresses statically. Nobody ever said that a link local address _must_ be automatically generated. -Alan