0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenShift Virtualization (OCP-V) - Edit VM - Network

Last updated at Posted at 2025-04-25

OpenShift Virtualization

Red Hat® OpenShift® Virtualization は Red Hat OpenShift に含まれる機能であり、組織が新規および既存の仮想マシン (VM) ワークロードを実行およびデプロイするための先進的なプラットフォームを提供します。このソリューションにより、従来の仮想マシンを、信頼できる、一貫した包括的なハイブリッドクラウド・アプリケーション・プラットフォームに簡単に移行できます。

OpenShift Virtualization は、VM の移行を単純化するとともに、クラウドネイティブ・アプリケーション・プラットフォームのシンプルさと速度を利用してインフラストラクチャのモダナイゼーションの道筋を提供します。また、先進的な管理の原則を取り入れつつ既存の仮想化への投資を維持することを目指しており、Red Hat の包括的な仮想化ソリューションの基盤となります。

Edit VM

Network

OCP 4.17 Bare Metal 環境 OpenShift Virtualization (OCP-V) で Virtual Machine (VM) を編集してみます。ここでは以下の手順を参考に、作成済み VM を編集します。

Hot plugging secondary network interfaces

You can add or remove secondary network interfaces without stopping your virtual machine (VM). OpenShift Virtualization supports hot plugging and hot unplugging for secondary interfaces that use bridge binding and the VirtIO device driver. OpenShift Virtualization also supports hot plugging secondary interfaces that use SR-IOV binding.

Note
Hot unplugging is not supported for Single Root I/O Virtualization (SR-IOV) interfaces.

OCP Console から動的に Network を追加・削除することが出来ますが、VM 構成の更新時に Live Migration または VM 再起動が必要です。Live Migration は使用者が実施する必要があります。

OCP Console
Add Network

以下の VM を編集してみます。この VM は Live Migration 可能な状態で worker02 で稼働しています。

image.png

image.png

なお、現在の Network 設定は、画面表示の他に VirtualMachineInstance を参照する事もできます。

$ oc -o json get vmi rhel9-custom01-upload | jq -r '.status.interfaces[]'
{
  "infoSource": "domain, guest-agent",
  "interfaceName": "eth0",
  "ipAddress": "10.130.2.240",
  "ipAddresses": [
    "10.130.2.240"
  ],
  "mac": "02:27:1a:00:00:40",
  "name": "default",
  "queueCount": 1
}

Configuration Tab から Network を追加してみます。

image.png

画面上部に以下が表示され、変更の反映には Live Migration または VM 再起動が必要な事が分かります。

image.png

ここでは、Namerhel9-custom01-upload-additional01 としています。Modelvirtioe1000e が選択可能です。

Network は、以下の要領で予め設定しておいたものを選択する事ができます。

Configuring VM secondary network interfaces

Save ボタンを押すと、以下のような画面が表示されます。Live Migration は自動的には行われません。

image.png

image.png

手動で Live Migration を実行すると、以下のように変更が反映されます。

image.png

image.png

$ oc -o json get vmi rhel9-custom01-upload | jq -r '.status.interfaces[]'
{
  "infoSource": "domain, guest-agent",
  "interfaceName": "eth0",
  "ipAddress": "10.130.2.240",
  "ipAddresses": [
    "10.130.2.240"
  ],
  "mac": "02:27:1a:00:00:40",
  "name": "default",
  "queueCount": 1
}
{
  "infoSource": "domain, guest-agent, multus-status",
  "interfaceName": "eth1",
  "ipAddress": "172.16.21.25",
  "ipAddresses": [
    "172.16.21.25",
    "fe80::f8f1:4d92:5f84:caeb"
  ],
  "mac": "02:27:1a:00:00:60",
  "name": "rhel9-custom01-upload-additional01",
  "queueCount": 1
}

$ oc -o json get vm rhel9-custom01-upload | jq -r '.spec.template.spec.domain.devices.interfaces[]?'
{
  "macAddress": "02:27:1a:00:00:40",
  "masquerade": {},
  "model": "virtio",
  "name": "default"
}
{
  "bridge": {},
  "macAddress": "02:27:1a:00:00:60",
  "model": "virtio",
  "name": "rhel9-custom01-upload-additional01"
}
Delete Network

Delete を行うと、以下のような画面が表示されます。

image.png

Delete ボタンを押すと、追加時と同様のメッセージが表示されます。

image.png

image.png

手動で Live Migration を実行すると、以下のように変更が反映されます。

image.png

CLI

virtctl addinterface / virtctl removeinterface は使用できなくなったため、Manifest を直接編集する必要があります。

Note: virtctl addinterface and removeinterface commands are no longer available, hotplug/unplug interfaces is done by editing the VM spec template.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?