From owner-freebsd-virtualization@freebsd.org Mon Aug 27 14:34:35 2018 Return-Path: Delivered-To: freebsd-virtualization@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 B1CF0108C1D2 for ; Mon, 27 Aug 2018 14:34:35 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B991736D2 for ; Mon, 27 Aug 2018 14:34:35 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x134.google.com with SMTP id z11-v6so12118295lff.9 for ; Mon, 27 Aug 2018 07:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=P7S4scJKt66rTV3PygK2EgT6tzpg1vvcH2TNuuvZ2Sk=; b=XI9pZoPMYoi8HixUO66RadODSpLLfxzsnF84DmbgHHP4vPBqNY8RP7I4ykcGk8xkxE eahZFULmcKv0YtQK7H7R71nz2nMveKJRwDPLpJhSgiJtaqf6JIvm7WgCFz2kSYmyjyu4 QrNxMiJBoUKy729c4e8TtcazAg7RkytnsVUX4yOog9VEj2H3vdHBnGSrY7lsgtkEfoxd ORqmjxhHHyIRC3ZlScVeHWv6Ig0waE4t3W8rhO496FngJ3UXCAwTbFf4+3djTCGyg+Cy nxxufb/NWpmytO6pSkG1sBi3KxRUL6wsFLVblq+8RTKBYN9WCLenZ5CZiwHuolejRH8w J+SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=P7S4scJKt66rTV3PygK2EgT6tzpg1vvcH2TNuuvZ2Sk=; b=fowtNWf50XDqeVx8iOneWIVfoiCPAyactIH+YodHCKXphMZ+UXsZEBKB7YhuBxXM0F IC0/woIhPN1g7xaPnuYtBz8AXigY6HeCCJwogGz5iMQlAYR/H08ltSbGpZ3EQ1Ou1FEd NRjdntyycQPSsoz04QLpsKriPwcML1qLnmTTDT5Xr+VFqvUmFJdf/ic/JlMuPAljZ0wu j574eMZ1bU5/eC/L5HOPvsWebZC7BBhqaQQeXzN/X0FdJykHMeNJRe3ekqlNmwAH7IPw hecw9jUFNSmb7/iQcKL+WEVIzrnEzR1jYeMo9l77gm0uplq1zoN+FDooKStOAYL0kv4d cUEg== X-Gm-Message-State: APzg51DBWAZMNxCknlKszFRCDioZ8mpziQ95e9waS5R+Qdc9AD9upl5I CkkxA6ilThLWSe6Jb4PrYsomDRtRgZ+/ni2GxFg= X-Google-Smtp-Source: ANB0VdbrQ9uKFNLI01c7/4bUwMwwnqrip9HX+dHBib2Bk9bk4bFaYALCza71fkOWIpyRBK8mjtTKU2cQ8kgOMU1yUf0= X-Received: by 2002:a19:6308:: with SMTP id x8-v6mr8317614lfb.140.1535380473813; Mon, 27 Aug 2018 07:34:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:1f4c:0:0:0:0:0 with HTTP; Mon, 27 Aug 2018 07:34:32 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: References: From: Marcelo Araujo Date: Mon, 27 Aug 2018 22:34:32 +0800 Message-ID: Subject: Re: on bhyve statistics To: Fabian Freyer Cc: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2018 14:34:35 -0000 Hi Fabian, 2018-08-27 22:14 GMT+08:00 Fabian Freyer : > Hi list, > > I'm currently looking at getting the libvirt prometheus exporter[1] to > work with libvirt+bhyve. In its current state this doesn't work because > at least one of the API calls exposed by libvirt isn't implemented by > the libvirt bhyve driver - so I started looking at implementing it. > > The first API call in question is virDomainBlockStats[2], which returns > statistics (number of read and written bytes and ops, respectively). > > Currently, bhyve does not expose any of these statistics. All the stats > available through bhyvectl --get-stats seem to be coming from the VMM, > not from the userspace emulation. OTOH, I did see that there are *some* > stats being collected in bhyverun.c (see struct bhyvestats {...} > stats;). I can't see how these are exposed though - a grep of /usr/src > turned up no other uses. Which brings me to the following questions: > > - are the stats in struct bhyvestats {...} stats exposed or used in any > non-obvious way? > They are most used inside bhyverun by the name "stats" and the purpose is not really to collect statistics about the guest vm. > > - architecturally, what would be the best ways to get stats out of the > user-space emulations? Off of the top of my head, I could think of the > following possibilities: > - prometheus exporter > - having some socket or pipe to request them > - DTrace probes > I don't know what kind of stats do you need to collect, but based on the assumptions you listed above, maybe you can take a look at this project: https://github.com/freenas/bhyve-vm-goagent bhyve-vm-goagent can easily be extended to collect other information from guest. Although I'm not sure if it will be useful for your case, looks like you are looking for something less intrusive than bhyve-vm-goagent. > > I wouldn't mind implementing any of the above, and so would like to know > which of these (or other options) would be the most acceptable, and > would appreciate some guidance. > > CC'ing novel@ for the libvirt side, and grehan@ for the architectural > bhyve questions. > > Fabian > > [1] https://github.com/kumina/libvirt_exporter > [2] https://libvirt.org/html/libvirt-libvirt-domain.html# > virDomainBlockStats > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization- > unsubscribe@freebsd.org" > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_)