From d4636c18835fc7abce1c7357d5742bf09443befb Mon Sep 17 00:00:00 2001 From: sbeskin Date: Wed, 15 Jan 2025 11:20:15 +0200 Subject: [PATCH] CNV-48102 --- _topic_maps/_topic_map.yml | 4 +-- _topic_maps/_topic_map_rosa.yml | 4 +-- .../virt-infer-instancetype-preference.adoc | 12 ++++++++- ...virt-creating-vms-from-instance-types.adoc | 13 ++++++++++ ...-creating-vms-from-rh-images-overview.adoc | 2 +- .../virt-create-vm-manifest-virtctl.adoc | 11 -------- .../virt-creating-vms-from-cli.adoc | 25 +++++++++++++++++++ 7 files changed, 54 insertions(+), 17 deletions(-) delete mode 100644 virt/creating_vms_advanced/creating_vms_cli/virt-create-vm-manifest-virtctl.adoc create mode 100644 virt/creating_vms_advanced/creating_vms_cli/virt-creating-vms-from-cli.adoc diff --git a/_topic_maps/_topic_map.yml b/_topic_maps/_topic_map.yml index 7539a71938..4f36f19555 100644 --- a/_topic_maps/_topic_map.yml +++ b/_topic_maps/_topic_map.yml @@ -4555,8 +4555,8 @@ Topics: - Name: Creating VMs using the CLI Dir: creating_vms_cli Topics: - - Name: Creating VMs using a VirtualMachine manifest - File: virt-create-vm-manifest-virtctl + - Name: Creating virtual machines from the command line + File: virt-creating-vms-from-cli - Name: Creating VMs by using container disks File: virt-creating-vms-from-container-disks - Name: Creating VMs by cloning PVCs diff --git a/_topic_maps/_topic_map_rosa.yml b/_topic_maps/_topic_map_rosa.yml index ea8a4f36cf..342466bc5b 100644 --- a/_topic_maps/_topic_map_rosa.yml +++ b/_topic_maps/_topic_map_rosa.yml @@ -1919,8 +1919,8 @@ Topics: - Name: Creating VMs using the CLI Dir: creating_vms_cli Topics: - - Name: Creating VMs using a VirtualMachine manifest - File: virt-create-vm-manifest-virtctl + - Name: Creating virtual machines from the command line + File: virt-creating-vms-from-cli - Name: Creating VMs by using container disks File: virt-creating-vms-from-container-disks - Name: Creating VMs by cloning PVCs diff --git a/modules/virt-infer-instancetype-preference.adoc b/modules/virt-infer-instancetype-preference.adoc index d17636e540..e9c091ab4c 100644 --- a/modules/virt-infer-instancetype-preference.adoc +++ b/modules/virt-infer-instancetype-preference.adoc @@ -18,7 +18,7 @@ You can use the `--infer-instancetype` and `--infer-preference` flags to infer w .Procedure -* To explicitly infer instance types from the volume used to boot the virtual machine, use the `--infer-instancetype` flag. To explicitly infer preferences, use the `--infer-preference` flag. The following command includes both flags: +* To explicitly infer instance types from the volume used to boot the VM, use the `--infer-instancetype` flag. To explicitly infer preferences, use the `--infer-preference` flag. The following command includes both flags: + [source,terminal] @@ -26,3 +26,13 @@ You can use the `--infer-instancetype` and `--infer-preference` flags to infer w $ virtctl create vm --volume-import type:pvc,src:my-ns/my-pvc --infer-instancetype --infer-preference ---- +* To infer an instance type or preference from a volume other than the volume used to boot the VM, use the `--infer-instancetype-from` and `--infer-preference-from` flags to specify any of the virtual machine's volumes. In the example below, the virtual machine boots from `volume-a` but infers the instancetype and preference from `volume-b`. ++ +[source,terminal] +---- +$ virtctl create vm \ + --volume-import=type:pvc,src:my-ns/my-pvc-a,name:volume-a \ + --volume-import=type:pvc,src:my-ns/my-pvc-b,name:volume-b \ + --infer-instancetype-from volume-b \ + --infer-preference-from volume-b +---- diff --git a/virt/creating_vm/virt-creating-vms-from-instance-types.adoc b/virt/creating_vm/virt-creating-vms-from-instance-types.adoc index b4435149e9..3f60c74fb7 100644 --- a/virt/creating_vm/virt-creating-vms-from-instance-types.adoc +++ b/virt/creating_vm/virt-creating-vms-from-instance-types.adoc @@ -20,3 +20,16 @@ include::modules/virt-about-instance-types.adoc[leveloffset=+1] include::modules/virt-common-instancetypes.adoc[leveloffset=+1] +[id="virt-specifying-instance-preference_{context}"] +== Specifying an instance type or preference + +You can specify an instance type, a preference, or both to define a set of workload sizing and runtime characteristics for reuse across multiple VMs. + +include::modules/virt-using-flags-specify.adoc[leveloffset=+2] + +include::modules/virt-infer-instancetype-preference.adoc[leveloffset=+2] + +include::modules/virt-inferfromvolume-labels.adoc[leveloffset=+2] + +include::modules/virt-creating-vm-instancetype.adoc[leveloffset=+1] + diff --git a/virt/creating_vms_advanced/creating_vms_advanced_web/virt-creating-vms-from-rh-images-overview.adoc b/virt/creating_vms_advanced/creating_vms_advanced_web/virt-creating-vms-from-rh-images-overview.adoc index 6810376806..3552d1176f 100644 --- a/virt/creating_vms_advanced/creating_vms_advanced_web/virt-creating-vms-from-rh-images-overview.adoc +++ b/virt/creating_vms_advanced/creating_vms_advanced_web/virt-creating-vms-from-rh-images-overview.adoc @@ -18,7 +18,7 @@ You can create virtual machines (VMs) from operating system images provided by R * xref:../../../virt/creating_vm/virt-creating-vms-from-instance-types.adoc#virt-creating-vms-from-instance-types[Creating a VM from an instance type by using the web console] -* xref:../../../virt/creating_vms_advanced/creating_vms_cli/virt-create-vm-manifest-virtctl.adoc#virt-create-vm-manifest-virtctl[Creating a VM from a `VirtualMachine` manifest by using the command line] +* xref:../../../virt/creating_vms_advanced/creating_vms_cli/virt-creating-vms-from-cli.adoc#virt-creating-vms-from-cli[Creating a VM from a `VirtualMachine` manifest by using the command line] [IMPORTANT] ==== diff --git a/virt/creating_vms_advanced/creating_vms_cli/virt-create-vm-manifest-virtctl.adoc b/virt/creating_vms_advanced/creating_vms_cli/virt-create-vm-manifest-virtctl.adoc deleted file mode 100644 index 461df36d2b..0000000000 --- a/virt/creating_vms_advanced/creating_vms_cli/virt-create-vm-manifest-virtctl.adoc +++ /dev/null @@ -1,11 +0,0 @@ -:_mod-docs-content-type: ASSEMBLY -[id="virt-create-vm-manifest-virtctl"] -= Creating manifests by using the virtctl tool -include::_attributes/common-attributes.adoc[] -:context: virt-create-vm-manifest-virtctl - -You can use the `virtctl` CLI utility to simplify creating manifests for VMs, VM instance types, and VM preferences. For more information, see xref:../../../virt/getting_started/virt-using-the-cli-tools.adoc#vm-manifest-creation-commands_virt-using-the-cli-tools[VM manifest creation commands]. - -//If you have a `VirtualMachine` manifest, you can create a VM from the xref:../../../virt/virtual_machines/creating_vms_rh/virt-creating-vms-from-cli.adoc#virt-creating-vms-from-cli[command line]. - -include::modules/virt-creating-vm-instancetype.adoc[leveloffset=+1] \ No newline at end of file diff --git a/virt/creating_vms_advanced/creating_vms_cli/virt-creating-vms-from-cli.adoc b/virt/creating_vms_advanced/creating_vms_cli/virt-creating-vms-from-cli.adoc new file mode 100644 index 0000000000..d1ef1a0d28 --- /dev/null +++ b/virt/creating_vms_advanced/creating_vms_cli/virt-creating-vms-from-cli.adoc @@ -0,0 +1,25 @@ +:_mod-docs-content-type: ASSEMBLY +[id="virt-creating-vms-from-cli"] += Creating virtual machines from the command line +include::_attributes/common-attributes.adoc[] +:context: virt-creating-vms-cli + +toc::[] + +You can create virtual machines (VMs) from the command line by editing or creating a `VirtualMachine` manifest. You can simplify VM configuration by using an xref:../../../virt/creating_vm/virt-creating-vms-from-instance-types.adoc#virt-creating-vms-from-instance-types[instance type] in your VM manifest. + +[NOTE] +==== +You can also xref:../../../virt/creating_vm/virt-creating-vms-from-instance-types.adoc#virt-creating-vms-from-instance-types[create VMs from instance types by using the web console]. +==== + +[id="creating-manifests-virtctl_{context}"] +== Creating manifests by using the virtctl tool + +You can use the `virtctl` CLI utility to simplify creating manifests for VMs, VM instance types, and VM preferences. For more information, see xref:../../../virt/getting_started/virt-using-the-cli-tools.adoc#vm-manifest-creation-commands_virt-using-the-cli-tools[VM manifest creation commands]. + +include::modules/virt-creating-vm-cli.adoc[leveloffset=+1] + +.Next steps + +* xref:../../../virt/managing_vms/virt-accessing-vm-ssh.adoc#virt-accessing-vm-ssh[Configuring SSH access to virtual machines] \ No newline at end of file