mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
86 lines
3.2 KiB
Plaintext
86 lines
3.2 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// microshift_install_bootc/microshift-install-running-bootc-image-in-VM.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="microshift-install-bootc-creating-vm_{context}"]
|
|
= Creating a virtual machine
|
|
|
|
You can create a virtual machine by using the {op-system-base-full} boot ISO image.
|
|
|
|
.Prerequisites
|
|
|
|
* You created the Kickstart file.
|
|
|
|
* You installed the {oc-first}.
|
|
|
|
* You have `redhat` credentials.
|
|
|
|
.Procedure
|
|
|
|
. Download the {op-system-base-full} boot ISO image from the link:https://developers.redhat.com/products/rhel/download[Download Red{nbsp}Hat Enterprise Linux].
|
|
|
|
. Copy the downloaded file to the `/var/lib/libvirt/images` directory.
|
|
|
|
. Configure the VMNAME environment variable with your value by running the following command:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
$ VMNAME=microshift-{product-version}-bootc
|
|
----
|
|
|
|
. Configure the NETNAME environment variable with your value by running the following command:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
$ NETNAME=default
|
|
----
|
|
|
|
. Create a {op-system-base} virtual machine with 2 cores, 2GB of RAM and 20GB of storage by running the following command:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
$ sudo virt-install \
|
|
--name ${VMNAME} \
|
|
--vcpus 2 \
|
|
--memory 2048 \
|
|
--disk path=/var/lib/libvirt/images/${VMNAME}.qcow2,size=20 \
|
|
--network network=${NETNAME},model=virtio \
|
|
--events on_reboot=restart \
|
|
--location /var/lib/libvirt/images/rhel-{op-system-version}-$(uname -m)-boot.iso \
|
|
--initrd-inject kickstart.ks \
|
|
--extra-args "inst.ks=file://kickstart.ks" \
|
|
--wait
|
|
----
|
|
+
|
|
[NOTE]
|
|
====
|
|
The `sudo virt-install` command uses the Kickstart file to pull a bootc image from the remote registry and install the {op-system-base} operating system.
|
|
====
|
|
|
|
. Log in to the virtual machine by using your `redhat` credentials.
|
|
|
|
.Verification
|
|
|
|
. Verify that all of the {microshift-short} pods are running without error by entering the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ watch sudo oc get pods -A \
|
|
--kubeconfig /var/lib/microshift/resources/kubeadmin/kubeconfig
|
|
----
|
|
+
|
|
.Example output
|
|
[source,text]
|
|
----
|
|
NAMESPACE NAME READY STATUS RESTARTS AGE
|
|
kube-system csi-snapshot-controller-7cfb9df49c-kc9dx 1/1 Running 0 31s
|
|
openshift-dns dns-default-rpnlt 2/2 Running 0 14s
|
|
openshift-dns node-resolver-rxvdk 1/1 Running 0 31s
|
|
openshift-ingress router-default-69cd7b5545-7zcw7 1/1 Running 0 29s
|
|
openshift-ovn-kubernetes ovnkube-master-c7hlh 4/4 Running 1 (16s ago) 31s
|
|
openshift-ovn-kubernetes ovnkube-node-mkpht 1/1 Running 1 (17s ago) 31s
|
|
openshift-service-ca service-ca-5d5d96459d-5pd5s 1/1 Running 0 28s
|
|
openshift-storage topolvm-controller-677cbfcdb9-28dqr 5/5 Running 0 31s
|
|
openshift-storage topolvm-node-6fzbl 3/3 Running 0 14s
|
|
---- |