From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 132A522ACD4 for ; Mon, 10 Mar 2025 14:18:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741616306; cv=none; b=Ezg5+AzBBfcCgb9/PDCjZjPnd1l/gOZmcGor2G5deTTPcOCeHrSqWKvHgXKGOkQKUOORNzpDIzcRQvEH/MQr/Nw8+T85t2JhW3/jG70OqYX7CSOTcaPohWUgaU0O/bu9Kmj2LnpZYgWbkqBojl6uDsiTuebJnJI3yRI+Z3qWwSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741616306; c=relaxed/simple; bh=OOyicJWmFBRavGaXy/mIM7C7J/TkiZG0O/WZtGmzGYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QV+G2UY0j9VxkEcTuvd4/MJpTMoRmrGgN/amwBPav2nz7EUVt6m0A8wXXkmT8FiBK1zk6hYJQHAfkEwAlk9WPN8q9NioB6MXpsMb3cZ7hsfUy7WZH/NpfKwZQDu0KSpQZLpwAho37DAbPkR5PVLHy1uUavB9Su8pky8hHQDE8ZM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CZvrg7tU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CZvrg7tU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF48DC4CEF0; Mon, 10 Mar 2025 14:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741616305; bh=OOyicJWmFBRavGaXy/mIM7C7J/TkiZG0O/WZtGmzGYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CZvrg7tUcB5bFUBmXil7i7pcuGPmgBxJXDE3zc8jRjMq1Z6L8T7+1nSr/RC8++jSL 5gHKfgSZjb7fgDGwC+mryrFgUnxgZ99vFKJdv96oT9F5PsJmNZpMhjgpiFfyLXTc2x WJhz58R3HDd7iuQZmAHX5R18MCMFPFg7+ebcc8WR8BxFkjfTTeHyZV2MHn1Afe+lIj na8dpIOstbFKMDdEmQvX3qMdRiX61h/BiiT8veWMo1hf05TbcuZOzoCMaMDH1YQxXG g/oERicSt2thL9xlmPd5DP0FQqtSL+WPqSsGKLMQjeJysbi3FJ5KKAYc08hF6PBw5e OUkT5gFg2EjUg== From: cel@kernel.org To: Luis Chamberlain , Chandan Babu R , Jeff Layton Cc: , Chuck Lever Subject: [PATCH v1 12/13] volume_group: Create a volume group on OCI nodes Date: Mon, 10 Mar 2025 10:18:12 -0400 Message-ID: <20250310141813.969325-13-cel@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310141813.969325-1-cel@kernel.org> References: <20250310141813.969325-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever On storage nodes (eg., nfsd, iscsi, smbd), pick up the extra block volumes, avoiding the root and data devices, and toss them into an volume group to use for shared storage. Signed-off-by: Chuck Lever --- .../volume_group/tasks/terraform/oci.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 playbooks/roles/volume_group/tasks/terraform/oci.yml diff --git a/playbooks/roles/volume_group/tasks/terraform/oci.yml b/playbooks/roles/volume_group/tasks/terraform/oci.yml new file mode 100644 index 000000000000..219e3d7edbfd --- /dev/null +++ b/playbooks/roles/volume_group/tasks/terraform/oci.yml @@ -0,0 +1,38 @@ +--- +# +# To guarantee idempotency, these steps have to generate the exact +# same physical_volumes list every time they are run. +# +# Skip the block device on which the root filesystem resides, and +# skip the device that is to be used for /data. These devices all +# show up under /dev/oracleoci/ . +# + +- name: Detect the root device + ansible.builtin.stat: + path: "/dev/oracleoci/oraclevda" + register: stat_output + +- name: Save the name of the root device + ansible.builtin.set_fact: + instance_root_device: "{{ stat_output.stat.lnk_source.split('/dev/').1 }}" + +- name: Detect the data device + ansible.builtin.stat: + path: "{{ data_device }}" + register: stat_output + +- name: Save the name of the data device + ansible.builtin.set_fact: + instance_data_device: "{{ stat_output.stat.lnk_source.split('/dev/').1 }}" + +- name: Add unused extra volumes to the volume list + ansible.builtin.set_fact: + physical_volumes: "{{ physical_volumes + ['/dev/' + item.key] }}" + when: + - item.value.model == "BlockVolume" + - item.key != instance_root_device + - item.key != instance_data_device + loop_control: + label: "Adding block device: /dev/{{ item.key }}" + with_dict: "{{ ansible_devices }}" -- 2.48.1