가상화
OpenShift Virtualization 설치, 사용법, 릴리스 정보
초록
1장. 정보
1.1. OpenShift Virtualization 정보
OpenShift Virtualization의 기능 및 지원 범위에 대해 알아보십시오.
1.1.1. OpenShift Virtualization으로 수행할 수 있는 작업
OpenShift Virtualization은 컨테이너 워크로드와 함께 가상 머신 워크로드를 실행하고 관리할 수 있는 OpenShift Container Platform의 애드온입니다.
OpenShift Virtualization은 Kubernetes 사용자 지정 리소스를 사용하여 가상화 작업을 활성화하여 OpenShift Container Platform 클러스터에 새 개체를 추가합니다. 다음과 같은 가상화 작업이 지원됩니다.
- Linux 및 Windows VM(가상 머신) 생성 및 관리
- 클러스터에서 서로 함께 Pod 및 VM 워크로드 실행
- 다양한 콘솔 및 CLI 툴을 통해 가상 머신에 연결
- 기존 가상 머신 가져오기 및 복제
- 가상 머신에 연결된 네트워크 인터페이스 컨트롤러 및 스토리지 디스크 관리
- 노드 간 실시간 가상 머신 마이그레이션
향상된 웹 콘솔에서 제공되는 그래픽 포털을 통해 OpenShift Container Platform 클러스터 컨테이너 및 인프라와 함께 가상화 리소스를 관리할 수 있습니다.
OpenShift Virtualization은 Red Hat OpenShift Data Foundation 기능과 원활하게 작동하도록 설계 및 테스트되었습니다.
OpenShift Data Foundation을 사용하여 OpenShift Virtualization을 배포할 때 Windows 가상 머신 디스크용 전용 스토리지 클래스를 생성해야 합니다. 자세한 내용은 Windows VM용 ODF PersistentVolume 최적화 를 참조하십시오.
OVN-Kubernetes,OpenShift SDN 또는 인증된 OpenShift CNI 플러그인에 나열된 다른 인증 네트워크 플러그인 중 하나와 함께 OpenShift Virtualization을 사용할 수 있습니다.
Compliance Operator 를 설치하고 ocp4-moderate
및 ocp4-moderate-node
프로필 을 사용하여 검사를 실행하여 OpenShift Virtualization 클러스터에서 규정 준수 문제를 확인할 수 있습니다. Compliance Operator는 NIST 인증 툴 인 OpenSCAP을 사용하여 보안 정책을 검사하고 적용합니다.
1.1.1.1. OpenShift Virtualization 지원 클러스터 버전
OpenShift Container Platform 4.15 클러스터에서 사용할 수 있도록 OpenShift Virtualization 4.15가 지원됩니다. OpenShift Virtualization의 최신 z-stream 릴리스를 사용하려면 먼저 OpenShift Container Platform의 최신 버전으로 업그레이드해야 합니다.
1.1.2. 가상 머신 디스크의 볼륨 및 액세스 모드 정보
알려진 스토리지 공급자와 스토리지 API를 사용하는 경우 볼륨 및 액세스 모드가 자동으로 선택됩니다. 그러나 스토리지 프로필이 없는 스토리지 클래스를 사용하는 경우 볼륨 및 액세스 모드를 구성해야 합니다.
최상의 결과를 얻으려면 RWX( ReadWriteMany
) 액세스 모드와 Block
볼륨 모드를 사용합니다. 이는 다음과 같은 이유로 중요합니다.
-
실시간 마이그레이션에는 RWX(
ReadWriteMany
) 액세스 모드가 필요합니다. 블록
볼륨 모드는Filesystem
볼륨 모드보다 훨씬 더 잘 작동합니다. 이는Filesystem
볼륨 모드가 파일 시스템 계층 및 디스크 이미지 파일을 포함하여 더 많은 스토리지 계층을 사용하기 때문입니다. 이러한 계층은 VM 디스크 스토리지에 필요하지 않습니다.예를 들어 Red Hat OpenShift Data Foundation을 사용하는 경우 CephFS 볼륨에 Ceph RBD 볼륨을 사용하는 것이 좋습니다.
다음 구성으로 가상 머신을 실시간 마이그레이션할 수 없습니다.
-
RWO(
ReadWriteOnce
) 액세스 모드가 있는 스토리지 볼륨 - GPU와 같은 패스스루 기능
이러한 가상 머신에 대해 evictionStrategy
필드를 None
으로 설정합니다. None
전략은 노드를 재부팅하는 동안 VM의 전원을 끕니다.
1.1.3. 단일 노드 OpenShift 차이점
단일 노드 OpenShift에 OpenShift Virtualization을 설치할 수 있습니다.
그러나 Single-node OpenShift는 다음 기능을 지원하지 않습니다.
- 고가용성
- Pod 중단
- 실시간 마이그레이션
- 제거 전략이 구성된 가상 머신 또는 템플릿
1.1.4. 추가 리소스
1.2. 보안 정책
OpenShift Virtualization 보안 및 권한 부여에 대해 알아보십시오.
키 포인트
-
OpenShift Virtualization은 Pod 보안을 위해 현재 모범 사례를 적용하는 것을 목표로
제한된
Kubernetes Pod 보안 표준 프로필을 준수합니다. - VM(가상 머신) 워크로드는 권한이 없는 Pod로 실행됩니다.
-
SCC( 보안 컨텍스트 제약 조건 )는
kubevirt-controller
서비스 계정에 대해 정의됩니다. - OpenShift Virtualization 구성 요소의 TLS 인증서는 자동으로 갱신되고 순환됩니다.
1.2.1. 워크로드 보안 정보
기본적으로 VM(가상 머신) 워크로드는 OpenShift Virtualization에서 root 권한으로 실행되지 않으며 루트 권한이 필요한 OpenShift Virtualization 기능이 없습니다.
각 VM에 대해 virt-launcher
Pod는 세션 모드에서 libvirt
인스턴스를 실행하여 VM 프로세스를 관리합니다. 세션 모드에서 libvirt
데몬은 루트가 아닌 사용자 계정으로 실행되며 동일한 사용자 식별자(UID)에서 실행 중인 클라이언트의 연결만 허용합니다. 따라서 VM은 권한이 없는 포드로 실행되며 최소 권한의 보안 원칙을 따릅니다.
1.2.2. TLS 인증서
OpenShift Virtualization 구성 요소의 TLS 인증서는 자동으로 갱신되고 순환됩니다. 수동으로 새로 고치지 않아도 됩니다.
자동 갱신 일정
TLS 인증서는 다음 일정에 따라 자동으로 삭제되고 교체됩니다.
- KubeVirt 인증서는 매일 갱신됩니다.
- CDI(Containerized Data Importer) 컨트롤러 인증서는 15일마다 갱신됩니다.
- MAC 풀 인증서는 매년 갱신됩니다.
자동 TLS 인증서 순환이 수행되어도 작업이 중단되지 않습니다. 예를 들면 다음 작업이 중단되지 않고 계속 수행됩니다.
- 마이그레이션
- 이미지 업로드
- VNC 및 콘솔 연결
1.2.3. 권한 부여
OpenShift Virtualization에서는 역할 기반 액세스 제어 (RBAC)를 사용하여 사용자 및 서비스 계정에 대한 권한을 정의합니다. 서비스 계정에 정의된 권한은 OpenShift Virtualization 구성 요소가 수행할 수 있는 작업을 제어합니다.
RBAC 역할을 사용하여 가상화 기능에 대한 사용자 액세스를 관리할 수도 있습니다. 예를 들어 관리자는 가상 머신을 시작하는 데 필요한 권한을 제공하는 RBAC 역할을 생성할 수 있습니다. 그러면 관리자가 특정 사용자에게 역할을 바인딩하여 액세스를 제한할 수 있습니다.
1.2.3.1. OpenShift Virtualization의 기본 클러스터 역할
클러스터 역할 집계를 사용하면 OpenShift Virtualization에서 기본 OpenShift Container Platform 클러스터 역할을 확장하여 가상화 오브젝트에 대한 액세스 권한을 포함합니다.
기본 클러스터 역할 | OpenShift Virtualization 클러스터 역할 | OpenShift Virtualization 클러스터 역할 설명 |
---|---|---|
|
| 클러스터의 모든 OpenShift Virtualization 리소스를 볼 수 있지만 생성, 삭제, 수정 또는 액세스할 수 없는 사용자입니다. 예를 들어 사용자는 VM(가상 머신)이 실행 중이지만 이를 종료하거나 콘솔에 액세스할 수 없음을 확인할 수 있습니다. |
|
| 클러스터의 모든 OpenShift Virtualization 리소스를 수정할 수 있는 사용자입니다. 예를 들어 사용자가 VM을 생성하고 VM 콘솔에 액세스한 후 VM을 삭제할 수 있습니다. |
|
|
리소스 컬렉션 삭제 기능을 포함하여 모든 OpenShift Virtualization 리소스에 대한 전체 권한이 있는 사용자입니다. 사용자는 |
1.2.3.2. OpenShift Virtualization의 스토리지 기능에 대한 RBAC 역할
cdi-operator
및 cdi-controller
서비스 계정을 포함하여 CDI(Containerized Data Importer)에 다음 권한이 부여됩니다.
1.2.3.2.1. 클러스터 전체 RBAC 역할
CDI 클러스터 역할 | Resources | verbs |
---|---|---|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
API 그룹 | Resources | verbs |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
허용 목록: |
|
|
허용 목록: |
|
|
|
|
API 그룹 | Resources | verbs |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.3.2.2. 네임스페이스가 지정된 RBAC 역할
API 그룹 | Resources | verbs |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
API 그룹 | Resources | verbs |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.3.3. kubevirt-controller 서비스 계정에 대한 추가 SCC 및 권한
SCC(보안 컨텍스트 제약 조건)는 Pod에 대한 권한을 제어합니다. 이러한 권한에는 컨테이너 모음인 Pod에서 수행할 수 있는 작업과 액세스할 수 있는 리소스가 포함됩니다. Pod가 시스템에 수용되려면 일련의 조건을 함께 실행해야 하는데, SCC를 사용하여 이러한 조건을 정의할 수 있습니다.
virt-controller
는 클러스터의 가상 머신에 대해 virt-launcher
Pod를 생성하는 클러스터 컨트롤러입니다. 이러한 Pod에는 kubevirt-controller
서비스 계정에서 권한을 부여합니다.
kubevirt-controller
서비스 계정에는 적절한 권한으로 virt-launcher
Pod를 생성할 수 있도록 추가 SCC 및 Linux 기능이 부여됩니다. 이러한 확장된 권한을 통해 가상 머신은 일반적인 Pod 범위를 벗어나는 OpenShift Virtualization 기능을 사용할 수 있습니다.
kubevirt-controller
서비스 계정에는 다음 SCC가 부여됩니다.
-
scc.AllowHostDirVolumePlugin = true
가상 머신에서 hostpath 볼륨 플러그인을 사용할 수 있습니다. -
scc.AllowPrivilegedContainer = false
virt-launcher Pod가 권한 있는 컨테이너로 실행되지 않습니다. scc.AllowedCapabilities = []corev1.Capability{"SYS_NICE", "NET_BIND_SERVICE"}
-
SYS_NICE
를 사용하면 CPU 선호도를 설정할 수 있습니다. -
NET_BIND_SERVICE
는 DHCP 및 Slirp 작업을 허용합니다.
-
kubevirt-controller에 대한 SCC 및 RBAC 정의 보기
oc
툴을 사용하여 kubevirt-controller
에 대한 SecurityContextConstraints
정의를 볼 수 있습니다.
$ oc get scc kubevirt-controller -o yaml
oc
툴을 사용하여 kubevirt-controller
clusterrole에 대한 RBAC 정의를 볼 수 있습니다.
$ oc get clusterrole kubevirt-controller -o yaml
1.2.4. 추가 리소스
1.3. OpenShift Virtualization Architecture
OLM(Operator Lifecycle Manager)은 OpenShift Virtualization의 각 구성 요소에 대해 Operator Pod를 배포합니다.
-
Compute:
virt-operator
-
스토리지:
cdi-operator
-
네트워크:
cluster-network-addons-operator
-
스케일링:
ssp-operator
-
템플릿:
tekton-tasks-operator
또한 OLM은 다른 구성 요소의 배포, 구성 및 라이프 사이클과 hco-webhook
및 하이퍼 컨버지드-cluster- cli-download 라는 여러 도우미 Pod를 담당하는
Pod를 배포합니다.
hyperconverged-cluster-
operator
모든 Operator Pod가 성공적으로 배포된 후 HyperConverged
CR(사용자 정의 리소스)을 생성해야 합니다. HyperConverged
CR에 설정된 구성은 단일 정보 소스 및 OpenShift Virtualization의 진입점 역할을 하며 CR의 동작을 안내합니다.
HyperConverged
CR은 조정 루프 내에서 다른 모든 구성 요소의 Operator에 대한 해당 CR을 생성합니다. 각 Operator는 OpenShift Virtualization 컨트롤 플레인에 대한 데몬 세트, 구성 맵 및 추가 구성 요소와 같은 리소스를 생성합니다. 예를 들어 HyperConverged Operator(HCO)가 KubeVirt
CR을 생성하면 OpenShift Virtualization Operator가 이를 조정하고 virt-controller
,virt-handler
, virt-api
와 같은 추가 리소스를 생성합니다.
OLM은 HPP(Hostpath Provisioner) Operator를 배포하지만 hostpath-provisioner
CR을 생성할 때까지 작동하지 않습니다.

1.3.1. HyperConverged Operator(HCO) 정보
HCO인 hco-operator
는 OpenShift Virtualization과 의견이 지정된 기본값을 사용하여 여러 도우미 운영자를 배포 및 관리하기 위한 단일 진입점을 제공합니다. 또한 해당 Operator에 대한 CR(사용자 정의 리소스)을 생성합니다.

Component | 설명 |
---|---|
|
|
|
클러스터에서 직접 다운로드할 수 있도록 |
| OpenShift Virtualization에 필요한 모든 Operator, CR 및 개체를 포함합니다. |
| 스케줄링, 스케일 및 성능(SSP) CR. 이는 HCO에 의해 자동으로 생성됩니다. |
| CDI(Containerized Data Importer) CR. 이는 HCO에 의해 자동으로 생성됩니다. |
|
|
1.3.2. CDI(Containerized Data Importer) Operator 정보
CDI Operator인 cdi-operator
는 데이터 볼륨을 사용하여 CDI 및 해당 관련 리소스를 관리하여 VM(가상 머신) 이미지를 PVC(영구 볼륨 클레임)로 가져옵니다.

Component | 설명 |
---|---|
| 보안 업로드 토큰을 발행하여 VM 디스크를 PVC에 업로드하는 권한을 관리합니다. |
| 올바른 PVC에 쓸 수 있도록 외부 디스크 업로드 트래픽을 적절한 업로드 서버 pod로 전달합니다. 유효한 업로드 토큰이 필요합니다. |
| 데이터 볼륨을 생성할 때 가상 머신 이미지를 PVC로 가져오는 도우미 Pod입니다. |
1.3.3. CNO(Cluster Network Addons) Operator 정보
Cluster Network Addons Operator인 cluster-network-addons-operator
는 클러스터에 네트워킹 구성 요소를 배포하고 확장된 네트워크 기능에 대한 관련 리소스를 관리합니다.

Component | 설명 |
---|---|
| Kubemacpool의 Webhook TLS 인증서를 관리합니다. |
| VM(가상 머신) 네트워크 인터페이스 카드(NIC)에 대한 MAC 주소 풀링 서비스를 제공합니다. |
| 노드에서 사용 가능한 네트워크 브릿지를 노드 리소스로 표시합니다. |
| 클러스터 노드에 CNI(Container Network Interface) 플러그인을 설치하여 네트워크 연결 정의를 통해 Linux 브리지에 VM을 연결할 수 있습니다. |
1.3.4. HPP(Hostpath Provisioner) Operator 정보
HPP Operator인 hostpath-provisioner-operator
는 다중 노드 HPP 및 관련 리소스를 배포 및 관리합니다.

Component | 설명 |
---|---|
| HPP가 실행되도록 지정된 각 노드에 대해 작업자를 제공합니다. Pod는 지정된 백업 스토리지를 노드에 마운트합니다. |
| HPP의 CSI(Container Storage Interface) 드라이버 인터페이스를 구현합니다. |
| HPP의 레거시 드라이버 인터페이스를 구현합니다. |
1.3.5. SSP(Scheduling, Scale, Performance) Operator 정보
SSP Operator, ssp-operator
는 공통 템플릿, 관련 기본 부팅 소스, 파이프라인 작업, 템플릿 검증기를 배포합니다.

Component | 설명 |
---|---|
| 템플릿에서 VM을 생성합니다. |
| VM 템플릿을 복사합니다. |
| VM 템플릿을 생성하거나 제거합니다. |
| 데이터 볼륨 또는 데이터 소스를 생성하거나 제거합니다. |
| VM에서 스크립트 또는 명령을 실행한 다음 VM을 중지하거나 삭제합니다. |
|
|
|
|
| 특정 VMI(가상 머신 인스턴스) 상태를 기다린 다음 해당 상태에 따라 실패하거나 성공합니다. |
| 매니페스트에서 VM을 생성합니다. |
1.3.6. OpenShift Virtualization Operator 정보
virt-operator
OpenShift Virtualization Operator는 현재 VM(가상 머신) 워크로드를 중단하지 않고 OpenShift Virtualization을 배포, 업그레이드 및 관리합니다.

Component | 설명 |
---|---|
| 모든 가상화 관련 흐름의 진입점 역할을 하는 HTTP API 서버입니다. |
|
새 VM 인스턴스 오브젝트 생성을 관찰하고 해당 Pod를 생성합니다. 노드에 Pod가 예약되면 |
|
VM에 대한 모든 변경 사항을 모니터링하고 |
|
|
2장. 릴리스 노트
2.1. OpenShift Virtualization 릴리스 정보
2.1.1. 보다 포괄적 수용을 위한 오픈 소스 용어 교체
Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 용어를 교체하기 위해 최선을 다하고 있습니다. 먼저 마스터(master), 슬레이브(slave), 블랙리스트(blacklist), 화이트리스트(whitelist) 등 네 가지 용어를 교체하고 있습니다. 이러한 변경 작업은 작업 범위가 크므로 향후 여러 릴리스에 걸쳐 점차 구현할 예정입니다. 자세한 내용은 CTO Chris Wright의 메시지를 참조하십시오.
2.1.2. 문서 피드백 제공
오류를 보고하거나 문서를 개선하기 위해 Red Hat Jira 계정에 로그인하여 Jira 문제를 제출하십시오.
2.1.3. Red Hat OpenShift Virtualization 정보
Red Hat OpenShift Virtualization을 사용하면 기존 VM(가상 머신)을 OpenShift Container Platform에 가져와서 컨테이너와 함께 실행할 수 있습니다. OpenShift Virtualization에서 VM은 OpenShift Container Platform 웹 콘솔 또는 명령줄을 사용하여 관리할 수 있는 기본 Kubernetes 오브젝트입니다.
OpenShift Virtualization은
아이콘으로 표시됩니다.
OVN-Kubernetes 또는 OpenShiftSDN 기본 CNI(Container Network Interface) 네트워크 공급자와 함께 OpenShift Virtualization을 사용할 수 있습니다.
OpenShift Virtualization으로 수행할 수 있는 작업에 대해 자세히 알아보십시오.
OpenShift Virtualization 아키텍처 및 배포에 대해 자세히 알아보십시오.
OpenShift Virtualization을 위한 클러스터를 준비합니다.
2.1.3.1. OpenShift Virtualization 지원 클러스터 버전
OpenShift Container Platform 4.15 클러스터에서 사용할 수 있도록 OpenShift Virtualization 4.15가 지원됩니다. OpenShift Virtualization의 최신 z-stream 릴리스를 사용하려면 먼저 OpenShift Container Platform의 최신 버전으로 업그레이드해야 합니다.
2.1.3.2. 지원되는 게스트 운영 체제
OpenShift Virtualization에서 지원되는 게스트 운영 체제를 보려면 Certified Guest Operating Systems in Red Hat OpenStack Platform, Red Hat Virtualization, OpenShift Virtualization 및 Red Hat Enterprise Linux with KVM 을 참조하십시오.
2.1.3.3. Microsoft Windows SVVP 인증
OpenShift Virtualization은 Microsoft의 Windows SVVP(서버 가상화 유효성 검사 프로그램)에서 Windows Server 워크로드를 실행하도록 인증되었습니다.
SVVP 인증은 다음에 적용됩니다.
- Red Hat Enterprise Linux CoreOS 작업자. SVVP 카탈로그에서는 RHEL CoreOS 9의 Red Hat OpenShift Container Platform 4로 이름이 지정됩니다.
- Intel 및 AMD CPU
2.1.4. 퀵스타트
여러 OpenShift Virtualization 기능에 대한 퀵스타트 둘러보기를 사용할 수 있습니다. 둘러보기를 보려면 OpenShift Container Platform 웹 콘솔의 헤더에 있는 메뉴 표시줄에서 도움말 아이콘 ? 을 클릭한 다음 빠른 시작을 선택합니다. 필터 필드에 키워드 가상화를
입력하여 사용 가능한 둘러보기를 필터링 할 수 있습니다.
2.1.5. 새로운 기능 및 변경된 기능
이 릴리스에는 다음 구성 요소 및 개념과 관련된 새로운 기능 및 개선 사항이 추가되었습니다.
2.1.5.1. 설치 및 업데이트
-
kubevirt_vm_created_total
메트릭을 사용하여 지정된 네임스페이스에 생성된 VM 수를 쿼리할 수 있습니다.
2.1.5.2. 인프라
-
이제
instanceType
API에서 더 안정적인v1beta1
버전을 사용합니다.
2.1.5.3. 가상화
- 이제 VM 게스트의 직렬 콘솔 로그에 대한 액세스를 활성화하여 문제 해결을 원활하게 수행할 수 있습니다. 이 기능은 기본적으로 비활성화되어 있습니다. 클러스터 관리자는 웹 콘솔 또는 CLI를 사용하여 VM의 기본 설정을 변경할 수 있습니다. 사용자는 클러스터 전체 기본 설정과 관계없이 개별 VM에서 게스트 로그 액세스를 전환할 수 있습니다.
- 무료 페이지 보고는 기본적으로 활성화되어 있습니다.
- 노드가 과부하될 때 커널 동일 페이지 병합(KSM)을 활성화 하도록 OpenShift Virtualization을 구성할 수 있습니다.
2.1.5.4. 네트워킹
- 보조 네트워크 인터페이스를 실행 중인 VM(가상 머신)에 핫플러그 할 수 있습니다. 핫플러그 및 핫 플러그는 OpenShift Virtualization 4.14 이상에서 생성된 VM에서만 지원됩니다. SR-IOV(Single Root I/O Virtualization) 인터페이스에 핫 연결 해제는 지원되지 않습니다.
- OpenShift Virtualization은 이제 OVN-Kubernetes 보조 네트워크의 localnet 토폴로지를 지원합니다. localnet 토폴로지는 보조 네트워크를 물리적 오버레이에 연결합니다. 이렇게 하면 east-west 클러스터 트래픽과 클러스터 외부에서 실행되는 서비스에 대한 액세스를 모두 사용할 수 있지만 클러스터 노드에서 기본 OVS(Open vSwitch) 시스템에 대한 추가 구성이 필요합니다.
-
OVN-Kubernetes 보조 네트워크는 VM로의 트래픽 흐름을 제어하기 위해
MultiNetworkPolicy
CRD(사용자 정의 리소스 정의)를 제공하는 다중 네트워크 정책 API 와 호환됩니다.ipBlock
속성을 사용하여 특정 CIDR 블록에 대한 네트워크 정책 수신 및 송신 규칙을 정의할 수 있습니다.
- SR-IOV에서 DPDK 워크로드에 대한 클러스터를 구성하는 것은 이전에는 기술 프리뷰였으며 이제 일반적으로 사용할 수 있습니다.
2.1.5.5. 스토리지
-
데이터 볼륨을 복제할 때 CDI(Containerized Data Importer)는 특정 사전 요구 사항이 충족되면 효율적인 CSI(Container Storage Interface) 복제를 선택합니다. 더 효율적인 방법인 호스트 지원 복제가 폴백으로 사용됩니다. 호스트 지원 복제가 사용된 이유를 이해하려면 복제된 PVC(영구 볼륨 클레임)에서
cdi.kubevirt.io/cloneFallbackReason
주석을 확인할 수 있습니다.
2.1.5.6. 웹 콘솔
- 볼륨 또는 PVC(영구 볼륨 클레임)에서 VM(가상 머신)을 생성하기 위해 사용자 지정 인스턴스 유형 및 기본 설정을 설치하고 편집하는 것은 이전에는 이전에는 기술 프리뷰였으며 일반적으로 사용할 수 있습니다.
- 이제 프리뷰 기능 탭은 가상화 → 개요 → 설정에서 확인할 수 있습니다.
여러 VM이 동일한 기본 스토리지를 공유할 수 있도록 일반 VM(가상 머신) 또는 LUN 지원 VM 디스크에 대한 디스크 공유를 구성할 수 있습니다. 공유할 모든 디스크는 블록 모드여야 합니다.
LUN 지원 블록 모드 VM 디스크를 여러 VM에서 공유할 수 있도록 하려면 클러스터 관리자가 SCSI
persistentReservation
기능 게이트를 활성화해야 합니다.자세한 내용은 가상 머신의 공유 볼륨 구성 을 참조하십시오.
- VirtualMachine 세부 정보 페이지의 구성 탭에서 VM 구성 설정을 검색할 수 있습니다.
- 이제 가상화 → 개요 → 설정 → 클러스터 → 일반 설정 → SSH 구성에서 NodePort 서비스를 통해 SSH 를 구성할 수 있습니다.
- 인스턴스 유형에서 VM을 생성할 때 OpenShift Container Platform 웹 콘솔의 볼륨 목록에 켜지어 선호하는 부팅 가능한 볼륨을 지정할 수 있습니다.
- 웹 콘솔을 사용하여 VM 대기 시간 점검을 실행할 수 있습니다. 사이드 메뉴에서 가상화 → 검사 → 네트워크 대기 시간을 클릭합니다. 첫 번째 검사를 실행하려면 권한 설치를 클릭한 다음 점검 실행을 클릭합니다.
- 웹 콘솔을 사용하여 스토리지 검증 점검을 실행할 수 있습니다. 사이드 메뉴에서 가상화 → 점검 → 스토리지를 클릭합니다. 첫 번째 검사를 실행하려면 권한 설치를 클릭한 다음 점검 실행을 클릭합니다.
- 웹 콘솔 을 사용하여 모든 클러스터 노드에 대해 커널 동일 페이지 병합(KSM) 활성화 기능을 활성화 하거나 비활성화할 수 있습니다.
- 웹 콘솔을 사용하여 SR-IOV(Single Root I/O Virtualization) 인터페이스를 실행 중인 VM(가상 머신)에 핫플러그할 수 있습니다.
- 이제 VM 생성 중 공개 SSH 키를 추가하거나 기존 VM에 보안을 추가할 때 다른 프로젝트의 기존 시크릿을 사용할 수 있습니다.
- OpenShift Container Platform 웹 콘솔 을 사용하여 OVN-Kubernetes localnet 토폴로지에 대한 네트워크 연결 정의(NAD)를 생성할 수 있습니다.
2.1.6. 사용되지 않거나 삭제된 기능
2.1.6.1. 더 이상 사용되지 않는 기능
더 이상 사용되지 않는 기능은 현재 릴리스에 포함되어 있으며 지원됩니다. 그러나 향후 릴리스에서 제거될 예정이므로 새로운 배포에는 사용하지 않는 것이 좋습니다.
-
tekton-tasks-operator
는 더 이상 사용되지 않으며 Tekton 작업과 예제 파이프라인은 이제ssp-operator
에서 배포합니다.
-
copy-template
,modify-vm-template
및create-vm-from-template
작업은 더 이상 사용되지 않습니다.
- Windows Server 2012 R2 템플릿에 대한 지원은 더 이상 사용되지 않습니다.
2.1.6.2. 삭제된 기능
제거된 기능은 현재 릴리스에서 지원되지 않습니다.
- 기존 HPP 사용자 정의 리소스 및 관련 스토리지 클래스에 대한 지원이 모든 새 배포에 대해 제거되었습니다. OpenShift Virtualization 4.15에서 HPP Operator는 Kubernetes CSI(Container Storage Interface) 드라이버를 사용하여 로컬 스토리지를 구성합니다. 레거시 HPP 사용자 지정 리소스는 이전 버전의 OpenShift Virtualization에 설치된 경우에만 지원됩니다.
- CentOS 7 및 CentOS 스트림 8은 이제 지원 종료 단계에 있습니다. 그 결과 이러한 운영 체제의 컨테이너 이미지가 OpenShift Virtualization에서 제거되었으며 더 이상 커뮤니티가 지원되지 않습니다.
2.1.7. 기술 프리뷰 기능
이 릴리스의 일부 기능은 현재 기술 프리뷰 단계에 있습니다. 이러한 실험적 기능은 프로덕션용이 아닙니다. 해당 기능은 Red Hat Customer Portal의 지원 범위를 참조하십시오.
- 이제 OpenShift Virtualization 호스트에서 중첩된 가상화를 활성화할 수 있습니다.
- 클러스터 관리자는 이제 개요 → 설정 → 클러스터 → 프리뷰 기능에 있는 OpenShift Container Platform 웹 콘솔의 네임스페이스에서 CPU 리소스 제한을 활성화할 수 있습니다.
2.1.8. 버그 수정
-
이전에는
volumeBindingMode
가WaitForFirstConsumer
로 설정된 스토리지 클래스로 시작할 때windows-efi-installer
파이프라인이 실패했습니다. 이번 수정에서는 파이프라인이 실패하는StorageClass
오브젝트의 주석을 제거합니다. (CNV-32287) -
이전 버전에서는
openshift-virtualization-os-images
네임스페이스에 제공된 데이터 소스를 사용하여 약 1000개의 VM(가상 머신)을 동시에 복제한 경우 일부 VM이 실행 중 상태로 이동되지 않았습니다. 이번 수정을 통해 다수의 VM을 동시에 복제할 수 있습니다. (CNV-30083) -
이전에는
install-config.yaml
파일에서networkType: OVNKubernetes
를 사용할 때 웹 콘솔에 표시되는NodePort
서비스 및 정규화된 도메인 이름(FQDN)을 사용하여 VM에 SSH를 수행할 수 없었습니다. 이번 업데이트를 통해 SSHNodePort
서비스에 대해 액세스 가능한 유효한 엔드포인트가 표시되도록 웹 콘솔을 구성할 수 있습니다. (CNV-24889) - 이번 업데이트를 통해 가상 디스크를 핫플러그한 후 VMI(가상 머신 인스턴스)에 대한 실시간 마이그레이션이 더 이상 실패하지 않습니다. (CNV-34761)
2.1.9. 확인된 문제
모니터링
네트워킹
노드
-
OpenShift Virtualization을 설치 제거해도 OpenShift Virtualization에서 생성한
feature.node.kubevirt.io
노드 레이블이 제거되지 않습니다. 레이블을 수동으로 제거해야 합니다. (CNV-38543)
- 컴퓨팅 노드가 다른 이기종 클러스터에서 HyperV 재조화가 활성화된 가상 머신은 TSC( timestamp-counter scaling)를 지원하지 않거나 적절한 TSC 빈도를 가진 노드에서 예약할 수 없습니다. (BZ#2151169)
스토리지
AWS에서 Portworx를 스토리지 솔루션으로 사용하고 VM 디스크 이미지를 생성하는 경우 두 번 고려되는 파일 시스템 오버헤드로 인해 생성된 이미지가 예상보다 작을 수 있습니다. (CNV-32695)
- 이 문제를 해결하려면 초기 프로비저닝 프로세스가 완료된 후 PVC(영구 볼륨 클레임)를 수동으로 확장하여 사용 가능한 공간을 늘릴 수 있습니다.
경우에 따라 여러 가상 머신이 읽기-쓰기 모드로 동일한 PVC를 마운트할 수 있으므로 데이터가 손상될 수 있습니다. (CNV-13500)
- 이 문제를 해결하려면 여러 VM이 있는 읽기-쓰기 모드에서 단일 PVC를 사용하지 마십시오.
csi-clone
복제 전략을 사용하여 100개 이상의 VM을 복제하면 Ceph CSI에서 복제본을 제거하지 못할 수 있습니다. 복제를 수동으로 삭제하는 경우에도 실패할 수 있습니다. (CNV-23501)-
이 문제를 해결하려면
ceph-mgr
을 다시 시작하여 VM 복제를 제거할 수 있습니다.
-
이 문제를 해결하려면
가상화
qemu-kvm
의 중요한 버그로 인해 디스크 핫플러그 작업 후 VM이 중단되고 I/O 오류가 발생했습니다. 이 문제는 핫 플러그 작업과 관련이 없는 운영 체제 디스크 및 기타 디스크에도 영향을 미칠 수 있습니다. 운영 체제 디스크가 작동을 중지하면 루트 파일 시스템이 종료됩니다. 자세한 내용은 Red Hat 지식 베이스에서 일부 추가 디스크를 핫플러그한 후 가상 머신의 디스크 액세스 권한 손실을 참조하십시오.중요패키지 버전 관리로 인해 OpenShift Virtualization을 4.13.z 또는 4.14.z에서 4.15.0으로 업데이트한 후 이 버그가 다시 표시될 수 있습니다.
-
Windows VM에 vTPM(가상 신뢰할 수 있는 플랫폼 모듈) 장치를 추가하면 vTPM 장치가 영구적이지 않은 경우에도 BitLocker 드라이브 암호화 시스템 검사가 통과됩니다. 이는 영구 저장소가 아닌 vTPM 장치는
virt-launcher
Pod의 수명 동안 임시 스토리지를 사용하여 암호화 키를 복구하기 때문입니다. VM이 마이그레이션되거나 종료되면 vTPM 데이터가 손실됩니다. (CNV-36448)
OpenShift Virtualization은 Pod에서 사용하는 서비스 계정 토큰을 해당 특정 Pod에 연결합니다. OpenShift Virtualization은 토큰이 포함된 디스크 이미지를 생성하여 서비스 계정 볼륨을 구현합니다. VM을 마이그레이션하면 서비스 계정 볼륨이 유효하지 않습니다. (CNV-33835)
- 이 문제를 해결하려면 사용자 계정 토큰이 특정 Pod에 바인딩되지 않으므로 서비스 계정 대신 사용자 계정을 사용합니다.
RHSA-2023:3722 권고가 릴리스되면서 TLS
확장 마스터 시크릿
(ECDSA) 확장(RFC 7627)은 FIPS 지원 Red Hat Enterprise Linux (RHEL) 9 시스템에서 TLS 1.2 연결에 필요합니다. 이는 FIPS-140-3 요구 사항에 따라 수행됩니다. TLS 1.3은 영향을 받지 않습니다.ECDSA 또는 TLS 1.3을 지원하지 않는 기존 OpenSSL 클라이언트는 이제 RHEL 9에서 실행되는 FIPS 서버에 연결할 수 없습니다. 마찬가지로 FIPS 모드의 RHEL 9 클라이언트는 ECDSA 없이 TLS 1.2만 지원하는 서버에 연결할 수 없습니다. 실제로 이러한 클라이언트는 RHEL 6, RHEL 7 및 비 RHEL 레거시 운영 체제의 서버에 연결할 수 없습니다. 이는 OpenSSL의 기존 1.0.x 버전이 ECDSA 또는 TLS 1.3을 지원하지 않기 때문입니다. 자세한 내용은 Red Hat Enterprise Linux 9.2에서 적용된 TLS 확장 "확장 마스터 시크릿" 을 참조하십시오.
-
이 문제를 해결하려면 기존 OpenSSL 클라이언트를 TLS 1.3을 지원하는 버전으로 업데이트하고 FIPS 모드의 경우
Modern
TLS 보안 프로필 유형으로 TLS 1.3을 사용하도록 OpenShift Virtualization을 구성합니다.
-
이 문제를 해결하려면 기존 OpenSSL 클라이언트를 TLS 1.3을 지원하는 버전으로 업데이트하고 FIPS 모드의 경우
웹 콘솔
OpenShift Container Platform 클러스터를 처음 배포할 때 웹 콘솔을 사용하여 템플릿 또는 인스턴스 유형에서 VM을 생성하면
cluster-admin
권한이 없는 경우 실패합니다.- 이 문제를 해결하려면 클러스터 관리자가 먼저 다른 사용자가 템플릿과 인스턴스 유형을 사용하여 VM을 생성할 수 있도록 구성 맵 을 생성해야 합니다. (링크: CNV-38284)
웹 콘솔을 사용하여 OVN-Kubernetes localnet 토폴로지에 대한 네트워크 연결 정의(NAD)를 생성하면 유효하지 않은 주석
k8s.v1.cni.cncf.io/resourceName: openshift.io/
가 표시됩니다. 이 주석은 VM을 시작할 수 없습니다.- 이 문제를 해결하려면 주석을 제거합니다.
3장. 시작하기
3.1. OpenShift Virtualization 시작하기
기본 환경을 설치하고 구성하여 OpenShift Virtualization의 기능 및 기능을 탐색할 수 있습니다.
클러스터 구성 절차에는 cluster-admin
권한이 필요합니다.
3.1.1. OpenShift Virtualization 계획 및 설치
OpenShift Container Platform 클러스터에 OpenShift Virtualization을 계획하고 설치합니다.
계획 및 설치 리소스
3.1.2. 가상 머신 생성 및 관리
VM(가상 머신)을 생성합니다.
Red Hat 템플릿 또는 인스턴스 유형을 사용하여 VM을 생성할 수 있습니다.
컨테이너 레지스트리 또는 웹 페이지에서 사용자 정의 이미지를 가져오거나, 로컬 머신에서 이미지를 업로드하거나 PVC(영구 볼륨 클레임)를 복제하여 VM을 생성할 수 있습니다.
VM을 보조 네트워크에 연결합니다.
- Linux 브리지 네트워크.
- OVN(가상 네트워크)-Kubernetes 보조 네트워크.
SR-IOV(Single Root I/O Virtualization) 네트워크.
참고VM은 기본적으로 Pod 네트워크에 연결됩니다.
VM에 연결합니다.
- VM의 직렬 콘솔 또는 VNC 콘솔에 연결합니다.
- SSH를 사용하여 VM에 연결합니다.
- Windows VM의 데스크탑 뷰어에 연결합니다.
VM을 관리합니다.
3.1.3. 다음 단계
3.2. virtctl 및 libguestfs CLI 툴 사용
virtctl
명령줄 툴을 사용하여 OpenShift Virtualization 리소스를 관리할 수 있습니다.
libguestfs
명령줄 툴을 사용하여 VM(가상 머신) 디스크 이미지에 액세스하고 수정할 수 있습니다. virtctl libguestfs
명령을 사용하여 libguestfs
를 배포합니다.
3.2.1. virtctl 설치
RHEL(Red Hat Enterprise Linux) 9, Linux, Windows 및 MacOS 운영 체제에 virtctl
을 설치하려면 virtctl
바이너리 파일을 다운로드하여 설치합니다.
RHEL 8에 virtctl
을 설치하려면 OpenShift Virtualization 리포지토리를 활성화한 다음 kubevirt-virtctl
패키지를 설치합니다.
3.2.1.1. RHEL 9, Linux, Windows 또는 macOS에 virtctl 바이너리 설치
OpenShift Container Platform 웹 콘솔에서 운영 체제의 virtctl
바이너리를 다운로드한 다음 설치할 수 있습니다.
프로세스
- 웹 콘솔의 가상화 → 개요 페이지로 이동합니다.
-
Download virtctl 링크를 클릭하여 운영 체제의
virtctl
바이너리를 다운로드합니다. install
virtctl
:RHEL 9 및 기타 Linux 운영 체제의 경우:
아카이브 파일의 압축을 풉니다.
$ tar -xvf <virtctl-version-distribution.arch>.tar.gz
다음 명령을 실행하여
virtctl
바이너리를 실행할 수 있도록 합니다.$ chmod +x <path/virtctl-file-name>
virtctl
바이너리를PATH
환경 변수의 디렉터리로 이동합니다.다음 명령을 실행하여 경로를 확인할 수 있습니다.
$ echo $PATH
KUBECONFIG
환경 변수를 설정합니다.$ export KUBECONFIG=/home/<user>/clusters/current/auth/kubeconfig
Windows의 경우:
- 아카이브 파일의 압축을 풉니다.
-
추출된 폴더 계층 구조로 이동하고
virtctl
실행 파일을 두 번 클릭하여 클라이언트를 설치합니다. virtctl
바이너리를PATH
환경 변수의 디렉터리로 이동합니다.다음 명령을 실행하여 경로를 확인할 수 있습니다.
C:\> path
macOS의 경우:
- 아카이브 파일의 압축을 풉니다.
virtctl
바이너리를PATH
환경 변수의 디렉터리로 이동합니다.다음 명령을 실행하여 경로를 확인할 수 있습니다.
echo $PATH
3.2.1.2. RHEL 8에 virtctl RPM 설치
OpenShift Virtualization 리포지토리를 활성화하고 kubevirt-virtctl
패키지를 설치하여 RHEL(Red Hat Enterprise Linux) 8에 virtctl
RPM 패키지를 설치할 수 있습니다.
사전 요구 사항
- 클러스터의 각 호스트는 RHSM(Red Hat Subscription Manager)에 등록되어 있어야 하며 유효한 OpenShift Container Platform 서브스크립션이 있어야 합니다.
프로세스
subscription-manager
CLI 툴을 사용하여 다음 명령을 실행하여 OpenShift Virtualization 리포지토리를 활성화합니다.# subscription-manager repos --enable cnv-4.15-for-rhel-8-x86_64-rpms
다음 명령을 실행하여
kubevirt-virtctl
패키지를 설치합니다.# yum install kubevirt-virtctl
3.2.2. virtctl 명령
virtctl
클라이언트는 OpenShift Virtualization 리소스를 관리하는 명령줄 유틸리티입니다.
VM(가상 머신) 명령은 별도로 지정하지 않는 한 VMI(가상 머신 인스턴스)에도 적용됩니다.
3.2.2.1. virtctl information 명령
virtctl
information 명령을 사용하여 virtctl
클라이언트에 대한 정보를 봅니다.
명령 | 설명 |
---|---|
|
|
|
|
| 특정 명령의 옵션 목록을 확인합니다. |
|
|
3.2.2.2. VM 정보 명령
virtctl
을 사용하여 VM(가상 머신) 및 VMI(가상 머신 인스턴스)에 대한 정보를 볼 수 있습니다.
명령 | 설명 |
---|---|
| 게스트 머신에서 사용 가능한 파일 시스템을 확인합니다. |
| 게스트 머신의 운영 체제에 대한 정보를 봅니다. |
| 게스트 머신에서 로그인한 사용자를 확인합니다. |
3.2.2.3. VM 매니페스트 생성 명령
virtctl create
명령을 사용하여 가상 머신, 인스턴스 유형 및 기본 설정에 대한 매니페스트를 생성할 수 있습니다.
명령 | 설명 |
---|---|
|
|
| VM 매니페스트를 생성하여 VM의 이름을 지정합니다. |
| 기존 클러스터 전체 인스턴스 유형을 사용하는 VM 매니페스트를 생성합니다. |
| 기존 네임스페이스 인스턴스 유형을 사용하는 VM 매니페스트를 생성합니다. |
| 클러스터 전체 인스턴스 유형에 대한 매니페스트를 생성합니다. |
| 네임스페이스가 지정된 인스턴스 유형에 대한 매니페스트를 생성합니다. |
| 클러스터 전체 VM 기본 설정에 대한 매니페스트를 생성하여 기본 설정 이름을 지정합니다. |
| 네임스페이스가 지정된 VM 기본 설정에 대한 매니페스트를 생성합니다. |
3.2.2.4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.2.2.5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.2.2.6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.2.2.7.
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type json -p '[{"op": "add", "path": "/spec/featureGates", \ "value": "HotplugVolumes"}]'
$ virtctl vmexport download <vmexport_name> --vm|pvc=<object_name> \ --volume=<volume_name> --output=<output_file>
|
|
|
|
|
|
3.2.2.8.
|
|
|
|
|
|
|
|
3.2.2.9.
|
|
|
|
3.2.3.
$ virtctl guestfs -n <namespace> <pvc_name> 1
3.2.3.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.1.
예 3.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.1.1.
예 3.2.
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.1.2.
예 3.3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.1.3.
예 3.4.
|
|
|
|
3.3.1.4.
예 3.5.
|
|
|
|
|
|
3.3.1.4.1.
예 3.6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.1.4.2.
예 3.7.
|
|
|
|
|
|
3.3.1.4.3.
3.3.2.
예 3.8.
|
|
|
|
3.3.2.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.2.2.
예 3.9.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.3.
예 3.10.
|
|
|
|
|
|
|
|
|
|
3.3.3.1.
예 3.11.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.3.1.1.
예 3.12.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.3.1.2.
예 3.13.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.3.1.3.
예 3.14.
|
|
|
|
|
|
|
|
3.3.3.1.4.
예 3.15.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.3.1.4.1.
예 3.16.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.3.1.4.2.
예 3.17.
|
|
|
|
|
|
|
|
|
|
|
|
3.3.3.1.4.3.
예 3.18.
|
|
|
|
|
|
|
|
3.3.3.1.4.4.
예 3.19.
|
|
|
|
|
|
|
|
|
|
|
|
3.3.3.1.4.5.
예 3.20.
|
|
|
|
3.3.3.1.4.6.
예 3.21.
|
|
|
|
3.3.3.1.4.7.
예 3.22.
|
|
|
|
3.3.3.1.5.
3.3.3.1.6.
예 3.23.
|
|
|
|
|
|
|
|
|
|
3.3.3.1.7.
예 3.24.
|
|
|
|
|
|
|
|
3.3.3.1.8.
예 3.25.
|
|
|
|
|
|
|
|
|
|
|
|
3.3.4.
예 3.26.
|
|
|
|
|
|
|
|
|
|
3.3.4.1.
예 3.27.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.4.1.1.
예 3.28.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.4.1.2.
예 3.29.
|
|
|
|
|
|
|
|
3.3.4.1.3.
예 3.30.
|
|
|
|
|
|
|
|
|
|
|
|
3.3.4.1.4.
예 3.31.
|
|
|
|
|
|
|
|
3.3.4.1.5.
예 3.32.
|
|
|
|
|
|
|
|
3.3.4.1.6.
예 3.33.
|
|
|
|
|
|
3.3.4.1.7.
예 3.34.
|
|
|
|
3.3.5.
예 3.35.
|
|
|
|
|
|
|
|
3.3.5.1.
예 3.36.
|
|
|
|
|
|
3.3.5.1.1.
예 3.37.
|
|
|
|
|
|
|
|
|
|
3.3.5.1.2.
예 3.38.
|
|
|
|
|
|
|
|
3.3.6.
예 3.39.
|
|
|
|
|
|
|
|
3.3.6.1.
예 3.40.
|
|
|
|
|
|
3.3.6.1.1.
예 3.41.
|
|
|
|
|
|
|
|
|
|
3.3.6.1.2.
예 3.42.
|
|
|
|
|
|
|
|
3.3.7.
예 3.43.
|
|
|
|
|
|
|
|
|
|
3.3.7.1.
예 3.44.
|
|
|
|
3.3.7.1.1.
예 3.45.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.7.1.2.
예 3.46.
|
|
|
|
|
|
|
|
3.3.8.
예 3.47.
|
|
|
|
|
|
|
|
3.3.8.1.
예 3.48.
|
|
|
|
|
|
3.3.8.1.1.
예 3.49.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.3.8.1.2.
예 3.50.
|
|
|
|
|
|
|
|
3.3.9.
예 3.51.
|
|
|
|
4장.
4.1.
4.1.1.
- 중요
4.1.1.1.
- 중요
4.1.2.
4.1.2.1.
- 참고
4.1.2.2.
- 참고
4.1.2.3.
4.1.2.3.1.
4.1.3.
- 참고
Product of (Maximum number of nodes that can drain in parallel) and (Highest total VM memory request allocations across nodes)
4.1.4.
Memory overhead per infrastructure node ≈ 150 MiB
Memory overhead per worker node ≈ 360 MiB
Memory overhead per virtual machine ≈ (1.002 × requested memory) \ + 218 MiB \ 1 + 8 MiB × (number of vCPUs) \ 2 + 16 MiB × (number of graphics devices) \ 3 + (additional memory overhead) 4
CPU overhead for infrastructure nodes ≈ 4 cores
CPU overhead for worker nodes ≈ 2 cores + CPU overhead per virtual machine
Aggregated storage overhead per node ≈ 10 GiB
4.1.5.
4.1.6.
4.1.7.
- 참고
- 참고
4.2.
4.2.1.
4.2.1.1.
- 주의
- 주의
4.2.1.2.
4.2.1.2.1.
apiVersion: v1 kind: Namespace metadata: name: openshift-cnv --- apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: kubevirt-hyperconverged-group namespace: openshift-cnv spec: targetNamespaces: - openshift-cnv --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: hco-operatorhub namespace: openshift-cnv spec: source: redhat-operators sourceNamespace: openshift-marketplace name: kubevirt-hyperconverged startingCSV: kubevirt-hyperconverged-operator.v4.15.8 channel: "stable" 1
$ oc apply -f <file name>.yaml
4.2.1.2.2.
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec:
$ oc apply -f <file_name>.yaml
$ watch oc get csv -n openshift-cnv
NAME DISPLAY VERSION REPLACES PHASE kubevirt-hyperconverged-operator.v4.15.8 OpenShift Virtualization 4.15.8 Succeeded
4.2.2.
4.3.
4.3.1.
4.3.1.1.
4.3.1.2.
- 참고
4.3.1.3.
4.3.1.4.
4.3.2.
$ oc delete HyperConverged kubevirt-hyperconverged -n openshift-cnv
$ oc delete subscription kubevirt-hyperconverged -n openshift-cnv
$ oc delete csv -n openshift-cnv -l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv
$ oc delete namespace openshift-cnv
$ oc delete crd --dry-run=client -l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv
customresourcedefinition.apiextensions.k8s.io "cdis.cdi.kubevirt.io" deleted (dry run) customresourcedefinition.apiextensions.k8s.io "hostpathprovisioners.hostpathprovisioner.kubevirt.io" deleted (dry run) customresourcedefinition.apiextensions.k8s.io "hyperconvergeds.hco.kubevirt.io" deleted (dry run) customresourcedefinition.apiextensions.k8s.io "kubevirts.kubevirt.io" deleted (dry run) customresourcedefinition.apiextensions.k8s.io "networkaddonsconfigs.networkaddonsoperator.network.kubevirt.io" deleted (dry run) customresourcedefinition.apiextensions.k8s.io "ssps.ssp.kubevirt.io" deleted (dry run) customresourcedefinition.apiextensions.k8s.io "tektontasks.tektontasks.kubevirt.io" deleted (dry run)
$ oc delete crd -l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv
5장.
5.1.
5.2.
5.2.1.
5.2.2.
$ oc edit <resource_type> <resource_name> -n {CNVNamespace}
5.2.3.
5.2.3.1.
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: hco-operatorhub
namespace: openshift-cnv
spec:
source: redhat-operators
sourceNamespace: openshift-marketplace
name: kubevirt-hyperconverged
startingCSV: kubevirt-hyperconverged-operator.v4.15.8
channel: "stable"
config:
nodeSelector:
example.io/example-infra-key: example-infra-value 1
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: hco-operatorhub
namespace: openshift-cnv
spec:
source: redhat-operators
sourceNamespace: openshift-marketplace
name: kubevirt-hyperconverged
startingCSV: kubevirt-hyperconverged-operator.v4.15.8
channel: "stable"
config:
tolerations:
- key: "key"
operator: "Equal"
value: "virtualization" 1
effect: "NoSchedule"
5.2.3.2.
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: infra: nodePlacement: nodeSelector: example.io/example-infra-key: example-infra-value 1 workloads: nodePlacement: nodeSelector: example.io/example-workloads-key: example-workloads-value 2
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: infra: nodePlacement: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: example.io/example-infra-key operator: In values: - example-infra-value 1 workloads: nodePlacement: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: example.io/example-workloads-key 2 operator: In values: - example-workloads-value preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 preference: matchExpressions: - key: example.io/num-cpus operator: Gt values: - 8 3
apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
name: kubevirt-hyperconverged
namespace: openshift-cnv
spec:
workloads:
nodePlacement:
tolerations: 1
- key: "key"
operator: "Equal"
value: "virtualization"
effect: "NoSchedule"
5.2.3.3.
apiVersion: hostpathprovisioner.kubevirt.io/v1beta1
kind: HostPathProvisioner
metadata:
name: hostpath-provisioner
spec:
imagePullPolicy: IfNotPresent
pathConfig:
path: "</path/to/backing/directory>"
useNamingPrefix: false
workload:
nodeSelector:
example.io/example-workloads-key: example-workloads-value 1
5.2.4.
5.3.
5.3.1.
5.3.2.
5.3.2.1.
apiVersion: nmstate.io/v1 kind: NodeNetworkConfigurationPolicy metadata: name: br1-eth1-policy 1 spec: desiredState: interfaces: - name: br1 2 description: Linux bridge with eth1 as a port 3 type: linux-bridge 4 state: up 5 ipv4: enabled: false 6 bridge: options: stp: enabled: false 7 port: - name: eth1 8
5.3.2.2.
- 참고
5.3.3.
5.3.3.1.
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: my-secondary-network 1 namespace: openshift-cnv 2 spec: config: '{ "cniVersion": "0.3.1", "name": "migration-bridge", "type": "macvlan", "master": "eth1", 3 "mode": "bridge", "ipam": { "type": "whereabouts", 4 "range": "10.200.5.0/24" 5 } }'
oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: liveMigrationConfig: completionTimeoutPerGiB: 800 network: <network> 1 parallelMigrationsPerCluster: 5 parallelOutboundMigrationsPerNode: 2 progressTimeout: 150 # ...
$ oc get vmi <vmi_name> -o jsonpath='{.status.migrationState.targetNodeAddress}'
5.3.3.2.
5.3.4.
5.3.4.1.
apiVersion: sriovnetwork.openshift.io/v1 kind: SriovNetworkNodePolicy metadata: name: <name> 1 namespace: openshift-sriov-network-operator 2 spec: resourceName: <sriov_resource_name> 3 nodeSelector: feature.node.kubernetes.io/network-sriov.capable: "true" 4 priority: <priority> 5 mtu: <mtu> 6 numVfs: <num> 7 nicSelector: 8 vendor: "<vendor_code>" 9 deviceID: "<device_id>" 10 pfNames: ["<pf_name>", ...] 11 rootDevices: ["<pci_bus_id>", "..."] 12 deviceType: vfio-pci 13 isRdma: false 14
참고$ oc create -f <name>-sriov-node-network.yaml
$ oc get sriovnetworknodestates -n openshift-sriov-network-operator <node_name> -o jsonpath='{.status.syncStatus}'
5.3.5.
5.4.
5.4.1.
5.4.1.1.
6장.
6.1.
6.1.1.
6.1.1.1.
6.1.2.
6.1.2.1.
6.1.2.2.
6.1.2.2.1.
6.1.3.
$ oc get kv kubevirt-kubevirt-hyperconverged \ -n openshift-cnv -o jsonpath='{.spec.workloadUpdateStrategy.workloadUpdateMethods}'
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type json -p '[{"op":"replace","path":"/spec/workloadUpdateStrategy/workloadUpdateMethods", "value":[]}]'
hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patched
$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.conditions"
예 6.1.
[ { "lastTransitionTime": "2022-12-09T16:29:11Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "True", "type": "ReconcileComplete" }, { "lastTransitionTime": "2022-12-09T20:30:10Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "True", "type": "Available" }, { "lastTransitionTime": "2022-12-09T20:30:10Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "False", "type": "Progressing" }, { "lastTransitionTime": "2022-12-09T16:39:11Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "False", "type": "Degraded" }, { "lastTransitionTime": "2022-12-09T20:30:10Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "True", "type": "Upgradeable" 1 } ]
$ oc adm upgrade
$ oc get clusterversion
참고
$ oc get csv -n openshift-cnv
$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.versions"
[ { "name": "operator", "version": "4.15.8" } ]
$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.conditions"
$ oc get clusterversion
$ oc get csv -n openshift-cnv
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv --type json -p \ "[{\"op\":\"add\",\"path\":\"/spec/workloadUpdateStrategy/workloadUpdateMethods\", \"value\":{WorkloadUpdateMethodConfig}}]"
hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patched
$ oc get vmim -A
6.1.4.
- 참고
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: workloadUpdateStrategy: workloadUpdateMethods: 1 - LiveMigrate 2 - Evict 3 batchEvictionSize: 10 4 batchEvictionInterval: "1m0s" 5 # ...
참고
6.1.5.
6.1.5.1.
6.1.6.
6.1.6.1.
$ oc get csv -n openshift-cnv
VERSION REPLACES PHASE 4.9.0 kubevirt-hyperconverged-operator.v4.8.2 Installing 4.9.0 kubevirt-hyperconverged-operator.v4.9.0 Replacing
$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv \ -o=jsonpath='{range .status.conditions[*]}{.type}{"\t"}{.status}{"\t"}{.message}{"\n"}{end}'
ReconcileComplete True Reconcile completed successfully Available True Reconcile completed successfully Progressing False Reconcile completed successfully Degraded False Reconcile completed successfully Upgradeable True Reconcile completed successfully
6.1.6.2.
$ oc get vmi -l kubevirt.io/outdatedLauncherImage --all-namespaces
6.1.7.
7장.
7.1.
7.1.1.
7.1.1.1.
7.1.1.1.1.
7.1.1.1.2.
7.1.1.2.
7.1.2.
7.1.2.1.
7.1.2.1.1.
apiVersion: instancetype.kubevirt.io/v1beta1 kind: VirtualMachineInstancetype metadata: name: example-instancetype spec: cpu: guest: 1 1 memory: guest: 128Mi 2
$ virtctl create instancetype --cpu 2 --memory 256Mi
$ virtctl create instancetype --cpu 2 --memory 256Mi | oc apply -f -
7.1.2.1.2.
7.1.2.2.
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
|
| |
| |
7.1.2.3.
7.1.2.4.
- 참고
7.1.3.
7.1.3.1.
7.1.3.2.
7.1.3.2.1.
|
|
|
|
|
|
|
|
|
참고
|
|
|
7.1.3.2.2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
참고
|
7.1.3.2.3.
7.1.3.2.4.
7.1.4.
7.1.4.1.
7.1.4.2.
- 참고
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: rhel-9-minimal spec: dataVolumeTemplates: - metadata: name: rhel-9-minimal-volume spec: sourceRef: kind: DataSource name: rhel9 1 namespace: openshift-virtualization-os-images 2 storage: {} instancetype: name: u1.medium 3 preference: name: rhel.9 4 running: true template: spec: domain: devices: {} volumes: - dataVolume: name: rhel-9-minimal-volume name: rootdisk
$ oc create -f <vm_manifest_file>.yaml
$ virtctl start <vm_name> -n <namespace>
7.2.
7.2.1.
7.2.2.
7.2.2.1.
$ cat > Dockerfile << EOF FROM registry.access.redhat.com/ubi8/ubi:latest AS builder ADD --chown=107:107 <vm_image>.qcow2 /disk/ 1 RUN chmod 0440 /disk/* FROM scratch COPY --from=builder /disk/* /disk/ EOF
$ podman build -t <registry>/<container_disk_name>:latest .
$ podman push <registry>/<container_disk_name>:latest
7.2.2.2.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: storageImport: insecureRegistries: 1 - "private-registry-example-1:5000" - "private-registry-example-2:5000"
7.2.2.3.
7.2.2.4.
apiVersion: v1 kind: Secret metadata: name: data-source-secret labels: app: containerized-data-importer type: Opaque data: accessKeyId: "" 1 secretKey: "" 2
$ oc apply -f data-source-secret.yaml
$ oc create configmap tls-certs 1 --from-file=</path/to/file/ca.pem> 2
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: creationTimestamp: null labels: kubevirt.io/vm: vm-fedora-datavolume name: vm-fedora-datavolume 1 spec: dataVolumeTemplates: - metadata: creationTimestamp: null name: fedora-dv 2 spec: storage: resources: requests: storage: 10Gi 3 storageClassName: <storage_class> 4 source: registry: url: "docker://kubevirt/fedora-cloud-container-disk-demo:latest" 5 secretRef: data-source-secret 6 certConfigMap: tls-certs 7 status: {} running: true template: metadata: creationTimestamp: null labels: kubevirt.io/vm: vm-fedora-datavolume spec: domain: devices: disks: - disk: bus: virtio name: datavolumedisk1 machine: type: "" resources: requests: memory: 1.5Gi terminationGracePeriodSeconds: 180 volumes: - dataVolume: name: fedora-dv name: datavolumedisk1 status: {}
$ oc create -f vm-fedora-datavolume.yaml
$ oc get pods
$ oc describe dv fedora-dv 1
$ virtctl console vm-fedora-datavolume
7.2.3.
7.2.3.1.
7.2.3.2.
apiVersion: v1 kind: Secret metadata: name: data-source-secret labels: app: containerized-data-importer type: Opaque data: accessKeyId: "" 1 secretKey: "" 2
$ oc apply -f data-source-secret.yaml
$ oc create configmap tls-certs 1 --from-file=</path/to/file/ca.pem> 2
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: creationTimestamp: null labels: kubevirt.io/vm: vm-fedora-datavolume name: vm-fedora-datavolume 1 spec: dataVolumeTemplates: - metadata: creationTimestamp: null name: fedora-dv 2 spec: storage: resources: requests: storage: 10Gi 3 storageClassName: <storage_class> 4 source: http: url: "https://mirror.arizona.edu/fedora/linux/releases/35/Cloud/x86_64/images/Fedora-Cloud-Base-35-1.2.x86_64.qcow2" 5 registry: url: "docker://kubevirt/fedora-cloud-container-disk-demo:latest" 6 secretRef: data-source-secret 7 certConfigMap: tls-certs 8 status: {} running: true template: metadata: creationTimestamp: null labels: kubevirt.io/vm: vm-fedora-datavolume spec: domain: devices: disks: - disk: bus: virtio name: datavolumedisk1 machine: type: "" resources: requests: memory: 1.5Gi terminationGracePeriodSeconds: 180 volumes: - dataVolume: name: fedora-dv name: datavolumedisk1 status: {}
$ oc create -f vm-fedora-datavolume.yaml
$ oc get pods
$ oc describe dv fedora-dv 1
$ virtctl console vm-fedora-datavolume
7.2.4.
7.2.4.1.
7.2.4.2.
7.2.4.2.1.
%WINDIR%\System32\Sysprep\sysprep.exe /generalize /shutdown /oobe /mode:vm
7.2.4.2.2.
7.2.4.3.
7.2.5.
7.2.5.1.
7.2.5.1.1.
$ yum install -y qemu-guest-agent
$ systemctl enable --now qemu-guest-agent
$ oc get vm <vm_name>
7.2.5.1.2.
$ net start
7.2.5.2.
|
|
|
|
|
|
|
|
|
7.2.5.2.1.
7.2.5.2.2.
7.2.5.2.3.
7.2.5.2.4.
7.2.5.2.5.
# ... spec: domain: devices: disks: - name: virtiocontainerdisk bootOrder: 2 1 cdrom: bus: sata volumes: - containerDisk: image: container-native-virtualization/virtio-win name: virtiocontainerdisk
$ virtctl start <vm> -n <namespace>
$ oc apply -f <vm.yaml>
7.2.5.3.
7.2.5.3.1.
7.2.6.
7.2.6.1.
7.2.6.2.
7.2.6.3.
7.2.7.
7.2.7.1.
7.2.7.1.1.
7.2.7.1.2.
7.2.7.1.3.
apiVersion: v1 kind: PersistentVolumeClaim metadata: annotations: cdi.kubevirt.io/cloneFallbackReason: The volume modes of source and target are incompatible cdi.kubevirt.io/clonePhase: Succeeded cdi.kubevirt.io/cloneType: copy
NAMESPACE LAST SEEN TYPE REASON OBJECT MESSAGE test-ns 0s Warning IncompatibleVolumeModes persistentvolumeclaim/test-target The volume modes of source and target are incompatible
7.2.7.2.
7.2.7.3.
7.2.7.3.1.
kind: VolumeSnapshotClass apiVersion: snapshot.storage.k8s.io/v1 driver: openshift-storage.rbd.csi.ceph.com # ...
kind: StorageClass apiVersion: storage.k8s.io/v1 # ... provisioner: openshift-storage.rbd.csi.ceph.com
7.2.7.3.2.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: labels: kubevirt.io/vm: vm-dv-clone name: vm-dv-clone 1 spec: running: false template: metadata: labels: kubevirt.io/vm: vm-dv-clone spec: domain: devices: disks: - disk: bus: virtio name: root-disk resources: requests: memory: 64M volumes: - dataVolume: name: favorite-clone name: root-disk dataVolumeTemplates: - metadata: name: favorite-clone spec: storage: accessModes: - ReadWriteOnce resources: requests: storage: 2Gi source: pvc: namespace: <source_namespace> 2 name: "<source_pvc>" 3
$ oc create -f <vm-clone-datavolumetemplate>.yaml
7.3.
7.3.1.
7.3.1.1.
7.3.1.2.
$ virtctl vnc <vm_name>
$ virtctl vnc <vm_name> -v 4
7.3.1.3.
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv --type json -p '[{"op": "replace", "path": "/spec/featureGates/deployVmConsoleProxy", "value": true}]'
$ curl --header "Authorization: Bearer ${TOKEN}" \ "https://api.<cluster_fqdn>/apis/token.kubevirt.io/v1alpha1/namespaces/<namespace>/virtualmachines/<vm_name>/vnc?duration=<duration>"
{ "token": "eyJhb..." }
$ export VNC_TOKEN="<token>"
$ oc login --token ${VNC_TOKEN}
$ virtctl vnc <vm_name> -n <namespace>
$ virtctl delete serviceaccount --namespace "<namespace>" "<vm_name>-vnc-access"
7.3.2.
7.3.2.1.
7.3.2.2.
$ virtctl console <vm_name>
7.3.3.
7.3.3.1.
7.4.
7.4.1.
7.4.2.
7.4.2.1.
7.4.2.2.
7.4.2.2.1.
7.4.2.2.2.
- 참고
7.4.2.2.3.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm namespace: example-namespace spec: dataVolumeTemplates: - metadata: name: example-vm-volume spec: sourceRef: kind: DataSource name: rhel9 namespace: openshift-virtualization-os-images storage: resources: {} instancetype: name: u1.medium preference: name: rhel.9 running: true template: spec: domain: devices: {} volumes: - dataVolume: name: example-vm-volume name: rootdisk - cloudInitNoCloud: 1 userData: |- #cloud-config user: cloud-user name: cloudinitdisk accessCredentials: - sshPublicKey: propagationMethod: noCloud: {} source: secret: secretName: authorized-keys 2 --- apiVersion: v1 kind: Secret metadata: name: authorized-keys data: key: c3NoLXJzYSB... 3
$ oc create -f <manifest_file>.yaml
$ virtctl start vm example-vm -n example-namespace
$ oc describe vm example-vm -n example-namespace
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm namespace: example-namespace spec: template: spec: accessCredentials: - sshPublicKey: propagationMethod: noCloud: {} source: secret: secretName: authorized-keys # ...
7.4.2.3.
7.4.2.3.1.
7.4.2.3.2.
- 참고
7.4.2.3.3.
7.4.2.3.4.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm namespace: example-namespace spec: dataVolumeTemplates: - metadata: name: example-vm-volume spec: sourceRef: kind: DataSource name: rhel9 namespace: openshift-virtualization-os-images storage: resources: {} instancetype: name: u1.medium preference: name: rhel.9 running: true template: spec: domain: devices: {} volumes: - dataVolume: name: example-vm-volume name: rootdisk - cloudInitNoCloud: 1 userData: |- #cloud-config runcmd: - [ setsebool, -P, virt_qemu_ga_manage_ssh, on ] name: cloudinitdisk accessCredentials: - sshPublicKey: propagationMethod: qemuGuestAgent: users: ["cloud-user"] source: secret: secretName: authorized-keys 2 --- apiVersion: v1 kind: Secret metadata: name: authorized-keys data: key: c3NoLXJzYSB... 3
$ oc create -f <manifest_file>.yaml
$ virtctl start vm example-vm -n example-namespace
$ oc describe vm example-vm -n example-namespace
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm namespace: example-namespace spec: template: spec: accessCredentials: - sshPublicKey: propagationMethod: qemuGuestAgent: users: ["cloud-user"] source: secret: secretName: authorized-keys # ...
7.4.2.4.
$ virtctl -n <namespace> ssh <username>@example-vm -i <ssh_key> 1
$ virtctl -n my-namespace ssh cloud-user@example-vm -i my-key
7.4.3.
Host vm/* ProxyCommand virtctl port-forward --stdio=true %h %p
$ ssh <user>@vm/<vm_name>.<namespace>
7.4.4.
7.4.4.1.
7.4.4.2.
7.4.4.2.1.
7.4.4.2.2.
7.4.4.2.3.
$ virtctl expose vm <vm_name> --name <service_name> --type <service_type> --port <port> 1
$ virtctl expose vm example-vm --name example-service --type NodePort --port 22
$ oc get service
7.4.4.2.4.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm namespace: example-namespace spec: running: false template: metadata: labels: special: key 1 # ...
참고apiVersion: v1 kind: Service metadata: name: example-service namespace: example-namespace spec: # ... selector: special: key 1 type: NodePort 2 ports: 3 protocol: TCP port: 80 targetPort: 9376 nodePort: 30000
$ oc create -f example-service.yaml
$ oc get service -n example-namespace
7.4.4.3.
$ ssh <user_name>@<ip_address> -p <port> 1
7.4.5.
7.4.5.1.
7.4.5.2.
$ oc describe vm <vm_name> -n <namespace>
# ... Interfaces: Interface Name: eth0 Ip Address: 10.244.0.37/24 Ip Addresses: 10.244.0.37/24 fe80::858:aff:fef4:25/64 Mac: 0a:58:0a:f4:00:25 Name: default # ...
$ ssh <user_name>@<ip_address> -i <ssh_key>
$ ssh cloud-user@10.244.0.37 -i ~/.ssh/id_rsa_cloud-user
7.5.
7.5.1.
$ oc edit vm <vm_name>
$ oc apply vm <vm_name> -n <namespace>
7.5.2.
7.5.2.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
참고
|
7.5.3.
7.6.
7.6.1.
7.6.2.
7.6.3.
7.6.4.
7.7.
7.7.1.
7.7.2.
$ oc delete vm <vm_name>
참고
7.8.
7.8.1.
apiVersion: export.kubevirt.io/v1alpha1 kind: VirtualMachineExport metadata: name: example-export spec: source: apiGroup: "kubevirt.io" 1 kind: VirtualMachine 2 name: example-vm ttlDuration: 1h 3
$ oc create -f example-export.yaml
$ oc get vmexport example-export -o yaml
apiVersion: export.kubevirt.io/v1alpha1 kind: VirtualMachineExport metadata: name: example-export namespace: example spec: source: apiGroup: "" kind: PersistentVolumeClaim name: example-pvc tokenSecretRef: example-token status: conditions: - lastProbeTime: null lastTransitionTime: "2022-06-21T14:10:09Z" reason: podReady status: "True" type: Ready - lastProbeTime: null lastTransitionTime: "2022-06-21T14:09:02Z" reason: pvcBound status: "True" type: PVCReady links: external: 1 cert: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- volumes: - formats: - format: raw url: https://vmexport-proxy.test.net/api/export.kubevirt.io/v1alpha1/namespaces/example/virtualmachineexports/example-export/volumes/example-disk/disk.img - format: gzip url: https://vmexport-proxy.test.net/api/export.kubevirt.io/v1alpha1/namespaces/example/virtualmachineexports/example-export/volumes/example-disk/disk.img.gz name: example-disk internal: 2 cert: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- volumes: - formats: - format: raw url: https://virt-export-example-export.example.svc/volumes/example-disk/disk.img - format: gzip url: https://virt-export-example-export.example.svc/volumes/example-disk/disk.img.gz name: example-disk phase: Ready serviceName: virt-export-example-export
7.8.2.
- 참고
$ oc get vmexport <export_name> -o jsonpath={.status.links.external.cert} > cacert.crt 1
$ oc get secret export-token-<export_name> -o jsonpath={.data.token} | base64 --decode > token_decode 1
$ oc get vmexport <export_name> -o yaml
apiVersion: export.kubevirt.io/v1alpha1 kind: VirtualMachineExport metadata: name: example-export spec: source: apiGroup: "kubevirt.io" kind: VirtualMachine name: example-vm tokenSecretRef: example-token status: #... links: external: #... manifests: - type: all url: https://vmexport-proxy.test.net/api/export.kubevirt.io/v1alpha1/namespaces/example/virtualmachineexports/example-export/external/manifests/all 1 - type: auth-header-secret url: https://vmexport-proxy.test.net/api/export.kubevirt.io/v1alpha1/namespaces/example/virtualmachineexports/example-export/external/manifests/secret 2 internal: #... manifests: - type: all url: https://virt-export-export-pvc.default.svc/internal/manifests/all 3 - type: auth-header-secret url: https://virt-export-export-pvc.default.svc/internal/manifests/secret phase: Ready serviceName: virt-export-example-export
$ curl --cacert cacert.crt <secret_manifest_url> -H \ 1 "x-kubevirt-export-token:token_decode" -H \ 2 "Accept:application/yaml"
$ curl --cacert cacert.crt https://vmexport-proxy.test.net/api/export.kubevirt.io/v1alpha1/namespaces/example/virtualmachineexports/example-export/external/manifests/secret -H "x-kubevirt-export-token:token_decode" -H "Accept:application/yaml"
$ curl --cacert cacert.crt <all_manifest_url> -H \ 1 "x-kubevirt-export-token:token_decode" -H \ 2 "Accept:application/yaml"
$ curl --cacert cacert.crt https://vmexport-proxy.test.net/api/export.kubevirt.io/v1alpha1/namespaces/example/virtualmachineexports/example-export/external/manifests/all -H "x-kubevirt-export-token:token_decode" -H "Accept:application/yaml"
7.9.
7.9.1.
7.9.2.
$ oc get vmis -A
7.9.3.
7.9.4.
7.9.5.
$ oc delete vmi <vmi_name>
7.9.6.
7.10.
7.10.1.
7.10.2.
7.10.3.
7.10.4.
7.10.5.
7.11.
7.11.1.
kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: vmStateStorageClass: <storage_class_name> # ...
7.11.2.
7.12.
7.12.1.
7.12.2.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: kubevirt-hyperconverged spec: tektonPipelinesNamespace: <user_namespace> 1 featureGates: deployTektonTaskResources: true 2 # ...
참고
7.12.3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7.12.4.
7.12.4.1.
7.12.4.2.
apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: windows10-installer-run- labels: pipelinerun: windows10-installer-run spec: params: - name: winImageDownloadURL value: <link_to_windows_10_iso> 1 pipelineRef: name: windows10-installer taskRunSpecs: - pipelineTaskName: copy-template taskServiceAccountName: copy-template-task - pipelineTaskName: modify-vm-template taskServiceAccountName: modify-vm-template-task - pipelineTaskName: create-vm-from-template taskServiceAccountName: create-vm-from-template-task - pipelineTaskName: wait-for-vmi-status taskServiceAccountName: wait-for-vmi-status-task - pipelineTaskName: create-base-dv taskServiceAccountName: modify-data-object-task - pipelineTaskName: cleanup-vm taskServiceAccountName: cleanup-vm-task status: {}
$ oc apply -f windows10-installer-run.yaml
apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: windows10-customize-run- labels: pipelinerun: windows10-customize-run spec: params: - name: allowReplaceGoldenTemplate value: true - name: allowReplaceCustomizationTemplate value: true pipelineRef: name: windows10-customize taskRunSpecs: - pipelineTaskName: copy-template-customize taskServiceAccountName: copy-template-task - pipelineTaskName: modify-vm-template-customize taskServiceAccountName: modify-vm-template-task - pipelineTaskName: create-vm-from-template taskServiceAccountName: create-vm-from-template-task - pipelineTaskName: wait-for-vmi-status taskServiceAccountName: wait-for-vmi-status-task - pipelineTaskName: create-base-dv taskServiceAccountName: modify-data-object-task - pipelineTaskName: cleanup-vm taskServiceAccountName: cleanup-vm-task - pipelineTaskName: copy-template-golden taskServiceAccountName: copy-template-task - pipelineTaskName: modify-vm-template-golden taskServiceAccountName: modify-vm-template-task status: {}
$ oc apply -f windows10-customize-run.yaml
7.12.5.
7.13.
7.13.1.
7.13.1.1.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: with-limits spec: running: false template: spec: domain: # ... resources: requests: memory: 128Mi limits: memory: 256Mi 1
7.13.1.2.
7.13.2.
7.13.2.1.
- 참고
7.13.2.2.
7.13.2.2.1.
metadata: name: example-vm-node-selector apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: template: spec: nodeSelector: example-key-1: example-value-1 example-key-2: example-value-2 # ...
7.13.2.2.2.
metadata: name: example-vm-pod-affinity apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: template: spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: 1 - labelSelector: matchExpressions: - key: example-key-1 operator: In values: - example-value-1 topologyKey: kubernetes.io/hostname podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: 2 - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: example-key-2 operator: In values: - example-value-2 topologyKey: kubernetes.io/hostname # ...
7.13.2.2.3.
metadata: name: example-vm-node-affinity apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: template: spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: 1 nodeSelectorTerms: - matchExpressions: - key: example.io/example-key operator: In values: - example-value-1 - example-value-2 preferredDuringSchedulingIgnoredDuringExecution: 2 - weight: 1 preference: matchExpressions: - key: example-node-label-key operator: In values: - example-node-label-value # ...
7.13.2.2.4.
metadata: name: example-vm-tolerations apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: tolerations: - key: "key" operator: "Equal" value: "virtualization" effect: "NoSchedule" # ...
7.13.2.3.
7.13.3.
7.13.3.1.
7.13.3.2.
7.13.3.2.1.
7.13.3.2.2.
7.13.3.3.
7.13.3.4.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: configuration: ksmConfiguration: nodeLabelSelector: {} # ...
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: configuration: ksmConfiguration: nodeLabelSelector: matchLabels: <first_example_key>: "true" <second_example_key>: "true" # ...
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: configuration: # ...
7.13.3.5.
7.13.4.
7.13.4.1.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: certConfig: ca: duration: 48h0m0s renewBefore: 24h0m0s 1 server: duration: 24h0m0s 2 renewBefore: 12h0m0s 3
7.13.4.2.
certConfig: ca: duration: 4h0m0s renewBefore: 1h0m0s server: duration: 4h0m0s renewBefore: 4h0m0s
error: hyperconvergeds.hco.kubevirt.io "kubevirt-hyperconverged" could not be patched: admission webhook "validate-hco.kubevirt.io" denied the request: spec.certConfig: ca.duration is smaller than server.duration
7.13.5.
7.13.5.1.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: defaultCPUModel: "EPYC"
7.13.6.
7.13.6.1.
7.13.6.2.
apiversion: kubevirt.io/v1 kind: VirtualMachine metadata: labels: special: vm-secureboot name: vm-secureboot spec: template: metadata: labels: special: vm-secureboot spec: domain: devices: disks: - disk: bus: virtio name: containerdisk features: acpi: {} smm: enabled: true 1 firmware: bootloader: efi: secureBoot: true 2 # ...
$ oc create -f <file_name>.yaml
7.13.7.
7.13.7.1.
7.13.7.2.
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: pxe-net-conf 1 spec: config: | { "cniVersion": "0.3.1", "name": "pxe-net-conf", 2 "type": "bridge", 3 "bridge": "bridge-interface", 4 "macspoofchk": false, 5 "vlan": 100, 6 "preserveDefaultVlan": false 7 }
$ oc create -f pxe-net-conf.yaml
interfaces: - masquerade: {} name: default - bridge: {} name: pxe-net macAddress: de:00:00:00:00:de bootOrder: 1
참고devices: disks: - disk: bus: virtio name: containerdisk bootOrder: 2
networks: - name: default pod: {} - name: pxe-net multus: networkName: pxe-net-conf
$ oc create -f vmi-pxe-boot.yaml
virtualmachineinstance.kubevirt.io "vmi-pxe-boot" created
$ oc get vmi vmi-pxe-boot -o yaml | grep -i phase phase: Running
$ virtctl vnc vmi-pxe-boot
$ virtctl console vmi-pxe-boot
$ ip addr
... 3. eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether de:00:00:00:00:de brd ff:ff:ff:ff:ff:ff
7.13.7.3.
7.13.8.
7.13.8.1.
7.13.8.2.
7.13.8.3.
7.13.9.
7.13.9.1.
7.13.9.2.
7.13.9.3.
7.13.10.
7.13.10.1.
|
|
|
|
|
|
|
|
|
|
7.13.10.2.
7.13.10.3.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: myvm spec: template: spec: domain: cpu: model: Conroe 1
7.13.10.4.
apiVersion: kubevirt/v1alpha3 kind: VirtualMachine metadata: name: myvm spec: template: spec: domain: cpu: model: host-model 1
7.13.10.5.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: vm-fedora spec: running: true template: spec: schedulerName: my-scheduler 1 domain: devices: disks: - name: containerdisk disk: bus: virtio # ...
$ oc get pods
NAME READY STATUS RESTARTS AGE virt-launcher-vm-fedora-dpc87 2/2 Running 0 24m
$ oc describe pod virt-launcher-vm-fedora-dpc87
[...] Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 21m my-scheduler Successfully assigned default/virt-launcher-vm-fedora-dpc87 to node01 [...]
7.13.11.
7.13.11.1.
7.13.11.1.1.
$ oc label node <node_name> nvidia.com/gpu.deploy.operands=false 1
$ oc describe node <node_name>
$ oc get pods -n nvidia-gpu-operator
NAME READY STATUS RESTARTS AGE gpu-operator-59469b8c5c-hw9wj 1/1 Running 0 8d nvidia-sandbox-validator-7hx98 1/1 Running 0 8d nvidia-sandbox-validator-hdb7p 1/1 Running 0 8d nvidia-sandbox-validator-kxwj7 1/1 Terminating 0 9d nvidia-vfio-manager-7w9fs 1/1 Running 0 8d nvidia-vfio-manager-866pz 1/1 Running 0 8d nvidia-vfio-manager-zqtck 1/1 Terminating 0 9d
$ oc get pods -n nvidia-gpu-operator
NAME READY STATUS RESTARTS AGE gpu-operator-59469b8c5c-hw9wj 1/1 Running 0 8d nvidia-sandbox-validator-7hx98 1/1 Running 0 8d nvidia-sandbox-validator-hdb7p 1/1 Running 0 8d nvidia-vfio-manager-7w9fs 1/1 Running 0 8d nvidia-vfio-manager-866pz 1/1 Running 0 8d
7.13.11.2.
7.13.11.2.1.
7.13.11.2.2.
apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: worker 1 name: 100-worker-iommu 2 spec: config: ignition: version: 3.2.0 kernelArguments: - intel_iommu=on 3 # ...
$ oc create -f 100-worker-kernel-arg-iommu.yaml
$ oc get MachineConfig
7.13.11.2.3.
$ lspci -nnv | grep -i nvidia
02:01.0 3D controller [0302]: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] [10de:1eb8] (rev a1)
- 참고
variant: openshift version: 4.15.0 metadata: name: 100-worker-vfiopci labels: machineconfiguration.openshift.io/role: worker 1 storage: files: - path: /etc/modprobe.d/vfio.conf mode: 0644 overwrite: true contents: inline: | options vfio-pci ids=10de:1eb8 2 - path: /etc/modules-load.d/vfio-pci.conf 3 mode: 0644 overwrite: true contents: inline: vfio-pci
$ butane 100-worker-vfiopci.bu -o 100-worker-vfiopci.yaml
$ oc apply -f 100-worker-vfiopci.yaml
$ oc get MachineConfig
NAME GENERATEDBYCONTROLLER IGNITIONVERSION AGE 00-master d3da910bfa9f4b599af4ed7f5ac270d55950a3a1 3.2.0 25h 00-worker d3da910bfa9f4b599af4ed7f5ac270d55950a3a1 3.2.0 25h 01-master-container-runtime d3da910bfa9f4b599af4ed7f5ac270d55950a3a1 3.2.0 25h 01-master-kubelet d3da910bfa9f4b599af4ed7f5ac270d55950a3a1 3.2.0 25h 01-worker-container-runtime d3da910bfa9f4b599af4ed7f5ac270d55950a3a1 3.2.0 25h 01-worker-kubelet d3da910bfa9f4b599af4ed7f5ac270d55950a3a1 3.2.0 25h 100-worker-iommu 3.2.0 30s 100-worker-vfiopci-configuration 3.2.0 30s
$ lspci -nnk -d 10de:
04:00.0 3D controller [0302]: NVIDIA Corporation GP102GL [Tesla P40] [10de:1eb8] (rev a1) Subsystem: NVIDIA Corporation Device [10de:1eb8] Kernel driver in use: vfio-pci Kernel modules: nouveau
7.13.11.2.4.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: permittedHostDevices: 1 pciHostDevices: 2 - pciDeviceSelector: "10DE:1DB6" 3 resourceName: "nvidia.com/GV100GL_Tesla_V100" 4 - pciDeviceSelector: "10DE:1EB8" resourceName: "nvidia.com/TU104GL_Tesla_T4" - pciDeviceSelector: "8086:6F54" resourceName: "intel.com/qat" externalResourceProvider: true 5 # ...
참고
$ oc describe node <node_name>
Capacity: cpu: 64 devices.kubevirt.io/kvm: 110 devices.kubevirt.io/tun: 110 devices.kubevirt.io/vhost-net: 110 ephemeral-storage: 915128Mi hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 131395264Ki nvidia.com/GV100GL_Tesla_V100 1 nvidia.com/TU104GL_Tesla_T4 1 intel.com/qat: 1 pods: 250 Allocatable: cpu: 63500m devices.kubevirt.io/kvm: 110 devices.kubevirt.io/tun: 110 devices.kubevirt.io/vhost-net: 110 ephemeral-storage: 863623130526 hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 130244288Ki nvidia.com/GV100GL_Tesla_V100 1 nvidia.com/TU104GL_Tesla_T4 1 intel.com/qat: 1 pods: 250
7.13.11.2.5.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: permittedHostDevices: pciHostDevices: - pciDeviceSelector: "10DE:1DB6" resourceName: "nvidia.com/GV100GL_Tesla_V100" - pciDeviceSelector: "10DE:1EB8" resourceName: "nvidia.com/TU104GL_Tesla_T4" # ...
$ oc describe node <node_name>
Capacity: cpu: 64 devices.kubevirt.io/kvm: 110 devices.kubevirt.io/tun: 110 devices.kubevirt.io/vhost-net: 110 ephemeral-storage: 915128Mi hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 131395264Ki nvidia.com/GV100GL_Tesla_V100 1 nvidia.com/TU104GL_Tesla_T4 1 intel.com/qat: 0 pods: 250 Allocatable: cpu: 63500m devices.kubevirt.io/kvm: 110 devices.kubevirt.io/tun: 110 devices.kubevirt.io/vhost-net: 110 ephemeral-storage: 863623130526 hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 130244288Ki nvidia.com/GV100GL_Tesla_V100 1 nvidia.com/TU104GL_Tesla_T4 1 intel.com/qat: 0 pods: 250
7.13.11.3.
7.13.11.3.1.
apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: domain: devices: hostDevices: - deviceName: nvidia.com/TU104GL_Tesla_T4 1 name: hostdevices1
$ lspci -nnk | grep NVIDIA
$ 02:01.0 3D controller [0302]: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] [10de:1eb8] (rev a1)
7.13.11.4.
7.13.12.
7.13.12.1.
7.13.12.2.
7.13.12.2.1.
apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: worker 1 name: 100-worker-iommu 2 spec: config: ignition: version: 3.2.0 kernelArguments: - intel_iommu=on 3 # ...
$ oc create -f 100-worker-kernel-arg-iommu.yaml
$ oc get MachineConfig
7.13.12.3.
7.13.12.3.1.
7.13.12.3.2.
- 중요
kind: ClusterPolicy apiVersion: nvidia.com/v1 metadata: name: gpu-cluster-policy spec: operator: defaultRuntime: crio use_ocp_driver_toolkit: true initContainer: {} sandboxWorkloads: enabled: true defaultWorkload: vm-vgpu driver: enabled: false 1 dcgmExporter: {} dcgm: enabled: true daemonsets: {} devicePlugin: {} gfd: {} migManager: enabled: true nodeStatusExporter: enabled: true mig: strategy: single toolkit: enabled: true validator: plugin: env: - name: WITH_WORKLOAD value: "true" vgpuManager: enabled: true 2 repository: <vgpu_container_registry> 3 image: <vgpu_image_name> version: nvidia-vgpu-manager vgpuDeviceManager: enabled: false 4 config: name: vgpu-devices-config default: default sandboxDevicePlugin: enabled: false 5 vfioManager: enabled: false 6
7.13.12.4.
# ... mediatedDevicesConfiguration: mediatedDeviceTypes: - nvidia-222 - nvidia-228 - nvidia-105 - nvidia-108 # ...
nvidia-105 # ... nvidia-108 nvidia-217 nvidia-299 # ...
# ... mediatedDevicesConfiguration: mediatedDeviceTypes: - nvidia-22 - nvidia-223 - nvidia-224 # ...
7.13.12.5.
7.13.12.5.1.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
예 7.1.
apiVersion: hco.kubevirt.io/v1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: mediatedDevicesConfiguration: mediatedDeviceTypes: - nvidia-231 nodeMediatedDeviceTypes: - mediatedDeviceTypes: - nvidia-233 nodeSelector: kubernetes.io/hostname: node-11.redhat.com permittedHostDevices: mediatedDevices: - mdevNameSelector: GRID T4-2Q resourceName: nvidia.com/GRID_T4-2Q - mdevNameSelector: GRID T4-8Q resourceName: nvidia.com/GRID_T4-8Q # ...
# ... spec: mediatedDevicesConfiguration: mediatedDeviceTypes: 1 - <device_type> nodeMediatedDeviceTypes: 2 - mediatedDeviceTypes: 3 - <device_type> nodeSelector: 4 <node_selector_key>: <node_selector_value> # ...
중요$ oc get $NODE -o json \ | jq '.status.allocatable \ | with_entries(select(.key | startswith("nvidia.com/"))) \ | with_entries(select(.value != "0"))'
# ... permittedHostDevices: mediatedDevices: - mdevNameSelector: GRID T4-2Q 1 resourceName: nvidia.com/GRID_T4-2Q 2 # ...
$ oc describe node <node_name>
7.13.12.5.2.
- 참고
7.13.12.5.3.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: mediatedDevicesConfiguration: mediatedDeviceTypes: 1 - nvidia-231 permittedHostDevices: mediatedDevices: 2 - mdevNameSelector: GRID T4-2Q resourceName: nvidia.com/GRID_T4-2Q
7.13.12.6.
7.13.12.6.1.
apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: domain: devices: gpus: - deviceName: nvidia.com/TU104GL_Tesla_T4 1 name: gpu1 2 - deviceName: nvidia.com/GRID_T4-2Q name: gpu2
$ lspci -nnk | grep <device_name>
7.13.12.6.2.
7.13.12.7.
7.13.13.
7.13.13.1.
7.13.13.2.
- 중요
7.13.13.3.
apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: template: metadata: annotations: descheduler.alpha.kubernetes.io/evict: "true"
apiVersion: operator.openshift.io/v1 kind: KubeDescheduler metadata: name: cluster namespace: openshift-kube-descheduler-operator spec: deschedulingIntervalSeconds: 3600 profiles: - DevPreviewLongLifecycle mode: Predictive 1
7.13.13.4.
7.13.14.
7.13.15.
7.13.15.1.
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type=json -p='[{"op": "add", "path": "/spec/tuningPolicy", \ "value": "highBurst"}]'
$ oc get kubevirt.kubevirt.io/kubevirt-kubevirt-hyperconverged \ -n openshift-cnv -o go-template --template='{{range $config, \ $value := .spec.configuration}} {{if eq $config "apiConfiguration" \ "webhookConfiguration" "controllerConfiguration" "handlerConfiguration"}} \ {{"\n"}} {{$config}} = {{$value}} {{end}} {{end}} {{"\n"}}
7.13.16.
7.13.16.1.
7.13.16.2.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
... spec: resourceRequirements: vmiCPUAllocationRatio: 1 1 # ...
7.13.16.3.
7.14.
7.14.1.
7.14.1.1.
7.14.1.2.
$ virtctl addvolume <virtual-machine|virtual-machine-instance> \ --volume-name=<datavolume|PVC> \ [--persist] [--serial=<label-name>]
$ virtctl removevolume <virtual-machine|virtual-machine-instance> \ --volume-name=<datavolume|PVC>
7.14.2.
7.14.2.1.
$ oc edit pvc <pvc_name>
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: vm-disk-expand spec: accessModes: - ReadWriteMany resources: requests: storage: 3Gi 1 # ...
7.14.2.2.
apiVersion: cdi.kubevirt.io/v1beta1 kind: DataVolume metadata: name: blank-image-datavolume spec: source: blank: {} storage: resources: requests: storage: <2Gi> 1 storageClassName: "<storage_class>" 2
$ oc create -f <blank-image-datavolume>.yaml
8장.
8.1.
그림 8.1.

[D]
8.1.1.
8.1.2.
8.1.3.
- 참고
8.1.3.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8.1.4.
8.1.5.
8.1.6.
8.2.
8.2.1.
8.2.2.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm-ipv6 spec: template: spec: domain: devices: interfaces: - name: default masquerade: {} 1 ports: - port: 80 2 # ... networks: - name: default pod: {} volumes: - cloudInitNoCloud: networkData: | version: 2 ethernets: eth0: dhcp4: true addresses: [ fd10:0:2::2/120 ] 3 gateway6: fd10:0:2::1 4
$ oc create -f example-vm-ipv6.yaml
$ oc get vmi <vmi-name> -o jsonpath="{.status.interfaces[*].ipAddresses}"
8.2.3.
8.2.4.
8.3.
8.3.1.
8.3.2.
8.3.3.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm namespace: example-namespace spec: running: false template: metadata: labels: special: key 1 # ...
참고apiVersion: v1 kind: Service metadata: name: example-service namespace: example-namespace spec: # ... selector: special: key 1 type: NodePort 2 ports: 3 protocol: TCP port: 80 targetPort: 9376 nodePort: 30000
$ oc create -f example-service.yaml
$ oc get service -n example-namespace
8.3.4.
8.4.
8.4.1.
apiVersion: nmstate.io/v1 kind: NodeNetworkConfigurationPolicy metadata: name: br1-eth1-policy 1 spec: desiredState: interfaces: - name: br1 2 description: Linux bridge with eth1 as a port 3 type: linux-bridge 4 state: up 5 ipv4: enabled: false 6 bridge: options: stp: enabled: false 7 port: - name: eth1 8
8.4.2.
8.4.2.1.
- 참고
8.4.2.2.
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: bridge-network 1 annotations: k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/br1 2 spec: config: | { "cniVersion": "0.3.1", "name": "bridge-network", 3 "type": "bridge", 4 "bridge": "br1", 5 "macspoofchk": false, 6 "vlan": 100, 7 "preserveDefaultVlan": false 8 }
참고$ oc create -f network-attachment-definition.yaml 1
$ oc get network-attachment-definition bridge-network
8.4.3.
8.4.3.1.
|
|
|
|
|
|
|
|
|
|
8.4.3.2.
8.5.
8.5.1.
apiVersion: sriovnetwork.openshift.io/v1 kind: SriovNetworkNodePolicy metadata: name: <name> 1 namespace: openshift-sriov-network-operator 2 spec: resourceName: <sriov_resource_name> 3 nodeSelector: feature.node.kubernetes.io/network-sriov.capable: "true" 4 priority: <priority> 5 mtu: <mtu> 6 numVfs: <num> 7 nicSelector: 8 vendor: "<vendor_code>" 9 deviceID: "<device_id>" 10 pfNames: ["<pf_name>", ...] 11 rootDevices: ["<pci_bus_id>", "..."] 12 deviceType: vfio-pci 13 isRdma: false 14
참고$ oc create -f <name>-sriov-node-network.yaml
$ oc get sriovnetworknodestates -n openshift-sriov-network-operator <node_name> -o jsonpath='{.status.syncStatus}'
8.5.2.
apiVersion: sriovnetwork.openshift.io/v1 kind: SriovNetwork metadata: name: <name> 1 namespace: openshift-sriov-network-operator 2 spec: resourceName: <sriov_resource_name> 3 networkNamespace: <target_namespace> 4 vlan: <vlan> 5 spoofChk: "<spoof_check>" 6 linkState: <link_state> 7 maxTxRate: <max_tx_rate> 8 minTxRate: <min_rx_rate> 9 vlanQoS: <vlan_qos> 10 trust: "<trust_vf>" 11 capabilities: <capabilities> 12
$ oc create -f <name>-sriov-network.yaml
$ oc get net-attach-def -n <namespace>
8.5.3.
8.5.4.
8.5.5.
8.6.
8.6.1.
$ oc label node <node_name> node-role.kubernetes.io/worker-dpdk=""
apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfigPool metadata: name: worker-dpdk labels: machineconfiguration.openshift.io/role: worker-dpdk spec: machineConfigSelector: matchExpressions: - key: machineconfiguration.openshift.io/role operator: In values: - worker - worker-dpdk nodeSelector: matchLabels: node-role.kubernetes.io/worker-dpdk: ""
apiVersion: performance.openshift.io/v2 kind: PerformanceProfile metadata: name: profile-1 spec: cpu: isolated: 4-39,44-79 reserved: 0-3,40-43 globallyDisableIrqLoadBalancing: true hugepages: defaultHugepagesSize: 1G pages: - count: 8 node: 0 size: 1G net: userLevelNetworking: true nodeSelector: node-role.kubernetes.io/worker-dpdk: "" numa: topologyPolicy: single-numa-node
참고$ oc get performanceprofiles.performance.openshift.io profile-1 -o=jsonpath='{.status.runtimeClass}{"\n"}'
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type='json' -p='[{"op": "add", "path": "/spec/defaultRuntimeClass", "value":"<runtimeclass-name>"}]'
참고$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type='json' -p='[{"op": "replace", "path": "/spec/featureGates/alignCPUs", "value": true}]'
참고apiVersion: sriovnetwork.openshift.io/v1 kind: SriovNetworkNodePolicy metadata: name: policy-1 namespace: openshift-sriov-network-operator spec: resourceName: intel_nics_dpdk deviceType: vfio-pci mtu: 9000 numVfs: 4 priority: 99 nicSelector: vendor: "8086" deviceID: "1572" pfNames: - eno3 rootDevices: - "0000:19:00.2" nodeSelector: feature.node.kubernetes.io/network-sriov.capable: "true"
8.6.2.
$ oc create ns dpdk-checkup-ns
apiVersion: sriovnetwork.openshift.io/v1 kind: SriovNetwork metadata: name: dpdk-sriovnetwork namespace: openshift-sriov-network-operator spec: ipam: | { "type": "host-local", "subnet": "10.56.217.0/24", "rangeStart": "10.56.217.171", "rangeEnd": "10.56.217.181", "routes": [{ "dst": "0.0.0.0/0" }], "gateway": "10.56.217.1" } networkNamespace: dpdk-checkup-ns 1 resourceName: intel_nics_dpdk 2 spoofChk: "off" trust: "on" vlan: 1019
8.6.3.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: rhel-dpdk-vm spec: running: true template: metadata: annotations: cpu-load-balancing.crio.io: disable 1 cpu-quota.crio.io: disable 2 irq-load-balancing.crio.io: disable 3 spec: domain: cpu: sockets: 1 4 cores: 5 5 threads: 2 dedicatedCpuPlacement: true isolateEmulatorThread: true interfaces: - masquerade: {} name: default - model: virtio name: nic-east pciAddress: '0000:07:00.0' sriov: {} networkInterfaceMultiqueue: true rng: {} memory: hugepages: pageSize: 1Gi 6 guest: 8Gi networks: - name: default pod: {} - multus: networkName: dpdk-net 7 name: nic-east # ...
$ oc apply -f <file_name>.yaml
$ grubby --update-kernel=ALL --args="default_hugepagesz=1GB hugepagesz=1G hugepages=8"
$ dnf install -y tuned-profiles-cpu-partitioning
$ echo isolated_cores=2-9 > /etc/tuned/cpu-partitioning-variables.conf
$ tuned-adm profile cpu-partitioning
$ dnf install -y driverctl
$ driverctl set-override 0000:07:00.0 vfio-pci
8.7.
- 참고
8.7.1.
8.7.1.1.
apiVersion: k8s.cni.cncf.io/v1 kind: NetworkAttachmentDefinition metadata: name: l2-network namespace: my-namespace spec: config: |2 { "cniVersion": "0.3.1", 1 "name": "my-namespace-l2-network", 2 "type": "ovn-k8s-cni-overlay", 3 "topology":"layer2", 4 "mtu": 1300, 5 "netAttachDefName": "my-namespace/l2-network" 6 }
참고$ oc apply -f <filename>.yaml
8.7.1.2.
apiVersion: nmstate.io/v1 kind: NodeNetworkConfigurationPolicy metadata: name: mapping 1 spec: nodeSelector: node-role.kubernetes.io/worker: '' 2 desiredState: ovn: bridge-mappings: - localnet: localnet-network 3 bridge: br-ex 4 state: present 5
참고apiVersion: k8s.cni.cncf.io/v1 kind: NetworkAttachmentDefinition metadata: name: localnet-network namespace: default spec: config: |2 { "cniVersion": "0.3.1", 1 "name": "localnet-network", 2 "type": "ovn-k8s-cni-overlay", 3 "topology": "localnet", 4 "netAttachDefName": "default/localnet-network" 5 }
$ oc apply -f <filename>.yaml
8.7.1.3.
8.7.1.4.
8.7.2.
8.7.2.1.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: vm-server spec: running: true template: spec: domain: devices: interfaces: - name: secondary 1 bridge: {} resources: requests: memory: 1024Mi networks: - name: secondary 2 multus: networkName: <nad_name> 3 # ...
$ oc apply -f <filename>.yaml
8.7.3.
8.8.
8.8.1.
8.8.2.
$ virtctl start <vm_name> -n <namespace>
$ oc edit vm <vm_name>
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: vm-fedora template: spec: domain: devices: interfaces: - name: defaultnetwork masquerade: {} # new interface - name: <secondary_nic> 1 bridge: {} networks: - name: defaultnetwork pod: {} # new network - name: <secondary_nic> 2 multus: networkName: <nad_name> 3 # ...
$ virtctl migrate <vm_name>
$ oc get VirtualMachineInstanceMigration -w
NAME PHASE VMI kubevirt-migrate-vm-lj62q Scheduling vm-fedora kubevirt-migrate-vm-lj62q Scheduled vm-fedora kubevirt-migrate-vm-lj62q PreparingTarget vm-fedora kubevirt-migrate-vm-lj62q TargetReady vm-fedora kubevirt-migrate-vm-lj62q Running vm-fedora kubevirt-migrate-vm-lj62q Succeeded vm-fedora
$ oc get vmi vm-fedora -ojsonpath="{ @.status.interfaces }"
[ { "infoSource": "domain, guest-agent", "interfaceName": "eth0", "ipAddress": "10.130.0.195", "ipAddresses": [ "10.130.0.195", "fd02:0:0:3::43c" ], "mac": "52:54:00:0e:ab:25", "name": "default", "queueCount": 1 }, { "infoSource": "domain, guest-agent, multus-status", "interfaceName": "eth1", "mac": "02:d8:b8:00:00:2a", "name": "bridge-interface", 1 "queueCount": 1 } ]
8.8.3.
$ oc edit vm <vm_name>
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: vm-fedora template: spec: domain: devices: interfaces: - name: defaultnetwork masquerade: {} # set the interface state to absent - name: <secondary_nic> state: absent 1 bridge: {} networks: - name: defaultnetwork pod: {} - name: <secondary_nic> multus: networkName: <nad_name> # ...
$ virtctl migrate <vm_name>
8.8.4.
8.9.
8.9.1.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: labels: kubevirt.io/vm: vm-istio name: vm-istio spec: runStrategy: Always template: metadata: labels: kubevirt.io/vm: vm-istio app: vm-istio 1 annotations: sidecar.istio.io/inject: "true" 2 spec: domain: devices: interfaces: - name: default masquerade: {} 3 disks: - disk: bus: virtio name: containerdisk - disk: bus: virtio name: cloudinitdisk resources: requests: memory: 1024M networks: - name: default pod: {} terminationGracePeriodSeconds: 180 volumes: - containerDisk: image: registry:5000/kubevirt/fedora-cloud-container-disk-demo:devel name: containerdisk
$ oc apply -f <vm_name>.yaml 1
apiVersion: v1 kind: Service metadata: name: vm-istio spec: selector: app: vm-istio 1 ports: - port: 8080 name: http protocol: TCP
$ oc create -f <service_name>.yaml 1
8.9.2.
8.10.
8.10.1.
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: my-secondary-network 1 namespace: openshift-cnv 2 spec: config: '{ "cniVersion": "0.3.1", "name": "migration-bridge", "type": "macvlan", "master": "eth1", 3 "mode": "bridge", "ipam": { "type": "whereabouts", 4 "range": "10.200.5.0/24" 5 } }'
oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: liveMigrationConfig: completionTimeoutPerGiB: 800 network: <network> 1 parallelMigrationsPerCluster: 5 parallelOutboundMigrationsPerNode: 2 progressTimeout: 150 # ...
$ oc get vmi <vmi_name> -o jsonpath='{.status.migrationState.targetNodeAddress}'
8.10.2.
8.10.3.
8.11.
8.11.1.
8.11.1.1.
kind: VirtualMachine spec: # ... template: # ... spec: volumes: - cloudInitNoCloud: networkData: | version: 2 ethernets: eth1: 1 dhcp4: true
kind: VirtualMachine spec: # ... template: # ... spec: volumes: - cloudInitNoCloud: networkData: | version: 2 ethernets: eth1: 1 addresses: - 10.10.10.14/24 2
8.11.2.
8.11.2.1.
8.11.2.2.
$ oc describe vmi <vmi_name>
# ... Interfaces: Interface Name: eth0 Ip Address: 10.244.0.37/24 Ip Addresses: 10.244.0.37/24 fe80::858:aff:fef4:25/64 Mac: 0a:58:0a:f4:00:25 Name: default Interface Name: v2 Ip Address: 1.1.1.7/24 Ip Addresses: 1.1.1.7/24 fe80::f4d9:70ff:fe13:9089/64 Mac: f6:d9:70:13:90:89 Interface Name: v1 Ip Address: 1.1.1.1/24 Ip Addresses: 1.1.1.1/24 1.1.1.2/24 1.1.1.4/24 2001:de7:0:f101::1/64 2001:db8:0:f101::1/64 fe80::1420:84ff:fe10:17aa/64 Mac: 16:20:84:10:17:aa
8.11.3.
8.12.
8.12.1.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: featureGates: deployKubeSecondaryDNS: true 1 # ...
$ oc expose -n openshift-cnv deployment/secondary-dns --name=dns-lb \ --type=LoadBalancer --port=53 --target-port=5353 --protocol='UDP'
$ oc get service -n openshift-cnv
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE dns-lb LoadBalancer 172.30.27.5 10.46.41.94 53:31829/TCP 5s
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: featureGates: deployKubeSecondaryDNS: true kubeSecondaryDNSNameServerIP: "10.46.41.94" 1 # ...
$ oc get dnses.config.openshift.io cluster -o jsonpath='{.spec.baseDomain}'
openshift.example.com
vm.<FQDN>. IN NS ns.vm.<FQDN>.
ns.vm.<FQDN>. IN A <kubeSecondaryDNSNameServerIP>
8.12.2.
$ oc get dnses.config.openshift.io cluster -o json | jq .spec.baseDomain
$ oc get vm -n <namespace> <vm_name> -o yaml
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm namespace: example-namespace spec: running: true template: spec: domain: devices: interfaces: - bridge: {} name: example-nic # ... networks: - multus: networkName: bridge-conf name: example-nic 1
$ ssh <user_name>@<interface_name>.<vm_name>.<namespace>.vm.<cluster_fqdn>
8.12.3.
8.13.
8.13.1.
$ oc label namespace <namespace1> <namespace2> mutatevirtualmachines.kubemacpool.io=ignore
$ oc label namespace <namespace1> <namespace2> mutatevirtualmachines.kubemacpool.io-
9장.
9.1.
9.1.1.
9.1.2.
9.1.3.
9.1.4.
9.2.
9.2.1.
$ oc edit storageprofile <storage_class>
apiVersion: cdi.kubevirt.io/v1beta1 kind: StorageProfile metadata: name: <unknown_provisioner_class> # ... spec: {} status: provisioner: <unknown_provisioner> storageClass: <unknown_provisioner_class>
apiVersion: cdi.kubevirt.io/v1beta1 kind: StorageProfile metadata: name: <unknown_provisioner_class> # ... spec: claimPropertySets: - accessModes: - ReadWriteOnce 1 volumeMode: Filesystem 2 status: provisioner: <unknown_provisioner> storageClass: <unknown_provisioner_class>
9.2.1.1.
apiVersion: cdi.kubevirt.io/v1beta1 kind: StorageProfile metadata: name: <provisioner_class> # ... spec: claimPropertySets: - accessModes: - ReadWriteOnce 1 volumeMode: Filesystem 2 cloneStrategy: csi-clone 3 status: provisioner: <provisioner> storageClass: <provisioner_class>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9.3.
9.3.1.
9.3.1.1.
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type json -p '[{"op": "replace", "path": \ "/spec/featureGates/enableCommonBootImageImport", \ "value": false}]'
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type json -p '[{"op": "replace", "path": \ "/spec/featureGates/enableCommonBootImageImport", \ "value": true}]'
9.3.2.
9.3.2.1.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: dataImportCronTemplates: - metadata: name: rhel8-image-cron spec: template: spec: storageClassName: <new_storage_class> 1 schedule: "0 */12 * * *" 2 managedDataSource: <data_source> 3 # ...
For the custom image to be detected as an available boot source, the value of the `spec.dataVolumeTemplates.spec.sourceRef.name` parameter in the VM template must match this value.
$ oc get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE csi-manila-ceph manila.csi.openstack.org Delete Immediate false 11d hostpath-csi-basic (default) kubevirt.io.hostpath-provisioner Delete WaitForFirstConsumer false 11d 1
$ oc patch storageclass <current_default_storage_class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}' 1
$ oc patch storageclass <new_storage_class> -p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' 1
9.3.2.2.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: dataImportCronTemplates: - metadata: name: centos7-image-cron annotations: cdi.kubevirt.io/storage.bind.immediate.requested: "true" 1 labels: instancetype.kubevirt.io/default-preference: centos.7 instancetype.kubevirt.io/default-instancetype: u1.medium spec: schedule: "0 */12 * * *" 2 template: spec: source: registry: 3 url: docker://quay.io/containerdisks/centos:7-2009 storage: resources: requests: storage: 30Gi garbageCollect: Outdated managedDataSource: centos7 4
9.3.2.3.
$ oc edit storageprofile <storage_class>
apiVersion: cdi.kubevirt.io/v1beta1 kind: StorageProfile metadata: # ... spec: dataImportCronSourceFormat: snapshot
$ oc get storageprofile <storage_class> -oyaml
9.3.3.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
- 참고
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: dataImportCronTemplates: - metadata: annotations: dataimportcrontemplate.kubevirt.io/enable: 'false' name: rhel8-image-cron # ...
9.3.4.
$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o yaml
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: # ... status: # ... dataImportCronTemplates: - metadata: annotations: cdi.kubevirt.io/storage.bind.immediate.requested: "true" name: centos-7-image-cron spec: garbageCollect: Outdated managedDataSource: centos7 schedule: 55 8/12 * * * template: metadata: {} spec: source: registry: url: docker://quay.io/containerdisks/centos:7-2009 storage: resources: requests: storage: 30Gi status: {} status: commonTemplate: true 1 # ... - metadata: annotations: cdi.kubevirt.io/storage.bind.immediate.requested: "true" name: user-defined-dic spec: garbageCollect: Outdated managedDataSource: user-defined-centos-stream8 schedule: 55 8/12 * * * template: metadata: {} spec: source: registry: pullMethod: node url: docker://quay.io/containerdisks/centos-stream:8 storage: resources: requests: storage: 30Gi status: {} status: {} 2 # ...
9.4.
9.4.1.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
# ... spec: filesystemOverhead: global: "<new_global_value>" 1 storageClass: <storage_class_name>: "<new_value_for_this_storage_class>" 2
$ oc get cdiconfig -o yaml
$ oc get cdiconfig -o jsonpath='{.items..status.filesystemOverhead}'
9.5.
9.5.1.
apiVersion: hostpathprovisioner.kubevirt.io/v1beta1 kind: HostPathProvisioner metadata: name: hostpath-provisioner spec: imagePullPolicy: IfNotPresent storagePools: 1 - name: any_name path: "/var/myvolumes" 2 workload: nodeSelector: kubernetes.io/os: linux
$ oc create -f hpp_cr.yaml
9.5.1.1.
9.5.1.2.
9.5.2.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: iso-pvc
spec:
volumeMode: Block 1
storageClassName: my-storage-class
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
9.5.2.1.
apiVersion: hostpathprovisioner.kubevirt.io/v1beta1 kind: HostPathProvisioner metadata: name: hostpath-provisioner spec: imagePullPolicy: IfNotPresent storagePools: 1 - name: my-storage-pool path: "/var/myvolumes" 2 pvcTemplate: volumeMode: Block 3 storageClassName: my-storage-class 4 accessModes: - ReadWriteOnce resources: requests: storage: 5Gi 5 workload: nodeSelector: kubernetes.io/os: linux
$ oc create -f hpp_pvc_template_pool.yaml
9.6.
9.6.1.
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: <datavolume-cloner> 1 rules: - apiGroups: ["cdi.kubevirt.io"] resources: ["datavolumes/source"] verbs: ["*"]
$ oc create -f <datavolume-cloner.yaml> 1
apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: <allow-clone-to-user> 1 namespace: <Source namespace> 2 subjects: - kind: ServiceAccount name: default namespace: <Destination namespace> 3 roleRef: kind: ClusterRole name: datavolume-cloner 4 apiGroup: rbac.authorization.k8s.io
$ oc create -f <datavolume-cloner.yaml> 1
9.7.
9.7.1.
9.7.2.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: resourceRequirements: storageWorkloads: limits: cpu: "500m" memory: "2Gi" requests: cpu: "250m" memory: "1Gi"
9.7.3.
9.8.
9.8.1.
9.8.2.
|
|
|
|
|
|
|
|
|
|
9.8.3.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: scratchSpaceStorageClass: "<storage_class>" 1
9.8.4.
|
|
|
|
|
|
|
|
|
|
|
|
9.8.5.
9.9.
9.9.1.
9.9.2.
9.10.
9.10.1.
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: datavolume-example
annotations:
v1.multus-cni.io/default-network: bridge-network 1
# ...
10장.
10.1.
10.1.1.
- 참고
Product of (Maximum number of nodes that can drain in parallel) and (Highest total VM memory request allocations across nodes)
10.1.2.
10.1.3.
10.2.
10.2.1.
10.2.1.1.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: liveMigrationConfig: bandwidthPerMigration: 64Mi 1 completionTimeoutPerGiB: 800 2 parallelMigrationsPerCluster: 5 3 parallelOutboundMigrationsPerNode: 2 4 progressTimeout: 150 5
10.2.2.
10.2.2.1.
$ oc edit vm <vm_name>
apiVersion: migrations.kubevirt.io/v1alpha1 kind: VirtualMachine metadata: name: <vm_name> namespace: default labels: app: my-app environment: production spec: template: metadata: labels: kubevirt.io/domain: <vm_name> kubevirt.io/size: large kubevirt.io/environment: production # ...
apiVersion: migrations.kubevirt.io/v1alpha1 kind: MigrationPolicy metadata: name: <migration_policy> spec: selectors: namespaceSelector: 1 hpc-workloads: "True" xyz-workloads-type: "" virtualMachineInstanceSelector: 2 kubevirt.io/environment: "production"
$ oc create migrationpolicy -f <migration_policy>.yaml
10.2.3.
10.3.
10.3.1.
10.3.1.1.
10.3.1.2.
apiVersion: kubevirt.io/v1 kind: VirtualMachineInstanceMigration metadata: name: <migration_name> spec: vmiName: <vm_name>
$ oc create -f <migration_name>.yaml
$ oc describe vmi <vm_name> -n <namespace>
# ... Status: Conditions: Last Probe Time: <nil> Last Transition Time: <nil> Status: True Type: LiveMigratable Migration Method: LiveMigration Migration State: Completed: true End Timestamp: 2018-12-24T06:19:42Z Migration UID: d78c8962-0743-11e9-a540-fa163e0c69f1 Source Node: node2.example.com Start Timestamp: 2018-12-24T06:19:35Z Target Node: node1.example.com Target Node Address: 10.9.0.18:43891 Target Node Domain Detected: true
10.3.2.
10.3.2.1.
10.3.2.2.
$ oc delete vmim migration-job
10.3.3.
11장.
11.1.
11.1.1.
- 중요
|
|
|
|
|
|
|
|
|
|
|
|
11.1.1.1.
$ oc edit vm <vm_name> -n <namespace>
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: <vm_name> spec: template: spec: evictionStrategy: LiveMigrateIfPossible 1 # ...
$ virtctl restart <vm_name> -n <namespace>
11.1.1.2.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: evictionStrategy: LiveMigrate # ...
11.1.2.
11.1.2.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11.1.2.2.
$ oc edit vm <vm_name> -n <namespace>
apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: runStrategy: Always # ...
11.1.3.
11.1.4.
11.2.
11.2.1.
예 11.1.
"486" Conroe athlon core2duo coreduo kvm32 kvm64 n270 pentium pentium2 pentium3 pentiumpro phenom qemu32 qemu64
11.2.2.
예 11.2.
apic clflush cmov cx16 cx8 de fpu fxsr lahf_lm lm mca mce mmx msr mtrr nx pae pat pge pni pse pse36 sep sse sse2 sse4.1 ssse3 syscall tsc
예 11.3.
aes apic avx avx2 bmi1 bmi2 clflush cmov cx16 cx8 de erms fma fpu fsgsbase fxsr hle invpcid lahf_lm lm mca mce mmx movbe msr mtrr nx pae pat pcid pclmuldq pge pni popcnt pse pse36 rdtscp rtm sep smep sse sse2 sse4.1 sse4.2 ssse3 syscall tsc tsc-deadline x2apic xsave
예 11.4.
aes avx avx2 bmi1 bmi2 erms fma fsgsbase hle invpcid movbe pcid pclmuldq popcnt rdtscp rtm sse4.2 tsc-deadline x2apic xsave
11.2.3.
11.3.
11.3.1.
$ oc annotate node <node_name> node-labeller.kubevirt.io/skip-node=true 1
11.3.2.
11.4.
11.4.1.
11.4.2.
$ oc adm cordon <node_name>
$ oc adm drain <node_name> --force=true
$ oc delete node <node_name>
11.4.3.
11.4.3.1.
$ oc get vmis -A
12장.
12.1.
12.2.
- 중요
12.2.1.
12.2.2.
12.2.2.1.
12.2.2.2.
12.2.3.
12.2.3.1.
예 12.1.
--- apiVersion: v1 kind: ServiceAccount metadata: name: vm-latency-checkup-sa --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: kubevirt-vm-latency-checker rules: - apiGroups: ["kubevirt.io"] resources: ["virtualmachineinstances"] verbs: ["get", "create", "delete"] - apiGroups: ["subresources.kubevirt.io"] resources: ["virtualmachineinstances/console"] verbs: ["get"] - apiGroups: ["k8s.cni.cncf.io"] resources: ["network-attachment-definitions"] verbs: ["get"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: kubevirt-vm-latency-checker subjects: - kind: ServiceAccount name: vm-latency-checkup-sa roleRef: kind: Role name: kubevirt-vm-latency-checker apiGroup: rbac.authorization.k8s.io --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: kiagnose-configmap-access rules: - apiGroups: [ "" ] resources: [ "configmaps" ] verbs: ["get", "update"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: kiagnose-configmap-access subjects: - kind: ServiceAccount name: vm-latency-checkup-sa roleRef: kind: Role name: kiagnose-configmap-access apiGroup: rbac.authorization.k8s.io
$ oc apply -n <target_namespace> -f <latency_sa_roles_rolebinding>.yaml 1
apiVersion: v1 kind: ConfigMap metadata: name: kubevirt-vm-latency-checkup-config labels: kiagnose/checkup-type: kubevirt-vm-latency data: spec.timeout: 5m spec.param.networkAttachmentDefinitionNamespace: <target_namespace> spec.param.networkAttachmentDefinitionName: "blue-network" 1 spec.param.maxDesiredLatencyMilliseconds: "10" 2 spec.param.sampleDurationSeconds: "5" 3 spec.param.sourceNode: "worker1" 4 spec.param.targetNode: "worker2" 5
$ oc apply -n <target_namespace> -f <latency_config_map>.yaml
apiVersion: batch/v1 kind: Job metadata: name: kubevirt-vm-latency-checkup labels: kiagnose/checkup-type: kubevirt-vm-latency spec: backoffLimit: 0 template: spec: serviceAccountName: vm-latency-checkup-sa restartPolicy: Never containers: - name: vm-latency-checkup image: registry.redhat.io/container-native-virtualization/vm-network-latency-checkup-rhel9:v4.15.0 securityContext: allowPrivilegeEscalation: false capabilities: drop: ["ALL"] runAsNonRoot: true seccompProfile: type: "RuntimeDefault" env: - name: CONFIGMAP_NAMESPACE value: <target_namespace> - name: CONFIGMAP_NAME value: kubevirt-vm-latency-checkup-config - name: POD_UID valueFrom: fieldRef: fieldPath: metadata.uid
$ oc apply -n <target_namespace> -f <latency_job>.yaml
$ oc wait job kubevirt-vm-latency-checkup -n <target_namespace> --for condition=complete --timeout 6m
$ oc get configmap kubevirt-vm-latency-checkup-config -n <target_namespace> -o yaml
apiVersion: v1 kind: ConfigMap metadata: name: kubevirt-vm-latency-checkup-config namespace: <target_namespace> labels: kiagnose/checkup-type: kubevirt-vm-latency data: spec.timeout: 5m spec.param.networkAttachmentDefinitionNamespace: <target_namespace> spec.param.networkAttachmentDefinitionName: "blue-network" spec.param.maxDesiredLatencyMilliseconds: "10" spec.param.sampleDurationSeconds: "5" spec.param.sourceNode: "worker1" spec.param.targetNode: "worker2" status.succeeded: "true" status.failureReason: "" status.completionTimestamp: "2022-01-01T09:00:00Z" status.startTimestamp: "2022-01-01T09:00:07Z" status.result.avgLatencyNanoSec: "177000" status.result.maxLatencyNanoSec: "244000" 1 status.result.measurementDurationSec: "5" status.result.minLatencyNanoSec: "135000" status.result.sourceNode: "worker1" status.result.targetNode: "worker2"
$ oc logs job.batch/kubevirt-vm-latency-checkup -n <target_namespace>
$ oc delete job -n <target_namespace> kubevirt-vm-latency-checkup
$ oc delete config-map -n <target_namespace> kubevirt-vm-latency-checkup-config
$ oc delete -f <latency_sa_roles_rolebinding>.yaml
12.2.3.2.
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: kubevirt-storage-checkup-clustereader roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-reader subjects: - kind: ServiceAccount name: storage-checkup-sa namespace: <target_namespace> 1
예 12.2.
--- apiVersion: v1 kind: ServiceAccount metadata: name: storage-checkup-sa --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: storage-checkup-role rules: - apiGroups: [ "" ] resources: [ "configmaps" ] verbs: ["get", "update"] - apiGroups: [ "kubevirt.io" ] resources: [ "virtualmachines" ] verbs: [ "create", "delete" ] - apiGroups: [ "kubevirt.io" ] resources: [ "virtualmachineinstances" ] verbs: [ "get" ] - apiGroups: [ "subresources.kubevirt.io" ] resources: [ "virtualmachineinstances/addvolume", "virtualmachineinstances/removevolume" ] verbs: [ "update" ] - apiGroups: [ "kubevirt.io" ] resources: [ "virtualmachineinstancemigrations" ] verbs: [ "create" ] - apiGroups: [ "cdi.kubevirt.io" ] resources: [ "datavolumes" ] verbs: [ "create", "delete" ] - apiGroups: [ "" ] resources: [ "persistentvolumeclaims" ] verbs: [ "delete" ] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: storage-checkup-role subjects: - kind: ServiceAccount name: storage-checkup-sa roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: storage-checkup-role
$ oc apply -n <target_namespace> -f <storage_sa_roles_rolebinding>.yaml
--- apiVersion: v1 kind: ConfigMap metadata: name: storage-checkup-config namespace: $CHECKUP_NAMESPACE data: spec.timeout: 10m spec.param.storageClass: ocs-storagecluster-ceph-rbd-virtualization spec.param.vmiTimeout: 3m --- apiVersion: batch/v1 kind: Job metadata: name: storage-checkup namespace: $CHECKUP_NAMESPACE spec: backoffLimit: 0 template: spec: serviceAccount: storage-checkup-sa restartPolicy: Never containers: - name: storage-checkup image: quay.io/kiagnose/kubevirt-storage-checkup:main imagePullPolicy: Always env: - name: CONFIGMAP_NAMESPACE value: $CHECKUP_NAMESPACE - name: CONFIGMAP_NAME value: storage-checkup-config
$ oc apply -n <target_namespace> -f <storage_configmap_job>.yaml
$ oc wait job storage-checkup -n <target_namespace> --for condition=complete --timeout 10m
$ oc get configmap storage-checkup-config -n <target_namespace> -o yaml
apiVersion: v1 kind: ConfigMap metadata: name: storage-checkup-config labels: kiagnose/checkup-type: kubevirt-storage data: spec.timeout: 10m status.succeeded: "true" 1 status.failureReason: "" 2 status.startTimestamp: "2023-07-31T13:14:38Z" 3 status.completionTimestamp: "2023-07-31T13:19:41Z" 4 status.result.cnvVersion: 4.16.2 5 status.result.defaultStorageClass: trident-nfs 6 status.result.goldenImagesNoDataSource: <data_import_cron_list> 7 status.result.goldenImagesNotUpToDate: <data_import_cron_list> 8 status.result.ocpVersion: 4.16.0 9 status.result.pvcBound: "true" 10 status.result.storageProfileMissingVolumeSnapshotClass: <storage_class_list> 11 status.result.storageProfilesWithEmptyClaimPropertySets: <storage_profile_list> 12 status.result.storageProfilesWithSmartClone: <storage_profile_list> 13 status.result.storageProfilesWithSpecClaimPropertySets: <storage_profile_list> 14 status.result.storageProfilesWithRWX: |- ocs-storagecluster-ceph-rbd ocs-storagecluster-ceph-rbd-virtualization ocs-storagecluster-cephfs trident-iscsi trident-minio trident-nfs windows-vms status.result.vmBootFromGoldenImage: VMI "vmi-under-test-dhkb8" successfully booted status.result.vmHotplugVolume: |- VMI "vmi-under-test-dhkb8" hotplug volume ready VMI "vmi-under-test-dhkb8" hotplug volume removed status.result.vmLiveMigration: VMI "vmi-under-test-dhkb8" migration completed status.result.vmVolumeClone: 'DV cloneType: "csi-clone"' status.result.vmsWithNonVirtRbdStorageClass: <vm_list> 15 status.result.vmsWithUnsetEfsStorageClass: <vm_list> 16
$ oc delete job -n <target_namespace> storage-checkup
$ oc delete config-map -n <target_namespace> storage-checkup-config
$ oc delete -f <storage_sa_roles_rolebinding>.yaml
12.2.3.3.
예 12.3.
--- apiVersion: v1 kind: ServiceAccount metadata: name: dpdk-checkup-sa --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: kiagnose-configmap-access rules: - apiGroups: [ "" ] resources: [ "configmaps" ] verbs: [ "get", "update" ] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: kiagnose-configmap-access subjects: - kind: ServiceAccount name: dpdk-checkup-sa roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: kiagnose-configmap-access --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: kubevirt-dpdk-checker rules: - apiGroups: [ "kubevirt.io" ] resources: [ "virtualmachineinstances" ] verbs: [ "create", "get", "delete" ] - apiGroups: [ "subresources.kubevirt.io" ] resources: [ "virtualmachineinstances/console" ] verbs: [ "get" ] - apiGroups: [ "" ] resources: [ "configmaps" ] verbs: [ "create", "delete" ] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: kubevirt-dpdk-checker subjects: - kind: ServiceAccount name: dpdk-checkup-sa roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: kubevirt-dpdk-checker
$ oc apply -n <target_namespace> -f <dpdk_sa_roles_rolebinding>.yaml
apiVersion: v1 kind: ConfigMap metadata: name: dpdk-checkup-config labels: kiagnose/checkup-type: kubevirt-dpdk data: spec.timeout: 10m spec.param.networkAttachmentDefinitionName: <network_name> 1 spec.param.trafficGenContainerDiskImage: "quay.io/kiagnose/kubevirt-dpdk-checkup-traffic-gen:v0.3.1 2 spec.param.vmUnderTestContainerDiskImage: "quay.io/kiagnose/kubevirt-dpdk-checkup-vm:v0.3.1" 3
$ oc apply -n <target_namespace> -f <dpdk_config_map>.yaml
apiVersion: batch/v1 kind: Job metadata: name: dpdk-checkup labels: kiagnose/checkup-type: kubevirt-dpdk spec: backoffLimit: 0 template: spec: serviceAccountName: dpdk-checkup-sa restartPolicy: Never containers: - name: dpdk-checkup image: registry.redhat.io/container-native-virtualization/kubevirt-dpdk-checkup-rhel9:v4.15.0 imagePullPolicy: Always securityContext: allowPrivilegeEscalation: false capabilities: drop: ["ALL"] runAsNonRoot: true seccompProfile: type: "RuntimeDefault" env: - name: CONFIGMAP_NAMESPACE value: <target-namespace> - name: CONFIGMAP_NAME value: dpdk-checkup-config - name: POD_UID valueFrom: fieldRef: fieldPath: metadata.uid
$ oc apply -n <target_namespace> -f <dpdk_job>.yaml
$ oc wait job dpdk-checkup -n <target_namespace> --for condition=complete --timeout 10m
$ oc get configmap dpdk-checkup-config -n <target_namespace> -o yaml
apiVersion: v1 kind: ConfigMap metadata: name: dpdk-checkup-config labels: kiagnose/checkup-type: kubevirt-dpdk data: spec.timeout: 10m spec.param.NetworkAttachmentDefinitionName: "dpdk-network-1" spec.param.trafficGenContainerDiskImage: "quay.io/kiagnose/kubevirt-dpdk-checkup-traffic-gen:v0.2.0" spec.param.vmUnderTestContainerDiskImage: "quay.io/kiagnose/kubevirt-dpdk-checkup-vm:v0.2.0" status.succeeded: "true" 1 status.failureReason: "" 2 status.startTimestamp: "2023-07-31T13:14:38Z" 3 status.completionTimestamp: "2023-07-31T13:19:41Z" 4 status.result.trafficGenSentPackets: "480000000" 5 status.result.trafficGenOutputErrorPackets: "0" 6 status.result.trafficGenInputErrorPackets: "0" 7 status.result.trafficGenActualNodeName: worker-dpdk1 8 status.result.vmUnderTestActualNodeName: worker-dpdk2 9 status.result.vmUnderTestReceivedPackets: "480000000" 10 status.result.vmUnderTestRxDroppedPackets: "0" 11 status.result.vmUnderTestTxDroppedPackets: "0" 12
$ oc delete job -n <target_namespace> dpdk-checkup
$ oc delete config-map -n <target_namespace> dpdk-checkup-config
$ oc delete -f <dpdk_sa_roles_rolebinding>.yaml
12.2.3.3.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12.2.3.3.2.
# dnf install libguestfs-tools
# composer-cli distros list
참고# usermod -a -G weldr user
$ newgrp weldr
$ cat << EOF > dpdk-vm.toml name = "dpdk_image" description = "Image to use with the DPDK checkup" version = "0.0.1" distro = "rhel-87" [[customizations.user]] name = "root" password = "redhat" [[packages]] name = "dpdk" [[packages]] name = "dpdk-tools" [[packages]] name = "driverctl" [[packages]] name = "tuned-profiles-cpu-partitioning" [customizations.kernel] append = "default_hugepagesz=1GB hugepagesz=1G hugepages=1" [customizations.services] disabled = ["NetworkManager-wait-online", "sshd"] EOF
# composer-cli blueprints push dpdk-vm.toml
# composer-cli compose start dpdk_image qcow2
# composer-cli compose status
# composer-cli compose image <UUID>
$ cat <<EOF >customize-vm #!/bin/bash # Setup hugepages mount mkdir -p /mnt/huge echo "hugetlbfs /mnt/huge hugetlbfs defaults,pagesize=1GB 0 0" >> /etc/fstab # Create vfio-noiommu.conf echo "options vfio enable_unsafe_noiommu_mode=1" > /etc/modprobe.d/vfio-noiommu.conf # Enable guest-exec,guest-exec-status on the qemu-guest-agent configuration sed -i '/^BLACKLIST_RPC=/ { s/guest-exec-status//; s/guest-exec//g }' /etc/sysconfig/qemu-ga sed -i '/^BLACKLIST_RPC=/ { s/,\+/,/g; s/^,\|,$//g }' /etc/sysconfig/qemu-ga EOF
$ virt-customize -a <UUID>-disk.qcow2 --run=customize-vm --selinux-relabel
$ cat << EOF > Dockerfile FROM scratch COPY --chown=107:107 <UUID>-disk.qcow2 /disk/ EOF
$ podman build . -t dpdk-rhel:latest
$ podman push dpdk-rhel:latest
12.2.4.
12.3.
12.3.1.
12.3.2.
12.3.2.1.
- 참고참고
12.3.2.2.
- 참고
12.3.3.
12.3.3.1.
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_vcpu_wait_seconds_total[6m]))) > 0 1
12.3.3.2.
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_network_receive_bytes_total[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_network_transmit_bytes_total[6m]))) > 0 1
12.3.3.3.
12.3.3.3.1.
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_storage_read_traffic_bytes_total[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_storage_write_traffic_bytes_total[6m]))) > 0 1
12.3.3.3.2.
kubevirt_vmsnapshot_disks_restored_from_source{vm_name="simple-vm", vm_namespace="default"} 1
kubevirt_vmsnapshot_disks_restored_from_source_bytes{vm_name="simple-vm", vm_namespace="default"} 1
12.3.3.3.3.
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_storage_iops_read_total[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_storage_iops_write_total[6m]))) > 0 1
12.3.3.4.
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_memory_swap_in_traffic_bytes[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_memory_swap_out_traffic_bytes[6m]))) > 0 1
12.3.3.5.
12.3.4.
12.4.
12.4.1.
12.4.2.
$ wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
$ sudo tar xvf node_exporter-1.3.1.linux-amd64.tar.gz \ --directory /usr/bin --strip 1 "*/node_exporter"
[Unit] Description=Prometheus Metrics Exporter After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=1 User=root ExecStart=/usr/bin/node_exporter [Install] WantedBy=multi-user.target
$ sudo systemctl enable node_exporter.service $ sudo systemctl start node_exporter.service
$ curl http://localhost:9100/metrics
go_gc_duration_seconds{quantile="0"} 1.5244e-05 go_gc_duration_seconds{quantile="0.25"} 3.0449e-05 go_gc_duration_seconds{quantile="0.5"} 3.7913e-05
12.4.3.
spec: template: metadata: labels: monitor: metrics
12.4.3.1.
$ oc get service -n <namespace> <node-exporter-service>
$ curl http://<172.30.226.162:9100>/metrics | grep -vE "^#|^$"
node_arp_entries{device="eth0"} 1 node_boot_time_seconds 1.643153218e+09 node_context_switches_total 4.4938158e+07 node_cooling_device_cur_state{name="0",type="Processor"} 0 node_cooling_device_max_state{name="0",type="Processor"} 0 node_cpu_guest_seconds_total{cpu="0",mode="nice"} 0 node_cpu_guest_seconds_total{cpu="0",mode="user"} 0 node_cpu_seconds_total{cpu="0",mode="idle"} 1.10586485e+06 node_cpu_seconds_total{cpu="0",mode="iowait"} 37.61 node_cpu_seconds_total{cpu="0",mode="irq"} 233.91 node_cpu_seconds_total{cpu="0",mode="nice"} 551.47 node_cpu_seconds_total{cpu="0",mode="softirq"} 87.3 node_cpu_seconds_total{cpu="0",mode="steal"} 86.12 node_cpu_seconds_total{cpu="0",mode="system"} 464.15 node_cpu_seconds_total{cpu="0",mode="user"} 1075.2 node_disk_discard_time_seconds_total{device="vda"} 0 node_disk_discard_time_seconds_total{device="vdb"} 0 node_disk_discarded_sectors_total{device="vda"} 0 node_disk_discarded_sectors_total{device="vdb"} 0 node_disk_discards_completed_total{device="vda"} 0 node_disk_discards_completed_total{device="vdb"} 0 node_disk_discards_merged_total{device="vda"} 0 node_disk_discards_merged_total{device="vdb"} 0 node_disk_info{device="vda",major="252",minor="0"} 1 node_disk_info{device="vdb",major="252",minor="16"} 1 node_disk_io_now{device="vda"} 0 node_disk_io_now{device="vdb"} 0 node_disk_io_time_seconds_total{device="vda"} 174 node_disk_io_time_seconds_total{device="vdb"} 0.054 node_disk_io_time_weighted_seconds_total{device="vda"} 259.79200000000003 node_disk_io_time_weighted_seconds_total{device="vdb"} 0.039 node_disk_read_bytes_total{device="vda"} 3.71867136e+08 node_disk_read_bytes_total{device="vdb"} 366592 node_disk_read_time_seconds_total{device="vda"} 19.128 node_disk_read_time_seconds_total{device="vdb"} 0.039 node_disk_reads_completed_total{device="vda"} 5619 node_disk_reads_completed_total{device="vdb"} 96 node_disk_reads_merged_total{device="vda"} 5 node_disk_reads_merged_total{device="vdb"} 0 node_disk_write_time_seconds_total{device="vda"} 240.66400000000002 node_disk_write_time_seconds_total{device="vdb"} 0 node_disk_writes_completed_total{device="vda"} 71584 node_disk_writes_completed_total{device="vdb"} 0 node_disk_writes_merged_total{device="vda"} 19761 node_disk_writes_merged_total{device="vdb"} 0 node_disk_written_bytes_total{device="vda"} 2.007924224e+09 node_disk_written_bytes_total{device="vdb"} 0
12.4.4.
apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: k8s-app: node-exporter-metrics-monitor name: node-exporter-metrics-monitor 1 namespace: dynamation 2 spec: endpoints: - interval: 30s 3 port: exmet 4 scheme: http selector: matchLabels: servicetype: metrics
$ oc create -f node-exporter-metrics-monitor.yaml
12.4.4.1.
$ oc expose service -n <namespace> <node_exporter_service_name>
$ oc get route -o=custom-columns=NAME:.metadata.name,DNS:.spec.host
NAME DNS node-exporter-service node-exporter-service-dynamation.apps.cluster.example.org
$ curl -s http://node-exporter-service-dynamation.apps.cluster.example.org/metrics
go_gc_duration_seconds{quantile="0"} 1.5382e-05 go_gc_duration_seconds{quantile="0.25"} 3.1163e-05 go_gc_duration_seconds{quantile="0.5"} 3.8546e-05 go_gc_duration_seconds{quantile="0.75"} 4.9139e-05 go_gc_duration_seconds{quantile="1"} 0.000189423
12.4.5.
12.5.
12.5.1.
12.5.1.1.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: annotations: name: fedora-vm namespace: example-namespace # ... spec: template: spec: readinessProbe: httpGet: 1 port: 1500 2 path: /healthz 3 httpHeaders: - name: Custom-Header value: Awesome initialDelaySeconds: 120 4 periodSeconds: 20 5 timeoutSeconds: 10 6 failureThreshold: 3 7 successThreshold: 3 8 # ...
$ oc create -f <file_name>.yaml
12.5.1.2.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: annotations: name: fedora-vm namespace: example-namespace # ... spec: template: spec: readinessProbe: initialDelaySeconds: 120 1 periodSeconds: 20 2 tcpSocket: 3 port: 1500 4 timeoutSeconds: 10 5 # ...
$ oc create -f <file_name>.yaml
12.5.1.3.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: annotations: name: fedora-vm namespace: example-namespace # ... spec: template: spec: livenessProbe: initialDelaySeconds: 120 1 periodSeconds: 20 2 httpGet: 3 port: 1500 4 path: /healthz 5 httpHeaders: - name: Custom-Header value: Awesome timeoutSeconds: 10 6 # ...
$ oc create -f <file_name>.yaml
12.5.2.
- 참고
12.5.2.1.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: labels: kubevirt.io/vm: vm2-rhel84-watchdog name: <vm-name> spec: running: false template: metadata: labels: kubevirt.io/vm: vm2-rhel84-watchdog spec: domain: devices: watchdog: name: <watchdog> i6300esb: action: "poweroff" 1 # ...
$ oc apply -f <file_name>.yaml
$ lspci | grep watchdog -i
# echo c > /proc/sysrq-trigger
# pkill -9 watchdog
12.5.2.2.
# yum install watchdog
#watchdog-device = /dev/watchdog
# systemctl enable --now watchdog.service
12.5.3.
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: annotations: name: fedora-vm namespace: example-namespace # ... spec: template: spec: readinessProbe: guestAgentPing: {} 1 initialDelaySeconds: 120 2 periodSeconds: 20 3 timeoutSeconds: 10 4 failureThreshold: 3 5 successThreshold: 3 6 # ...
$ oc create -f <file_name>.yaml
12.5.4.
12.6.
12.6.1.
12.6.2.
12.6.3.
12.6.4.
12.6.5.
12.6.6.
12.6.7.
12.6.8.
12.6.9.
12.6.10.
12.6.11.
12.6.12.
12.6.13.
12.6.14.
12.6.15.
12.6.16.
12.6.17.
12.6.18.
12.6.19.
12.6.20.
12.6.21.
12.6.22.
12.6.23.
12.6.24.
12.6.25.
12.6.26.
12.6.27.
12.6.28.
12.6.29.
12.6.30.
12.6.31.
12.6.32.
12.6.33.
12.6.34.
12.6.35.
12.6.36.
12.6.37.
12.6.38.
12.6.39.
12.6.40.
12.6.41.
12.6.42.
12.6.43.
12.6.44.
12.6.45.
12.6.46.
12.6.47.
12.6.48.
12.6.49.
12.6.50.
12.6.51.
12.6.52.
12.6.53.
12.6.54.
12.6.55.
12.6.56.
12.6.57.
13장.
13.1.
13.1.1.
13.1.1.1.
13.1.1.1.1.
13.1.1.2.
13.1.2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13.2.
13.2.1.
13.2.2.
13.2.3.
$ oc adm must-gather \ --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.15.8 \ -- /usr/bin/gather
13.2.3.1.
13.2.3.1.1.
- 중요
13.2.3.1.2.
|
|
|
|
|
|
$ oc adm must-gather \ --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.15.8 \ -- <environment_variable_1> <environment_variable_2> <script_name>
$ oc adm must-gather \
--image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.15.8 \
-- PROS=5 /usr/bin/gather 1
$ oc adm must-gather \
--image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.15.8 \
-- NS=mynamespace VM=my-vm /usr/bin/gather --vms_details 1
$ oc adm must-gather \ --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.15.8 \ /usr/bin/gather --images
$ oc adm must-gather \ --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.15.8 \ /usr/bin/gather --instancetypes
13.3.
13.3.1.
$ oc get events -n <namespace>
$ oc describe <resource> <resource_name>
13.3.2.
13.3.2.1.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: logVerbosityConfig: kubevirt: virtAPI: 5 1 virtController: 4 virtHandler: 3 virtLauncher: 2 virtOperator: 6
13.3.2.2.
13.3.2.3.
$ oc get pods -n openshift-cnv
예 13.1.
NAME READY STATUS RESTARTS AGE disks-images-provider-7gqbc 1/1 Running 0 32m disks-images-provider-vg4kx 1/1 Running 0 32m virt-api-57fcc4497b-7qfmc 1/1 Running 0 31m virt-api-57fcc4497b-tx9nc 1/1 Running 0 31m virt-controller-76c784655f-7fp6m 1/1 Running 0 30m virt-controller-76c784655f-f4pbd 1/1 Running 0 30m virt-handler-2m86x 1/1 Running 0 30m virt-handler-9qs6z 1/1 Running 0 30m virt-operator-7ccfdbf65f-q5snk 1/1 Running 0 32m virt-operator-7ccfdbf65f-vllz8 1/1 Running 0 32m
$ oc logs -n openshift-cnv <pod_name>
참고예 13.2.
{"component":"virt-handler","level":"info","msg":"set verbosity to 2","pos":"virt-handler.go:453","timestamp":"2022-04-17T08:58:37.373695Z"} {"component":"virt-handler","level":"info","msg":"set verbosity to 2","pos":"virt-handler.go:453","timestamp":"2022-04-17T08:58:37.373726Z"} {"component":"virt-handler","level":"info","msg":"setting rate limiter to 5 QPS and 10 Burst","pos":"virt-handler.go:462","timestamp":"2022-04-17T08:58:37.373782Z"} {"component":"virt-handler","level":"info","msg":"CPU features of a minimum baseline CPU model: map[apic:true clflush:true cmov:true cx16:true cx8:true de:true fpu:true fxsr:true lahf_lm:true lm:true mca:true mce:true mmx:true msr:true mtrr:true nx:true pae:true pat:true pge:true pni:true pse:true pse36:true sep:true sse:true sse2:true sse4.1:true ssse3:true syscall:true tsc:true]","pos":"cpu_plugin.go:96","timestamp":"2022-04-17T08:58:37.390221Z"} {"component":"virt-handler","level":"warning","msg":"host model mode is expected to contain only one model","pos":"cpu_plugin.go:103","timestamp":"2022-04-17T08:58:37.390263Z"} {"component":"virt-handler","level":"info","msg":"node-labeller is running","pos":"node_labeller.go:94","timestamp":"2022-04-17T08:58:37.391011Z"}
13.3.3.
13.3.3.1.
13.3.3.2.
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: virtualMachineOptions: disableSerialConsoleLog: true 1 #...
13.3.3.3.
13.3.3.4.
$ oc edit vm <vm_name>
apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: name: example-vm spec: template: spec: domain: devices: logSerialConsole: true 1 #...
$ oc apply vm <vm_name>
$ virtctl restart <vm_name> -n <namespace>
13.3.3.5.
13.3.3.6.
$ oc logs -n <namespace> -l kubevirt.io/domain=<vm_name> --tail=-1 -c guest-console-log
13.3.4.
13.3.4.1.
13.3.4.2.
|
{log_type=~".+"}|json |kubernetes_labels_app_kubernetes_io_part_of="hyperconverged-cluster" |
|
{log_type=~".+"}|json |kubernetes_labels_app_kubernetes_io_part_of="hyperconverged-cluster" |kubernetes_labels_app_kubernetes_io_component="storage" |
|
{log_type=~".+"}|json |kubernetes_labels_app_kubernetes_io_part_of="hyperconverged-cluster" |kubernetes_labels_app_kubernetes_io_component="deployment" |
|
{log_type=~".+"}|json |kubernetes_labels_app_kubernetes_io_part_of="hyperconverged-cluster" |kubernetes_labels_app_kubernetes_io_component="network" |
|
{log_type=~".+"}|json |kubernetes_labels_app_kubernetes_io_part_of="hyperconverged-cluster" |kubernetes_labels_app_kubernetes_io_component="compute" |
|
{log_type=~".+"}|json |kubernetes_labels_app_kubernetes_io_part_of="hyperconverged-cluster" |kubernetes_labels_app_kubernetes_io_component="schedule" |
|
{log_type=~".+",kubernetes_container_name=~"<container>|<container>"} 1
|json|kubernetes_labels_app_kubernetes_io_part_of="hyperconverged-cluster"
|
|
{log_type=~".+", kubernetes_container_name="compute"}|json
|!= "custom-ga-command" 1
|
|
|
|
|
|
|
|
|
{log_type=~".+"}|json |kubernetes_labels_app_kubernetes_io_part_of="hyperconverged-cluster" |= "error" != "timeout"
13.3.5.
13.3.6.
13.3.6.1.
$ oc describe dv <DataVolume>
13.3.6.2.
Status: Conditions: Last Heart Beat Time: 2020-07-15T03:58:24Z Last Transition Time: 2020-07-15T03:58:24Z Message: PVC win10-rootdisk Bound Reason: Bound Status: True Type: Bound ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Bound 24s datavolume-controller PVC example-dv Bound
Status: Conditions: Last Heart Beat Time: 2020-07-15T04:31:39Z Last Transition Time: 2020-07-15T04:31:39Z Message: Import Complete Reason: Completed Status: False Type: Running ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning Error 12s (x2 over 14s) datavolume-controller Unable to connect to http data source: expected status code 200, got 404. Status: 404 Not Found
Status: Conditions: Last Heart Beat Time: 2020-07-15T04:31:39Z Last Transition Time: 2020-07-15T04:31:39Z Status: True Type: Ready
14장.
14.1.
14.1.1.
14.1.2.
14.1.2.1.
14.1.2.2.
apiVersion: snapshot.kubevirt.io/v1alpha1 kind: VirtualMachineSnapshot metadata: name: <snapshot_name> spec: source: apiGroup: kubevirt.io kind: VirtualMachine name: <vm_name>
$ oc create -f <snapshot_name>.yaml
$ oc wait <vm_name> <snapshot_name> --for condition=Ready
- 참고
$ oc describe vmsnapshot <snapshot_name>
apiVersion: snapshot.kubevirt.io/v1alpha1 kind: VirtualMachineSnapshot metadata: creationTimestamp: "2020-09-30T14:41:51Z" finalizers: - snapshot.kubevirt.io/vmsnapshot-protection generation: 5 name: mysnap namespace: default resourceVersion: "3897" selfLink: /apis/snapshot.kubevirt.io/v1alpha1/namespaces/default/virtualmachinesnapshots/my-vmsnapshot uid: 28eedf08-5d6a-42c1-969c-2eda58e2a78d spec: source: apiGroup: kubevirt.io kind: VirtualMachine name: my-vm status: conditions: - lastProbeTime: null lastTransitionTime: "2020-09-30T14:42:03Z" reason: Operation complete status: "False" 1 type: Progressing - lastProbeTime: null lastTransitionTime: "2020-09-30T14:42:03Z" reason: Operation complete status: "True" 2 type: Ready creationTime: "2020-09-30T14:42:03Z" readyToUse: true 3 sourceUID: 355897f3-73a0-4ec4-83d3-3c2df9486f4f virtualMachineSnapshotContentName: vmsnapshot-content-28eedf08-5d6a-42c1-969c-2eda58e2a78d 4
14.1.3.
14.1.4.
14.1.4.1.
14.1.4.2.
apiVersion: snapshot.kubevirt.io/v1alpha1 kind: VirtualMachineRestore metadata: name: <vm_restore> spec: target: apiGroup: kubevirt.io kind: VirtualMachine name: <vm_name> virtualMachineSnapshotName: <snapshot_name>
$ oc create -f <vm_restore>.yaml
$ oc get vmrestore <vm_restore>
apiVersion: snapshot.kubevirt.io/v1alpha1 kind: VirtualMachineRestore metadata: creationTimestamp: "2020-09-30T14:46:27Z" generation: 5 name: my-vmrestore namespace: default ownerReferences: - apiVersion: kubevirt.io/v1 blockOwnerDeletion: true controller: true kind: VirtualMachine name: my-vm uid: 355897f3-73a0-4ec4-83d3-3c2df9486f4f resourceVersion: "5512" selfLink: /apis/snapshot.kubevirt.io/v1alpha1/namespaces/default/virtualmachinerestores/my-vmrestore uid: 71c679a8-136e-46b0-b9b5-f57175a6a041 spec: target: apiGroup: kubevirt.io kind: VirtualMachine name: my-vm virtualMachineSnapshotName: my-vmsnapshot status: complete: true 1 conditions: - lastProbeTime: null lastTransitionTime: "2020-09-30T14:46:28Z" reason: Operation complete status: "False" 2 type: Progressing - lastProbeTime: null lastTransitionTime: "2020-09-30T14:46:28Z" reason: Operation complete status: "True" 3 type: Ready deletedDataVolumes: - test-dv1 restoreTime: "2020-09-30T14:46:28Z" restores: - dataVolumeName: restore-71c679a8-136e-46b0-b9b5-f57175a6a041-datavolumedisk1 persistentVolumeClaim: restore-71c679a8-136e-46b0-b9b5-f57175a6a041-datavolumedisk1 volumeName: datavolumedisk1 volumeSnapshotName: vmsnapshot-28eedf08-5d6a-42c1-969c-2eda58e2a78d-volume-datavolumedisk1
14.1.5.
14.1.5.1.
14.1.5.2.
$ oc delete vmsnapshot <snapshot_name>
$ oc get vmsnapshot
14.1.6.
14.2.
14.2.1.
- 주의
14.2.2.
- 참고
apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication metadata: name: <dpa_sample> namespace: openshift-adp 1 spec: configuration: velero: defaultPlugins: - kubevirt 2 - gcp 3 - csi 4 - openshift 5 resourceTimeout: 10m 6 nodeAgent: 7 enable: true 8 uploaderType: kopia 9 podConfig: nodeSelector: <node_selector> 10 backupLocations: - velero: provider: gcp 11 default: true credential: key: cloud name: <default_secret> 12 objectStorage: bucket: <bucket_name> 13 prefix: <prefix> 14
$ oc get all -n openshift-adp
NAME READY STATUS RESTARTS AGE pod/oadp-operator-controller-manager-67d9494d47-6l8z8 2/2 Running 0 2m8s pod/node-agent-9cq4q 1/1 Running 0 94s pod/node-agent-m4lts 1/1 Running 0 94s pod/node-agent-pv4kr 1/1 Running 0 95s pod/velero-588db7f655-n842v 1/1 Running 0 95s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/oadp-operator-controller-manager-metrics-service ClusterIP 172.30.70.140 <none> 8443/TCP 2m8s service/openshift-adp-velero-metrics-svc ClusterIP 172.30.10.0 <none> 8085/TCP 8h NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE daemonset.apps/node-agent 3 3 3 3 3 <none> 96s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/oadp-operator-controller-manager 1/1 1 1 2m9s deployment.apps/velero 1/1 1 1 96s NAME DESIRED CURRENT READY AGE replicaset.apps/oadp-operator-controller-manager-67d9494d47 1 1 1 2m9s replicaset.apps/velero-588db7f655 1 1 1 96s
$ oc get dpa dpa-sample -n openshift-adp -o jsonpath='{.status}'
{"conditions":[{"lastTransitionTime":"2023-10-27T01:23:57Z","message":"Reconcile complete","reason":"Complete","status":"True","type":"Reconciled"}]}
$ oc get backupstoragelocations.velero.io -n openshift-adp
NAME PHASE LAST VALIDATED AGE DEFAULT dpa-sample-1 Available 1s 3d16h true
14.3.
14.3.1.
14.3.1.1.
Legal Notice
Copyright © 2024 Red Hat, Inc.
OpenShift documentation is licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0).
Modified versions must remove all Red Hat trademarks.
Portions adapted from https://github.com/kubernetes-incubator/service-catalog/ with modifications by Red Hat.
Red Hat, Red Hat Enterprise Linux, the Red Hat logo, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation’s permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.