This is part 3 of a tutorial that demonstrates how to add OpenShift Virtualization 2.5 to an existing OpenShift 4.6 cluster and start a Fedora Linux VM inside that cluster.
Please refer to “Your First VM with OpenShift Virtualization Using the Web Console” for the introduction of this tutorial and for links to all of its parts, and refer to “Adding OpenShift Virtualization to Your OpenShift Cluster Using the Web Console” for part 2 of this tutorial.
Because this tutorial performs all actions using the OpenShift Web Console, you could follow it from any machine you use as a personal workstation, such as a Windows laptop. You do not require a shell prompt to type oc or kubectl commands.
You do not actually know that your installation of OpenShift Virtualization really works until you have a VM that is up and running. Before showing you how to create and start a virtual machine on OpenShift, this tutorial explains three prerequisite tasks:
1. Verifying how large a VM your cluster has capacity to run
2. Finding a small VM image, suitable for testing
3. Generating a SSH key pair to access your new VM
Check Memory Available on Your Nodes
It is a good idea to check how much memory you can realistically allocate for your VMs inside your cluster nodes. You may be surprised to find how much memory is already taken by cluster operators in a small test cluster.
Please rely on the written instructions more than on the screen captures. They are here mostly to provide you visual aid and assurance that you are on the correct page for each step.
Click Compute → Nodes to view the list of nodes of your cluster. Check the Memory column for your compute nodes (workers). It displays the used and total memory of each of them. Be aware that the total memory may be misleading because not all of it can be allocated to workflows. A small fraction of it, around 512GiB by default, is reserved for a node’s systemd services and static pods.
For master01, used memory is close to 7GiB, and a little more than 7GiB is available (discounting the reserved memory). I get similar numbers for master03 and master02 has about 10GiB available. It looks like I have sufficient capacity for one “standard” VM with 4GiB of memory per node, and I could even create one VM (and only one) with 8 GiB.
Please be aware that these numbers are not exact, and that they reflect the request capacity of active workloads, not the actual usage of memory and CPU. Each VM requests a bit more memory for its wrapper KVM container, and you do not want to request too close to 100% of the capacity of a node, to allow some room for applications with resource limits higher than their requests.
Finding a VM Image
The easiest way of creating a VM with OpenShift Virtualization is from a qcow2 VM image file available from an HTTP server. There are many of them available on the internet.
My choice is the Fedora 32 Cloud Base image for Openstack available at:
https://alt.fedoraproject.org/cloud/
- That page links to the Fedora Project mirror selector:
https://download.fedoraproject.org/pub/fedora/linux/releases/32/Cloud/x86_64/images/Fedora-Cloud-Base-32-1.6.x86_64.qcow2 - And for me it picks the following mirror:
http://fedora.c3sl.ufpr.br/linux/releases/32/Cloud/x86_64/images/Fedora-Cloud-Base-32-1.6.x86_64.qcow2
Other alternative sources of qcow2 VM images to play with are:
- CentOS-8-GenericCloud VM image at:
http://cloud.centos.org/centos/8/x86_64/images/ - OpenStack users may be familiar with the Cirros test VM images at: http://download.cirros-cloud.net/0.5.1/ (pick an img file)
If you have a web server available on your network that is accessible from your OpenShift cluster nodes, you can download the standard RHEL 8.2 qcow2 image from the Red Hat Customer Portal (https://access.redhat.com/downloads) and copy it to your web server.
Generating a SSH Key Pair
Most cloud-ready and OpenStack-ready qcow2 images are configured to allow only SSH key-based authentication, so if you do not have an SSH key pair, it is time to create one without a password.
Linux and Mac users would open a shell and use the ssh-keygen command. It saves the key pair in the id_rsa (private part) and id_rsa.pub (public part) files in your ~/.ssh folder unless you specify different file names.
If you have a GUI SSH client such as Putty, it should provide you a way of generating SSH key pairs, so you do not need a shell for that. Just be sure to know where the files are and which are the public and private parts. You need the public part to create a VM, and the private part to access it.
Next Steps
Now that you know how large your VMs can be, got a test qcow2 image, and created an SSH key pair, you can proceed to part 4 of this tutorial: “Creating a VM using the OpenShift Web Console.”
執筆者紹介
Fernando lives in Rio de Janeiro, Brazil, and works on Red Hat's certification training for OpenShift, containers, and DevOps.
チャンネル別に見る
自動化
テクノロジー、チームおよび環境に関する IT 自動化の最新情報
AI (人工知能)
お客様が AI ワークロードをどこでも自由に実行することを可能にするプラットフォームについてのアップデート
オープン・ハイブリッドクラウド
ハイブリッドクラウドで柔軟に未来を築く方法をご確認ください。
セキュリティ
環境やテクノロジー全体に及ぶリスクを軽減する方法に関する最新情報
エッジコンピューティング
エッジでの運用を単純化するプラットフォームのアップデート
インフラストラクチャ
世界有数のエンタープライズ向け Linux プラットフォームの最新情報
アプリケーション
アプリケーションの最も困難な課題に対する Red Hat ソリューションの詳細
オリジナル番組
エンタープライズ向けテクノロジーのメーカーやリーダーによるストーリー
製品
ツール
試用、購入、販売
コミュニケーション
Red Hat について
エンタープライズ・オープンソース・ソリューションのプロバイダーとして世界をリードする Red Hat は、Linux、クラウド、コンテナ、Kubernetes などのテクノロジーを提供しています。Red Hat は強化されたソリューションを提供し、コアデータセンターからネットワークエッジまで、企業が複数のプラットフォームおよび環境間で容易に運用できるようにしています。
言語を選択してください
Red Hat legal and privacy links
- Red Hat について
- 採用情報
- イベント
- 各国のオフィス
- Red Hat へのお問い合わせ
- Red Hat ブログ
- ダイバーシティ、エクイティ、およびインクルージョン
- Cool Stuff Store
- Red Hat Summit