From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 24 Jan 2023 09:50:40 +0000 From: "Dr. David Alan Gilbert" Message-ID: References: <20230120085534-mutt-send-email-mst@kernel.org> <703d527f-de92-090c-6ce1-af0dec7de033@yandex-team.ru> <20230122030455-mutt-send-email-mst@kernel.org> <20230122093903-mutt-send-email-mst@kernel.org> <70c0f00a-7828-3ccf-c2ea-49aeef8693e9@yandex-team.ru> <20230122111618-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Re: [Virtio-fs] [PATCH] vhost-user-fs: add capability to allow migration List-Id: Development discussions about virtio-fs List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Stefan Hajnoczi , "Michael S. Tsirkin" , Anton Kuchin , qemu-devel@nongnu.org, virtio-fs@redhat.com, Markus Armbruster , Eric Blake , Juan Quintela , yc-core@yandex-team.ru * Stefan Hajnoczi (stefanha@gmail.com) wrote: > On Mon, 23 Jan 2023 at 14:54, Stefan Hajnoczi wrote: > > > > On Mon, Jan 23, 2023 at 06:27:23PM +0000, Dr. David Alan Gilbert wrote: > > > * Michael S. Tsirkin (mst@redhat.com) wrote: > > > > On Sun, Jan 22, 2023 at 06:09:40PM +0200, Anton Kuchin wrote: > > > > > > > > > > On 22/01/2023 16:46, Michael S. Tsirkin wrote: > > > > > > On Sun, Jan 22, 2023 at 02:36:04PM +0200, Anton Kuchin wrote: > > > > > > > > > This flag should be set when qemu don't need to worry about any > > > > > > > > > external state stored in vhost-user daemons during migration: > > > > > > > > > don't fail migration, just pack generic virtio device states to > > > > > > > > > migration stream and orchestrator guarantees that the rest of the > > > > > > > > > state will be present at the destination to restore full context and > > > > > > > > > continue running. > > > > > > > > Sorry I still do not get it. So fundamentally, why do we need this property? > > > > > > > > vhost-user-fs is not created by default that we'd then need opt-in to > > > > > > > > the special "migrateable" case. > > > > > > > > That's why I said it might make some sense as a device property as qemu > > > > > > > > tracks whether device is unplugged for us. > > > > > > > > > > > > > > > > But as written, if you are going to teach the orchestrator about > > > > > > > > vhost-user-fs and its special needs, just teach it when to migrate and > > > > > > > > where not to migrate. > > > > > > > > > > > > > > > > Either we describe the special situation to qemu and let qemu > > > > > > > > make an intelligent decision whether to allow migration, > > > > > > > > or we trust the orchestrator. And if it's the latter, then 'migrate' > > > > > > > > already says orchestrator decided to migrate. > > > > > > > The problem I'm trying to solve is that most of vhost-user devices > > > > > > > now block migration in qemu. And this makes sense since qemu can't > > > > > > > extract and transfer backend daemon state. But this prevents us from > > > > > > > updating qemu executable via local migration. So this flag is > > > > > > > intended more as a safety check that says "I know what I'm doing". > > > > > > > > > > > > > > I agree that it is not really necessary if we trust the orchestrator > > > > > > > to request migration only when the migration can be performed in a > > > > > > > safe way. But changing the current behavior of vhost-user-fs from > > > > > > > "always blocks migration" to "migrates partial state whenever > > > > > > > orchestrator requests it" seems a little dangerous and can be > > > > > > > misinterpreted as full support for migration in all cases. > > > > > > It's not really different from block is it? orchestrator has to arrange > > > > > > for backend migration. I think we just assumed there's no use-case where > > > > > > this is practical for vhost-user-fs so we blocked it. > > > > > > But in any case it's orchestrator's responsibility. > > > > > > > > > > Yes, you are right. So do you think we should just drop the blocker > > > > > without adding a new flag? > > > > > > > > I'd be inclined to. I am curious what do dgilbert and stefanha think though. > > > > > > Yes I think that's probably OK, as long as we use the flag for knowing > > > how to handle the discard bitmap as a proxy for the daemon knowing how > > > to handle *some* migrations; knowing which migrations is then the job > > > for the orchestrator to be careful of. > > > > I think the feature bit is not a good way to detect live migration > > support. vhost-user backends typically use libvhost-user, rust-vmm's > > vhost-user-backend crate, etc where this feature can be implemented for > > free. If the feature bit is advertized we don't know if the device > > implementation (net, blk, fs, etc) is aware of migration at all. > > I checked how bad the situation is. libvhost-user currently enables > LOG_ALL by default. :( > > So I don't think the front-end can use LOG_ALL alone to determine > whether or not migration is supported by the back-end. > > There are several existing back-ends based on libvhost-user that have > no concept of reconnection or migration but report the LOG_ALL feature > bit. Ouch, yes that's messy. Going back to the original question; I don't think a command line flag will work though, because even for a given VM there's the possibility of some (local) migrations working but other (remote) migrations not working; so you don't know at the point you start the VM whether your migrations are going to work. Dave > Stefan > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2EA8DC25B4E for ; Tue, 24 Jan 2023 09:51:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKFxN-0000LT-Ud; Tue, 24 Jan 2023 04:51:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKFx5-0000Kz-NB for qemu-devel@nongnu.org; Tue, 24 Jan 2023 04:50:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKFx2-00050Z-H8 for qemu-devel@nongnu.org; Tue, 24 Jan 2023 04:50:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674553846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8B4V8KSUHh+qyrsWknlUgKTa2GQHTtAZSFSdRcBsBZ8=; b=Cl60m+m6SX9/aEvp8WYKluZbAgWi+8q+WOgoCWU6DepGWl1aJHFthT1OeD4apf/DvI/6+w fnNflbOpzmLkqb75tpsOET6NE1oYEC5SdjXxacKepmOEW938LUh0ZSJFHdeaRBOrbCNqzO rhhFbv/oebArSTlCTlSj+VMsBDtwO2Q= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-538-GmKa_sonMs-VCHVyB9saAQ-1; Tue, 24 Jan 2023 04:50:44 -0500 X-MC-Unique: GmKa_sonMs-VCHVyB9saAQ-1 Received: by mail-wr1-f69.google.com with SMTP id l8-20020adfc788000000b002bdfe72089cso2489341wrg.21 for ; Tue, 24 Jan 2023 01:50:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8B4V8KSUHh+qyrsWknlUgKTa2GQHTtAZSFSdRcBsBZ8=; b=eGgxgkOcJ9MfW3Sy5ff/OOyKAENs3V+r6blKc5EBVBGAq/EYTp7DWVoKURdvVqp6DD qbfW5ZXC4lTBTTX8BGwfEnNxJng9pmUanmZwm/K52OpxkY8Fp3lu+kU7MD4a5qk4CHNc 3KSxoxwHEhWbWX0WkxC0hSRr9MxcY/FoTv9lNJ/nGoLSVLErMQQSedXCKbPtkFMTsCjy /jcPVox7hUHdOFlL+KzoNKwUxFg86+qdcJMs0pnjMCJl2r5P1E6LwCZzQ537zqYqxnom MAtWnKGVFxeUmySQOITQKFBbzwnx75p1cQwIz39NgU4yevz+p+wNuJPoYIZDlPX9nZZ0 z/8A== X-Gm-Message-State: AFqh2krXjmegrrs5isNhJh6+ePnV1J/gQfV1jUUDa5kY5t+5x+GCdzE/ e20nDTgChEfR1IBK/c77TnWXWACqvXd69KmFRuhjrPLYIynrjF0lHFf2yGLx5/E4jgWz9Gzdplr fuy77iTY73r1TyPc= X-Received: by 2002:a05:6000:a0a:b0:2be:5d57:ca19 with SMTP id co10-20020a0560000a0a00b002be5d57ca19mr13601654wrb.58.1674553843542; Tue, 24 Jan 2023 01:50:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXsubAwa1lP5ULy8/6Qk+pQtxhu03HrPrZZkLyz/5jXBUXJvuDxBI1uV182vNi81DCvZ3QT93Q== X-Received: by 2002:a05:6000:a0a:b0:2be:5d57:ca19 with SMTP id co10-20020a0560000a0a00b002be5d57ca19mr13601626wrb.58.1674553843218; Tue, 24 Jan 2023 01:50:43 -0800 (PST) Received: from work-vm (ward-16-b2-v4wan-166627-cust863.vm18.cable.virginm.net. [81.97.203.96]) by smtp.gmail.com with ESMTPSA id a2-20020a056000100200b002be50604c81sm1483696wrx.47.2023.01.24.01.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 01:50:42 -0800 (PST) Date: Tue, 24 Jan 2023 09:50:40 +0000 From: "Dr. David Alan Gilbert" To: Stefan Hajnoczi Cc: Stefan Hajnoczi , "Michael S. Tsirkin" , Anton Kuchin , qemu-devel@nongnu.org, virtio-fs@redhat.com, Markus Armbruster , Eric Blake , Juan Quintela , yc-core@yandex-team.ru Subject: Re: [PATCH] vhost-user-fs: add capability to allow migration Message-ID: References: <20230120085534-mutt-send-email-mst@kernel.org> <703d527f-de92-090c-6ce1-af0dec7de033@yandex-team.ru> <20230122030455-mutt-send-email-mst@kernel.org> <20230122093903-mutt-send-email-mst@kernel.org> <70c0f00a-7828-3ccf-c2ea-49aeef8693e9@yandex-team.ru> <20230122111618-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.9 (2022-11-12) Received-SPF: pass client-ip=170.10.133.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org * Stefan Hajnoczi (stefanha@gmail.com) wrote: > On Mon, 23 Jan 2023 at 14:54, Stefan Hajnoczi wrote: > > > > On Mon, Jan 23, 2023 at 06:27:23PM +0000, Dr. David Alan Gilbert wrote: > > > * Michael S. Tsirkin (mst@redhat.com) wrote: > > > > On Sun, Jan 22, 2023 at 06:09:40PM +0200, Anton Kuchin wrote: > > > > > > > > > > On 22/01/2023 16:46, Michael S. Tsirkin wrote: > > > > > > On Sun, Jan 22, 2023 at 02:36:04PM +0200, Anton Kuchin wrote: > > > > > > > > > This flag should be set when qemu don't need to worry about any > > > > > > > > > external state stored in vhost-user daemons during migration: > > > > > > > > > don't fail migration, just pack generic virtio device states to > > > > > > > > > migration stream and orchestrator guarantees that the rest of the > > > > > > > > > state will be present at the destination to restore full context and > > > > > > > > > continue running. > > > > > > > > Sorry I still do not get it. So fundamentally, why do we need this property? > > > > > > > > vhost-user-fs is not created by default that we'd then need opt-in to > > > > > > > > the special "migrateable" case. > > > > > > > > That's why I said it might make some sense as a device property as qemu > > > > > > > > tracks whether device is unplugged for us. > > > > > > > > > > > > > > > > But as written, if you are going to teach the orchestrator about > > > > > > > > vhost-user-fs and its special needs, just teach it when to migrate and > > > > > > > > where not to migrate. > > > > > > > > > > > > > > > > Either we describe the special situation to qemu and let qemu > > > > > > > > make an intelligent decision whether to allow migration, > > > > > > > > or we trust the orchestrator. And if it's the latter, then 'migrate' > > > > > > > > already says orchestrator decided to migrate. > > > > > > > The problem I'm trying to solve is that most of vhost-user devices > > > > > > > now block migration in qemu. And this makes sense since qemu can't > > > > > > > extract and transfer backend daemon state. But this prevents us from > > > > > > > updating qemu executable via local migration. So this flag is > > > > > > > intended more as a safety check that says "I know what I'm doing". > > > > > > > > > > > > > > I agree that it is not really necessary if we trust the orchestrator > > > > > > > to request migration only when the migration can be performed in a > > > > > > > safe way. But changing the current behavior of vhost-user-fs from > > > > > > > "always blocks migration" to "migrates partial state whenever > > > > > > > orchestrator requests it" seems a little dangerous and can be > > > > > > > misinterpreted as full support for migration in all cases. > > > > > > It's not really different from block is it? orchestrator has to arrange > > > > > > for backend migration. I think we just assumed there's no use-case where > > > > > > this is practical for vhost-user-fs so we blocked it. > > > > > > But in any case it's orchestrator's responsibility. > > > > > > > > > > Yes, you are right. So do you think we should just drop the blocker > > > > > without adding a new flag? > > > > > > > > I'd be inclined to. I am curious what do dgilbert and stefanha think though. > > > > > > Yes I think that's probably OK, as long as we use the flag for knowing > > > how to handle the discard bitmap as a proxy for the daemon knowing how > > > to handle *some* migrations; knowing which migrations is then the job > > > for the orchestrator to be careful of. > > > > I think the feature bit is not a good way to detect live migration > > support. vhost-user backends typically use libvhost-user, rust-vmm's > > vhost-user-backend crate, etc where this feature can be implemented for > > free. If the feature bit is advertized we don't know if the device > > implementation (net, blk, fs, etc) is aware of migration at all. > > I checked how bad the situation is. libvhost-user currently enables > LOG_ALL by default. :( > > So I don't think the front-end can use LOG_ALL alone to determine > whether or not migration is supported by the back-end. > > There are several existing back-ends based on libvhost-user that have > no concept of reconnection or migration but report the LOG_ALL feature > bit. Ouch, yes that's messy. Going back to the original question; I don't think a command line flag will work though, because even for a given VM there's the possibility of some (local) migrations working but other (remote) migrations not working; so you don't know at the point you start the VM whether your migrations are going to work. Dave > Stefan > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK