Red Hatã§ã½ãªã¥ã¼ã·ã§ã³ã¢ã¼ããã¯ãããã¦ããç°ä¸å¸æ©(@tnk4on)ã§ãã ãã®é£è¼ã¯vSphereç°å¢ä¸ã«OpenShift Container Platformï¼ä»¥ä¸ãOpenShiftï¼ããã³OpenShift Virtualizationã®ç°å¢ãæ§ç¯ããæ¹æ³ã解説ããã·ãªã¼ãºã§ãã
第4åã¯OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¨å®è¡æ¹æ³ã«ã¤ãã¦è§£èª¬ãã¾ããä»å¾ã®é£è¼äºå®ã¯ä¸è¨ã®éãã§ãã
- 第1åï¼OpenShiftã®ã¤ã³ã¹ãã¼ã«
- 第2åï¼OpenShiftã¤ã³ã¹ãã¼ã«å¾ã®ä½æ¥
- 第3åï¼å ±æã¹ãã¬ã¼ã¸ã®ä½æï¼NFS CSIãã©ã¤ãã¼ã®æ§ç¯ï¼
- 第4åï¼OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¨å®è¡ï¼âæ¬è¨äºï¼
- 第5åï¼vSphereä»®æ³ãã·ã³ã®ç§»è¡
- ãçªå¤ç·¨ãï¼å ±æã¹ãã¬ã¼ã¸ã®ä½æï¼NFSãããã¸ã§ãã¼ã®æ§ç¯ï¼
ï¼2024/9/29追è¨ï¼OpenShift Virtualization v4.16.3ã§Nestedç°å¢ã®ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã®ä¸å ·åã¯ä¿®æ£ããã¾ããï¼
ï¼2024/10/1追è¨ï¼OpenShift Virtualization v4.16.2ã§ãèµ·åããªã¥ã¼ã ããCentOS 7ããã³CentOS Stream 8ã¯åé¤ããã¾ããï¼
-ç®æ¬¡-
- OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¨å®è¡æ¹æ³
- åææ¡ä»¶
- 1. OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«
- 2. 追å ã®OpenShiftã®è¨å®å¤æ´
- 3. CLIãã¼ã«ï¼virtctlï¼ã®ã¤ã³ã¹ãã¼ã«
- 4. ä»®æ³ãã·ã³ã®ä½æï¼ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããä½æï¼
- 5. ä»®æ³ãã·ã³ã®ä½æï¼ãã³ãã¬ã¼ãããä½æï¼
- 6. ä»®æ³ãã·ã³ã®èµ·åã¨åæ¢
- 7. ä»®æ³ãã·ã³ã®ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³
- ã¾ã¨ã
OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¨å®è¡æ¹æ³
æ¬è¨äºã§ã¯ OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¨å®è¡æ¹æ³ã«ã¤ãã¦ãä¸è¨ã®å 容ãç´¹ä»ãã¾ãã
- OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«
- 追å ã®OpenShiftã®è¨å®å¤æ´
- CLIãã¼ã«ï¼virtctlï¼ã®ã¤ã³ã¹ãã¼ã«
- ä»®æ³ãã·ã³ã®ä½æï¼ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããä½æï¼
- ä»®æ³ãã·ã³ã®ä½æï¼ãã³ãã¬ã¼ãããä½æï¼
- ä»®æ³ãã·ã³ã®èµ·åã¨åæ¢
- ä»®æ³ãã·ã³ã®ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³
OpenShift Virtualizationã§ã¯ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããä½æããæ¹æ³ã¨ãã³ãã¬ã¼ãã«ã¿ãã°ããä½æããæ¹æ³ã®2種é¡ã®ä»®æ³ãã·ã³ã®ä½ææ¹æ³ãããã¾ãã æ¬è¨äºã«ããã¦ãã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããä½æããæ¹æ³ã§ã¯RHEL 9ã®ä»®æ³ãã·ã³ã®ä½ææ¹æ³ãããã³ãã¬ã¼ãã«ã¿ãã°ããä½æããæ¹æ³ã§ã¯Windows Server 2022ã®ä»®æ³ãã·ã³ã®ä½ææ¹æ³ãç´¹ä»ãã¾ãã
ãªãã¡ã¬ã³ã¹å®è£ ã¬ã¤ã
OpenShift Virtualizationã®æ§æã®ããã®åèæ å ±ã¨ãã¦ããªãã¡ã¬ã³ã¹å®è£ ã¬ã¤ãï¼è±èªï¼ãå ¬éããã¦ãã¾ãã æå°æ§æã®3ãã¼ãæ§æãã大è¦æ¨¡æ§æã¾ã§ããã¼ãã¦ã§ã¢ã®æ§æã®ããã®åèã¨ãªãæ å ±ãè¨è¼ããã¦ãã¾ãã å®ç¨¼åç°å¢ã§ã®ãµã¤ã¸ã³ã°ã®åèã«ãã¦ãã ããã
OpenShift Virtualization - ãªãã¡ã¬ã³ã¹å®è£ ã¬ã¤ã - Red Hat Customer Portal
ãµãã¼ã対象ã®ã²ã¹ããªãã¬ã¼ãã£ã³ã°ã·ã¹ãã
OpenShift Virtualizationããµãã¼ãããã²ã¹ãOSã®ãªã¹ãã¯ä¸è¨ã®ãã¼ã¸ã«è¨è¼ãããã¾ãã
RHELã¨Windowsï¼ã¯ã©ã¤ã¢ã³ãOSããã³Server OSï¼ã«ã¤ãã¦è¨è¼ãããããã以å¤ã®OSã«ã¤ãã¦ã¯ãRed Hatã®ãµã¼ããã¼ãã£ã®ã½ããã¦ã§ã¢ãµãã¼ãããªã·ã¼*1ã«å¾ã£ã¦ãµãã¼ãããã¾ãã
Windows Server OSã®ãµãã¼ãã¯Microsoft SVVPã«ã¦èªå®ããã¦ãã¾ãã ãªããMicrosoft SVVPã§ã¯ã¯ã©ã¤ã¢ã³ãOSã®èªå®ã¯ãªãããããã¨ãã°Windows 11ã¯Windows Server 2022ã¨åæ§ã«ãµãã¼ãããã¾ãã
åææ¡ä»¶
- é£è¼ç¬¬3åã®ä½æ¥ãå®äºãã¦ãããã¨ã¨ãã¾ã
- å ¨ä½ã®æ§æãåãã©ã¡ã¼ã¿ã¼ãªã©ã¯ç¬¬1åãåç §ãã¦ãã ãã
- ä½æ¥ç¨ç«¯æ«ã®ããã³ããã¯
%
ã¨ãã¾ã - è¸ã¿å°ãµã¼ãã¼ã®ããã³ããã¯
$
ã¨ãã¾ã - è¸ã¿å°ãµã¼ãã¼ã®ä½æ¥ã¯æ示çã«è¨è¼ãããå ´åãé¤ãã¦ãä½æ¥ãã£ã¬ã¯ããª
${HOME}/work
ã§ä½æ¥ãããã¨ã¨ãã¾ã
1. OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«
1-1 ã¤ã³ã¹ãã¼ã«ã®æ¦è¦
OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¯ãOperatorã使ç¨ãã¦è¡ãã¾ããOperatorã¨ã¯ãKubernetesä¸ã§ã¢ããªã±ã¼ã·ã§ã³ããµã¼ãã¹ã®ã©ã¤ããµã¤ã¯ã«ç®¡çãèªååããããã®ã«ã¹ã¿ã ãªã½ã¼ã¹ã§ãã
Operatorã使ã£ãã¤ã³ã¹ãã¼ã«ã¯ãOpenShiftä¸ã®Operator Hubã¡ãã¥ã¼ããå®æ½ãã¾ããOperator Hubã¯OpenShiftã«çµ±åãããæ©è½ã®ã²ã¨ã¤ã§ããªã¹ããããOperatorã®ä¸ããé¸æãããã®ãç°¡åã«OpenShiftä¸ã«è¿½å ã§ããã«ã¿ãã°æ©è½ã§ããããã«ãããOpenShiftèªä½ã®æ©è½è¿½å ãããã®ä»ã®ããã«ã¦ã§ã¢ã¢ããªã±ã¼ã·ã§ã³ã®å°å ¥ã容æã«ãªãã¾ãã
Operatorã使ã£ãOpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã®æµãã¯ä¸è¨ã®éãã§ãã
- OpenShift Virtualization Operatorã®ã¤ã³ã¹ãã¼ã«
- HyperConvergedã®ä½æ*2
OpenShift Virtualization Operatorããã³HyperConverged Operatorãæ§æããåã³ã³ãã¼ãã³ãã®è©³ç´°ã¯ãä¸è¨ã®ããã¥ã¡ã³ããåç §ãã¦ãã ããã
1.3. OpenShift Virtualization ã¢ã¼ããã¯ãã£ã¼ | Red Hat Product Documentation
1-2 ã¤ã³ã¹ãã¼ã«ã®åææ¡ä»¶
OpenShift Virtualizationãå®è¡ããããã«ã¯ãä»®æ³ãã·ã³ã®å®è¡å ã¨ãªãã³ã³ãã¥ã¼ããã¼ãã«ã¯ç©çï¼ãã¢ã¡ã¿ã«ï¼ãµã¼ãã¼ãå¿ è¦ã§ãã ãªã³ãã¬ä»¥å¤ã®ã¯ã©ã¦ãç°å¢ã§ã¯ãAWSã¾ãã¯IBM Cloudï¼Tech Previewï¼ããµãã¼ããã©ãããã©ã¼ã ã§ãã OpenShift Virtualizationã®ãµãã¼ã対象ã®ãã©ãããã©ã¼ã ã«ã¤ãã¦ã¯ä¸è¨ã®ããã¥ã¡ã³ããåç §ãã¦ãã ããã
ãªããæ¬é£è¼ã§ã¯vSphereä»®æ³ç°å¢ã使ã£ãæå°æ§æã§ã®æ¤è¨¼ç°å¢æ§ç¯ãç®çã¨ãã¦ãã¾ãã ãã®ããæ¬æ¥å¿ è¦ãªç©çãµã¼ãã¼ã§ã¯ãªããä»®æ³ãã·ã³ä¸ã®ã³ã³ãã¥ã¼ããã¼ãï¼ä»åã¯3ãã¼ãæ§æã®ããã³ã³ããã¼ã«ãã¬ã¼ã³ã¨å ¼ç¨ï¼ä¸ã§å®è¡ãã¾ãã ç©çãµã¼ãã¼ãç¨æã§ããå ´åã¯ãå®ç¨¼åç°å¢ã¨åæ§ã«ç©çãµã¼ãã¼ä¸ã«ç´æ¥OpenShiftãã¤ã³ã¹ãã¼ã«ãã¦ãå©ç¨ãã ããã
1-3 OpenShift Virtualization Operatorã®ã¤ã³ã¹ãã¼ã«
ããããOpenShift Virtualizationã®å ·ä½çãªã¤ã³ã¹ãã¼ã«ä½æ¥ãéå§ãã¾ãã 対象ã®ããã¥ã¡ã³ãã¯ä¸è¨ãåç §ãã¦ãã ããã
4.2. OpenShift virtualization ã®ã¤ã³ã¹ãã¼ã« | Red Hat Product Documentation
OpenShiftã®Webã³ã³ã½ã¼ã«ãããOperator>Operator Hubãã¡ãã¥ã¼ãé¸æãã¾ãã Operator Hubã®ä¸è¦§ç»é¢ã表示ããã¾ããããã§ã¯Red Hatã®æä¾Operatorã ãã§ãªããRed Hatãã¼ããã¼ãã³ãã¥ããã£æä¾ã®Operatorã表示ããã¾ãã
ãã¼ã¯ã¼ãã®å
¥åæ¬ã«openshift virt
ã¨å
¥åããã¨ãã£ã«ã¿ãªã³ã°ããã¦ãOpenShift Virtualizationãã¨ãMigration Toolkit for Virtualization Operatorãã®2ã¤ã表示ããã¾ãã
ããã§ã¯ãOpenShift Virtualizationããé¸æãã¾ãããªããMigration Toolkit for Virtualization Operatorã¯é£è¼ç¬¬5åã§ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãã
ãã£ãã«ã¨ãã¼ã¸ã§ã³ã¯ããã©ã«ã表示ã®ã¾ã¾ã§ãã¤ã³ã¹ãã¼ã«ããæ¼ãã¾ãã
ã¤ã³ã¹ãã¼ã«ã®è©³ç´°å ¥åç»é¢ãéãã¾ããããã§ãããã©ã«ã表示ã®ã¾ã¾ã¤ã³ã¹ãã¼ã«ãæ¼ãã¾ãã ãªããï¼HCï¼OpenShift Virtualization Deploymentãå¿ é ã¨ãªã£ã¦ãã¾ãããããã¯å¾ã»ã©ã¤ã³ã¹ãã¼ã«ããã®ã§ãã®ã¾ã¾ç¡è¦ãã¾ãã
- æ´æ°ãã£ãã«ï¼stableï¼stable以å¤ã«ã¯dev-perviewãããï¼
- ãã¼ã¸ã§ã³ï¼4.16.0ï¼æ¬è¨äºå·çæç¹ã§ã¯ã4.16.0ããææ°ï¼
- ã¤ã³ã¹ãã¼ã«ã¢ã¼ãï¼ã¯ã©ã¹ã¿ã¼ã®ç¹å®ã®namespace
- ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®namespaceï¼Operatoræ¨å¥¨ã®namespace:openshift-cnv*3
- æ´æ°ã®æ¿èªï¼èªå
OpenShift Virtualization Operatorã®ã¤ã³ã¹ãã¼ã«ãéå§ãã¾ããç°å¢ã«ãããã¾ãããã¤ã³ã¹ãã¼ã«ã®å®äºã¾ã§3ååãã4åç¨åº¦ãããã¾ããã¤ã³ã¹ãã¼ã«ã®å®äºã¾ã§ãã®ã¾ã¾ã§ãå¾ ã¡ãã ããããªããã¤ã³ã¹ãã¼ã«èªä½ã¯ããã¯ã°ã©ã¦ã³ãã§ç¶ç¶ããããããä»ã®ç»é¢ã«é·ç§»ãã¦ãåé¡ããã¾ããã
ã¤ã³ã¹ãã¼ã«ãå®äºããã¨ãHyperConvergedã®ä½æããã¿ã³ã表示ããã¾ãããããæ¼ãã¦æ¬¡ã®ã¹ãããã«é²ã¿ã¾ãã
1-4 HyperConvergedã®ä½æ
å ã®ã¹ãããã§ãHyperConvergedã®ä½æããã¿ã³ãæ¼ãã¨ããHyperConvergedã®ä½æç»é¢ãã表示ããã¾ãã
ãã®ãHyperConvergedã®ä½æç»é¢ãã¯ãWebã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼ãããOperator>ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®Operator>OpenShift Virtualizationããé¸æãã¦è¡¨ç¤ºãããç»é¢ä¸ã®ããHyperConvergedã®ä½æããã¿ã³ãæ¼ããå¾ã«åºãç»é¢ã¨åããã®ã§ããå¥ã®ç»é¢ã«é·ç§»ããå ´åã¯ããããä½æ¥ãç¶ç¶ãã¦ãã ããã
ãHyperConvergedã®ä½æç»é¢ãã§ãã©ã¼ã ãã¥ã¼ã®ã¾ã¾ä¸çªä¸ã«ã¹ã¯ãã¼ã«ãããã¹ã¦ã®ãã©ã¡ã¼ã¿ã¼ã¯ããã©ã«ãã®ã¾ã¾ã§ãä½æããæ¼ãã¾ãã
ãä½æããã¿ã³ãæ¼ããå¾ã¯èªåã§ãã¤ã³ã¹ãã¼ã«æ¸ã¿ã®Operator>Operatorã®è©³ç´°ç»é¢ããããOpenShift Virtualization Deploymentã®ã¿ããé¸æãããç¶æ ã®ç»é¢ã«é·ç§»ãã¾ãã
ã¤ã³ã¹ãã¼ã«ãé²ãã«ã¤ãã¹ãã¼ã¿ã¹ã®è¡¨ç¤ºãå¤ããã¾ãããããç°å¢ã«ããã¾ãããå®äºã¾ã§4åã»ã©ãããã¾ãã®ã§ã¾ã§ãã®ã¾ã¾å¾ æ©ãã¾ãã
ã¤ã³ã¹ãã¼ã«ã®å®äºå¾ãç»é¢ä¸é¨ã«ãããã¢ããç»é¢ã表示ããã¾ãããããã¢ããç»é¢å ã®ãWebã³ã³ã½ã¼ã«ã®æ´æ°ãã®ãªã³ã¯ãæ¼ããã¾ãã¯ãã©ã¦ã¶ããªãã¼ããã¾ãã
ç»é¢ã®æ´æ°å¾ãWebã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼å ã«ãVirtualizationãã®é ç®ã追å ããã¦ãã¾ãã
Webã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼ãããVirtualization>Overviewããé¸æãã¾ããååã¢ã¯ã»ã¹æã¯ãWelcome to OpenShift Virtualizationãã®ç»é¢ã表示ããã¾ãããDo not show this againãã®ãã§ãã¯ããã¯ã¹ãé¸æããã¨æ¬¡åããã¯è¡¨ç¤ºããã¾ããã
1-5 ã¤ã³ã¹ãã¼ã«å¾ã®ç¢ºèª
OpenShift Virtuzalizationã®ã¤ã³ã¹ãã¼ã«ã®ç¢ºèªãè¡ãã¾ãã
ï¼1ï¼ã«ã¿ãã°ç»é¢ã®ç¢ºèª
Webã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼ãããVirtualization>Catalogããé¸æãã¾ãã
ããã§ã¯ä»®æ³ãã·ã³ã®ä½ææã«ä½¿ç¨ããèµ·åããªã¥ã¼ã ããã³ãã¬ã¼ãã«ã¿ãã°ãé¸æã§ãã¾ãã ã«ã¿ãã°ç»é¢ã®ããã©ã«ãã¯ãInstanceTypesãã®ã¿ããé¸æããã¦ãããããã§ã¯èµ·åããªã¥ã¼ã ããOSãä½æã§ãã¾ãã åæç¶æ ã§ã¯ãCentOS Stream 8ãCentOS Stream 9ãCentOS 7ãFedoraãRHEL 8ãRHEL 9ããç¨æããã¦ãã¾ãã
ï¼è¿½è¨ï¼OpenShift Virtualization v4.16.2ã§ãèµ·åããªã¥ã¼ã ããCentOS 7ããã³CentOS Stream 8ã¯åé¤ããã¾ããï¼
ãªãããããã®èµ·åããªã¥ã¼ã ã¯HyperConvergedã®ä½æç´å¾ã¯ç»é²ããã¦ããããããã¯ã°ã©ã¦ã³ãã§è¿½å ã®å¦çãèªåã§è¡ããã¾ãã
ãã®èªå追å å¦çã¯èµ·åããªã¥ã¼ã ã®å ã«ãªããã³ã³ããã¼ãã£ã¹ã¯ããã¤ã³ã¿ã¼ãããä¸ãããã¦ã³ãã¼ãããPVCããã³PVã¨ãã¦è¿½å ãè¡ããã¾ãã
ã³ã³ããã¼ãã£ã¹ã¯ã¨ã¯ãOpenShift Virtualizationã®ä»®æ³ãã·ã³ã®ä½æå ã¨ãªãOSã®ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®ã¤ã¡ã¼ã¸ã®ãã¨ã§ããã³ã³ããã¼ãã£ã¹ã¯ã¯åæã§ç»é²ããããã®ä»¥å¤ã«ãã¦ã¼ã¶ã¼ãä»»æã§ã«ã¹ã¿ã ã¤ã¡ã¼ã¸ãä½æã§ãã¾ããä½ææé ã¯ä¸è¨ã®ããã¥ã¡ã³ããåç §ãã ããã
7.2. ã«ã¹ã¿ã ã¤ã¡ã¼ã¸ããã®ä»®æ³ãã·ã³ã®ä½æ | Red Hat Product Documentation
ãªãããã®ã³ã³ããã¼ãã£ã¹ã¯ã¯ã³ã³ããã¤ã¡ã¼ã¸ã¨ãã¦ä½æãé å¸ãè¡ãã¾ããããbootcï¼Image mode for RHELã®åºç¤æè¡ï¼ãã¨ã¯ç°ãªãã¤ã¡ã¼ã¸å½¢å¼ã§ããæ··åããªãããã«ã注æãã ããã
ï¼2ï¼ã³ã³ããã¼ãã£ã¹ã¯ã®ç¢ºèª
Webã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼ãããã¹ãã¬ã¼ã¸>PersistentVolumeClaimsããé¸æãã¾ãã ããã¸ã§ã¯ãã®é¸æãããopenshift-virtualization-os-imagesããé¸æãããã¨ã§è¡¨ç¤ºããã£ã«ã¿ãªã³ã°ã§ãã¾ãã ã«ã¿ãã°ç»é¢ã§ç¢ºèªããèµ·åããªã¥ã¼ã ã«å¯¾å¿ããPVCããã³PVãç»é²ããã¦ããã®ã確èªã§ãã¾ãã
è¸ã¿å°ãµã¼ãã¼ä¸ã§ä¸è¨ã®ã³ãã³ããå®è¡ããã¨ãä½æãããPVã®å®ãã£ã¬ã¯ããªã®ä¸èº«ã確èªã§ãã¾ãã
èµ·åããªã¥ã¼ã ã®PVã¯ãã£ã¬ã¯ããªé
ä¸ã«disk.img
ãæã¤å½¢å¼ã§ä¿åããã¦ãããã¨ããããã¾ãã
$ tree /mnt/nfs/ | grep -E 'disk.img|pvc-' âââ pvc-7843e9b5-03d2-41b2-a7b8-2fd95399dde3 â  âââ disk.img âââ pvc-8899284c-25c4-4dd9-8a90-47875bbc9cf5 â  âââ disk.img âââ pvc-b3c88568-404c-40c1-a4c8-d252b804a9fc âââ pvc-ba1e3638-e52b-45f9-aa10-3c89a34536b8 â  âââ disk.img âââ pvc-e141698e-886e-4eee-a89c-40acf0813b4a â  âââ disk.img âââ pvc-e21e08d2-9621-4d54-895b-07059f1a0942 â  âââ disk.img âââ pvc-f72ca6c3-39ec-46bf-9900-6f2e95ba5c74 âââ disk.img
OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã確èªã§ããã®ã§ã次ã®ã¹ããã以éã§ã¯ä»®æ³ãã·ã³ã®ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãã
2. 追å ã®OpenShiftã®è¨å®å¤æ´
æ¬é£è¼ã§æ§ç¯ããç°å¢ã§ã¯ã追å ã§ããã¤ãã®è¨å®å¤æ´ãè¡ãã¾ãã
2-1 ã¯ãã¼ã³ã¹ãã©ãã¸ã¼ã®å¤æ´
OpenShift Virtualizationã®ããã©ã«ãè¨å®ã§ã¯ãä»®æ³ãã·ã³ã®ä½ææã«ã¹ãããã·ã§ããã使ã£ãèµ·åããªã¥ã¼ã ã®ã¯ãã¼ã³ãè¡ãã¾ãã ã¹ãã¬ã¼ã¸ã®CSIãã©ã¤ãã¼ãã¹ãããã·ã§ããã«å¯¾å¿ãã¦ããå ´åã¯ãã®æ©è½ã使ããã¾ãã é£è¼ç¬¬3åã§å°å ¥ããNFS CSIãã©ã¤ãã¼ã¯ã¹ãããã·ã§ããã«å¯¾å¿ãã¦ãã¾ããããã®ããã¯ã¨ã³ãã¯Linuxã§æ§ç¯ããæ±ç¨çãªNFSãµã¼ãã¼ããã¦ãã¾ãããã®ããããã©ã«ãã®è¨å®ã®ã¾ã¾ã§ã¯ä»®æ³ãã·ã³ã®ä½æã«é常ã«æéãããããã¾ãä»®æ³ãã·ã³ã®ä½æã«å¤±æãããã¨ãåããã¾ããã
ã¯ãã¼ã³ã¹ãã©ãã¸ã¼ã®è¨å®ã¯ä¸è¨ã®ã³ãã³ãã§ç¢ºèªã§ãã¾ãã
spec
ã®è¨å®ã¯ç©ºã§ãããããã©ã«ãã§ã¯cloneStrategy: snapshot
ãè¨å®ããã¦ãããã¨ãstatus
ã®å
容ããåããã¾ãã
確èªã³ãã³ã
$ oc get storageprofiles nfs-csi -o yaml
確èªã³ãã³ãã¨çµæï¼ä¸é¨çç¥ï¼
$ oc get storageprofiles nfs-csi -o yaml apiVersion: cdi.kubevirt.io/v1beta1 kind: StorageProfile ... spec: {} status: claimPropertySets: - accessModes: - ReadWriteMany volumeMode: Filesystem cloneStrategy: snapshot dataImportCronSourceFormat: pvc provisioner: nfs.csi.k8s.io snapshotClass: csi-nfs-snapclass storageClass: nfs-csi ...
æ¬é£è¼ã§ã¯ãã®è¨å®ãsnaphost
ããcopy
ã«å¤æ´ãã¾ããããã«ãããä»®æ³ãã·ã³ã®ä½ææã«èµ·åããªã¥ã¼ã ãå
ã«ãåç´ãªãã¡ã¤ã«ã³ãã¼ã«ããã¯ãã¼ã³ãå®è¡ããã¾ãã
ãªãããã®å¤æ´ã¯æ¬é£è¼ã®ç°å¢ã§ç¢ºå®ã«åä½ããããã¨ãç®çã¨ãã¦ããå®ç¨¼åç°å¢ã§å¿ ãããæ¨å¥¨ãããã®ã§ã¯ããã¾ãããå®ç¨¼åç°å¢ã«ãããã¯ãã¼ã³ã¹ãã©ãã¸ã¼ã®è¨å®ã¯ãã使ãã®ã¹ãã¬ã¼ã¸ãã¹ãã¬ã¼ã¸ç¨CSIãã©ã¤ãã¼ã§æé©ãªãã®ãæ¡ç¨ãã ããã詳細ã¯åã¹ãã¬ã¼ã¸ãã³ãã¼ã«ãåãåãããã ããã
ã¯ãã¼ã³ã¹ãã©ãã¸ã¼ã®è¨å®å¤æ´ã³ãã³ãã¯ä¸è¨ã§ãã
å®è¡ã³ãã³ã
$ oc patch storageprofile nfs-csi --type=merge -p '{"spec": {"cloneStrategy": "copy"}}'
å®è¡ã³ãã³ãã¨çµæ
$ oc patch storageprofile nfs-csi --type=merge -p '{"spec": {"cloneStrategy": "copy"}}' storageprofile.cdi.kubevirt.io/nfs-csi patched
ã³ãã³ãå®è¡å¾ã¯ä¸è¨ã®ããã«è¨å®å 容ãå¤æ´ããã¾ãã
確èªã³ãã³ã
$ oc get storageprofiles nfs-csi -o yaml
確èªã³ãã³ãã¨çµæï¼ä¸é¨çç¥ï¼
$ oc get storageprofiles nfs-csi -o yaml apiVersion: cdi.kubevirt.io/v1beta1 kind: StorageProfile ... spec: cloneStrategy: copy status: claimPropertySets: - accessModes: - ReadWriteMany volumeMode: Filesystem cloneStrategy: copy dataImportCronSourceFormat: pvc provisioner: nfs.csi.k8s.io snapshotClass: csi-nfs-snapclass storageClass: nfs-csi ...
2-2ï¼OpenShift v4.16.0-v4.16.3éå®ï¼Console Operatorãåèµ·åãç¹°ãè¿ããã°ã®ä¿®æ£
OpenShift v4.16.0ããv4.16.3ã«ã¯Console Operatorã®Podãé »ç¹ã«åèµ·åãç¹°ãè¿ããã°ãããã¾ãã
ãã®ãã°ã®KCSã¯ä¸è¨ã§ãã
Console keeps deploying frequently in OpenShift 4.16 - Red Hat Customer Portal
ãã®ãã°ã®å½±é¿ã«ãããOpenShift Virtualizationã®ã³ã³ã½ã¼ã«ç»é¢ãé »ç¹ã«åããã¨ããç¾è±¡ãçºçãã¾ãã ãã§ã«OpenShift v4.16.4ã§ä¿®æ£ãªãªã¼ã¹ãè¡ããã¦ãã¾ãããv4.16.0ããv4.16.3ã®ãã¼ã¸ã§ã³ã使ã£ã¦ããå ´åã¯ä¸è¨ã®ã¯ã¼ã¯ã¢ã©ã¦ã³ãã®ã³ãã³ããå®è¡ãã¦ãã ããã ãªãã該å½ãã¼ã¸ã§ã³ä»¥å¤ï¼ãã¨ãã°v4.15.xï¼ã§ã¯å®è¡ã¯ä¸è¦ã§ãã
å®è¡ã³ãã³ã
$ oc create configmap cluster-monitoring-config -n openshift-monitoring --from-literal=config.yaml='telemeterClient: enabled: false'
å®è¡ã³ãã³ãã¨çµæ
$ oc create configmap cluster-monitoring-config -n openshift-monitoring --from-literal=config.yaml='telemeterClient: enabled: false' configmap/cluster-monitoring-config created
確èªã³ãã³ã
$ oc get configmap -n openshift-monitoring cluster-monitoring-config -o yaml apiVersion: v1 data: config.yaml: |- telemeterClient: enabled: false kind: ConfigMap metadata: creationTimestamp: "2024-07-25T18:49:01Z" name: cluster-monitoring-config namespace: openshift-monitoring resourceVersion: "3138283" uid: 1f475c16-42b0-4dfb-baa1-5040f8d9ab07
2-3 ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ç¨ã¯ã¼ã¯ã¢ã©ã¦ã³ãã®å®æ½ï¼OpenShift Virtualization v4.16.0-v4.16.2éå®ï¼
ï¼è¿½è¨ï¼OpenShift Virtualization v4.16.3ã§ä¸è¨ã®ä¸å ·åã¯ä¿®æ£æ¸ã¿ã§ãï¼
OpenShift v4.16ã§OpenShift Virtualizationãã¤ã³ã¹ãã¼ã«ããéãããã©ã«ãã§ã¯OpenShift Virtualization v4.16.0ãé¸æããã¾ãï¼æ¬è¨äºå·çæç¹ï¼ã OpenShift Virtualization v4.16.0ã§ä½¿ç¨ãããlibvirtã«åé¡ããããç¹å®ã®ç°å¢ã§ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã«å¤±æãã¾ãã ä»åã®æ¤è¨¼ç°å¢ã§ã¯Nestedç°å¢ã§OpenShift Virtualizationã®ä»®æ³ãã·ã³ãå®è¡ãã¦ãããããããã®åé¡ãçºçãã¾ãã
ãã°ã®ç¹å®ã¨ã¢ããã¹ããªã¼ã ã§ã®ä¿®æ£ã¯è¡ããã¦ãã¾ãããOpenShiftã¨ãã¦ã®ä¿®æ£ãªãªã¼ã¹ã¯ã¾ã ã§ãã
ããã§ãæ¬è¨äºã§ã¯CPUã¢ãã«ã«host-passthrough
ãæå®ãããã¨ã§ã¯ã¼ã¯ã¢ã©ã¦ã³ããå®æ½ããã®åé¡ã«å¯¾å¿ãã¾ãã
ãã®ã¯ã¼ã¯ã¢ã©ã¦ã³ãã¯Red Hatãå ¬å¼ã«åºãã¦ãããã®ã§ã¯ããã¾ãããã注æãã ããã
ãã®ã¯ã¼ã¯ã¢ã©ã¦ã³ãã¯åä¸ãã¹ãä¸ã®ä»®æ³ãã·ã³å士ã§ããã°åãCPUãå©ç¨ããã®ã§ãhost-passthrough
ã®è¨å®ã§ãåé¡ãªãã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã§ãããã¨ãå©ç¨ãã¦ãã¾ãã*4
ãã®è¨å®ã¯kubevirt-hyperconverged
ã«ã¹ã¿ã ãªã½ã¼ã¹ã«è¨å®ãããããã°ãã¼ãã«è¨å®ã¨ãªãã¾ãã
åå¥ã®ä»®æ³ãã·ã³ãã¨ã«è¨å®ãè¡ãããå ´åã¯ãVirtualMachine
ã«ã¹ã¿ã ãªã½ã¼ã¹ã«åå¥ã«è¨å®ãã¦ãã ããã
ã¾ããæ¢åã®è¨å®ã確èªãã¾ããããã©ã«ãã§ã¯è¨å®ã¯ãªãããnull
ã«ãªãã¾ãã
$ oc get -n openshift-cnv hco kubevirt-hyperconverged -o json | jq .spec.defaultCPUModel null
ã¯ã¼ã¯ã¢ã©ã¦ã³ãã®è¿½å ã¯ä¸è¨ã®ã³ãã³ããå®è¡ãã¾ãã
å®è¡ã³ãã³ã
$ oc patch -n openshift-cnv hco kubevirt-hyperconverged --type=json -p '[{"op": "add", "path": "/spec/defaultCPUModel", "value": "host-passthrough"}]'
å®è¡ã³ãã³ãã¨çµæ
$ oc patch -n openshift-cnv hco kubevirt-hyperconverged --type=json -p '[{"op": "add", "path": "/spec/defaultCPUModel", "value": "host-passthrough"}]' hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patched
è¨å®ãåæ ãããã確èªãã¾ãã
å®è¡ã³ãã³ã
$ oc get -n openshift-cnv hco kubevirt-hyperconverged -o json | jq .spec.defaultCPUModel
å®è¡ã³ãã³ãã¨çµæ
$ oc get -n openshift-cnv hco kubevirt-hyperconverged -o json | jq .spec.defaultCPUModel "host-passthrough"
ãã®ã°ãã¼ãã«è¨å®ã¯ãåä»®æ³ãã·ã³ã®èµ·åæã«èªã¿è¾¼ã¾ãã¦ä»®æ³ãã·ã³ã«è¨å®ãåæ ããã¾ããä»®æ³ãã·ã³ã®èµ·åæã«è¨å®å¤æ´ããå ´åã¯ãä»®æ³ãã·ã³ãåèµ·åãã¦åæ ãã¦ãã ããã
ä»®æ³ãã·ã³ã®è¨å®ç¶æ³ã確èªããã«ã¯ãVirtualMachineInstance
ã«ã¹ã¿ã ãªã½ã¼ã¹ã®è¨å®ã確èªãã¾ãã
ä»®æ³ãã·ã³åï¼rhel-9-salmon-parrotfish-27
ã®è¨å®ã確èªããã³ãã³ãã¯ä¸è¨ã«ãªãã¾ãã
å®è¡ã³ãã³ã
$ oc get vmi -n ocp-virt rhel-9-salmon-parrotfish-27 -o json | jq .spec.domain.cpu.model
ããã©ã«ãã®è¨å®å¤ã®å ´åï¼host-model
ãè¨å®ããã¦ããï¼
$ oc get vmi -n ocp-virt rhel-9-salmon-parrotfish-27 -o json | jq .spec.domain.cpu.model "host-model"
ã¯ã¼ã¯ã¢ã©ã¦ã³ãã®è¨å®å¾ï¼host-passthrough
ãè¨å®ããã¦ããï¼
$ oc get vmi -n ocp-virt rhel-9-salmon-parrotfish-27 -o json | jq .spec.domain.cpu.model "host-passthrough"
3. CLIãã¼ã«ï¼virtctlï¼ã®ã¤ã³ã¹ãã¼ã«
ä»®æ³ãã·ã³ã®ä½æã®åã«ãä½æ¥ã§å©ç¨ããCLIãã¼ã«ãvirtctlããã¤ã³ã¹ãã¼ã«ãã¾ãã virtctlã使ããã¨ã§OpenShift Virtualizationã®æä½ãCLIã§è¡ããã¨ãã§ãã¾ãã virtctlã®ã¤ã³ã¹ãã¼ã«æ¹æ³ã対å¿ãã¦ããã³ãã³ãã¯ä¸è¨ã®ããã¥ã¡ã³ããåç §ãã¦ãã ããã
3-1 virtctlã®ã¤ã³ã¹ãã¼ã«
Webã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼ãããVirtualization>Overviewããé¸æãã¾ãã Overviewç»é¢ã®å³ä¸ã«ãDownload the virtctl command-line utilityãã®ãªã³ã¯ãããã¾ãã
ãªã³ã¯ãé¸æããã¨åã³ãã³ãã©ã¤ã³ãã¼ã«ã®å ¥æå ä¸è¦§ã表示ããã¾ãã
virtctlã®ä¸è¦§ãããDownload virtctl for Linux for x86_64ãã®ãªã³ã¯ãã³ãã¼ãã¾ãã ãªã³ã¯å ã¯ä¸è¨ã®ãããªå½¢å¼ã«ãªãã¾ãã
https://hyperconverged-cluster-cli-download-openshift-cnv.apps.ocp.home.lab/amd64/linux/virtctl.tar.gz
ãã®ãªã³ã¯ã¯OpenShiftã¯ã©ã¹ã¿ã¼ä¸ã«ä½æããã¦ãã¾ãããªããvirtctl以å¤ã®ãã¼ã«ã¯ã¤ã³ã¿ã¼ãããä¸ã®ãªã³ã¯å ãããã¦ã³ãã¼ããããã¨ã«ãªãã¾ãã
è¸ã¿å°ãµã¼ãã¼ä¸ã§ã³ãã¼ãããªã³ã¯ããã¼ã¹ãããä¸è¨ã®ã³ãã³ããå®è¡ãã¾ãã
$ curl -L -o - https://hyperconverged-cluster-cli-download-openshift-cnv.apps.ocp.home.lab/amd64/linux/virtctl.tar.gz | sudo tar -C /usr/local/bin -xvzf - virtctl
virtctl
ã³ãã³ããå®è¡ã§ãããã¨ã確èªãã¾ãã
$ virtctl Available Commands: addvolume add a volume to a running VM adm Administrate KubeVirt configuration. completion Generate the autocompletion script for the specified shell ...
virtctl
ã³ãã³ãã®èªåè£å®ãæå¹åãã¾ãã
$ virtctl completion bash > virtctl_bash_completion $ sudo cp virtctl_bash_completion /etc/bash_completion.d/ $ exec bash $ virtctl (<--ã¹ãã¼ã¹ã«ç¶ãã¦TABãã¼ãæ¼ã) addvolume (add a volume to a running VM) pause (Pause a virtual machine) adm (Administrate KubeVirt configuration.) permitted-devices (List the permitted devices for vmis.) completion (Generate the autocompletion script for the specified shell) port-forward (Forward local ports to a virtualmachine or virtualmachineinstance.) ...
4. ä»®æ³ãã·ã³ã®ä½æï¼ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããä½æï¼
èµ·åããªã¥ã¼ã ã¨ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ããé¸æããRHEL 9ä»®æ³ãã·ã³ãä½æããæ¹æ³ãç´¹ä»ãã¾ãã
4-1 ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããä½æãã
Webã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼ãããVirtualization>Catalogããé¸æãã¾ãã ã«ã¿ãã°ç»é¢ã®ããã©ã«ãã§ã¯ãInstanceTypesãã®ã¿ããé¸æããã¾ãã
ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããä½æããæ¹æ³ã§ã¯ã3ã¤ã®ã¹ããããçµã¦ä»®æ³ãã·ã³ãä½æãã¾ãã
- èµ·åããªã¥ã¼ã ã®é¸æï¼Select volume to boot fromï¼
- ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã®é¸æï¼Select InstanceTypeï¼
- ä»®æ³ãã·ã³ã®è©³ç´°è¨å®ï¼VirtualMachine detailsï¼
ã¹ããã1ãèµ·åããªã¥ã¼ã ã®é¸æãã¯ãæ¬è¨äºã1-5 ã¤ã³ã¹ãã¼ã«å¾ã®ç¢ºèªãã§è§£èª¬æ¸ã¿ã§ãã®ã§ããã§ã¯çç¥ãã¾ãã ã¹ããã2ãã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã®é¸æãã§ã¯ãä½æããä»®æ³ãã·ã³ã«é©ç¨ãããªã½ã¼ã¹ã¨ç¹æ§ãäºåã«ç¨æãããå®ç¾©æ¸ã¿ã®ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããé¸æãã¾ãï¼è©³ç´°ã¯å¾è¿°ï¼ã ã¹ããã3ãä»®æ³ãã·ã³ã®è©³ç´°è¨å®ãã§ã¯ãä»®æ³ãã·ã³åãã¹ãã¬ã¼ã¸ã¯ã©ã¹ãSSHå ¬ééµã®äºåè¨å®ãªã©ãè¡ãã¾ãã
4-2 å®ç¾©æ¸ã¿ã®ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã¨ã¯
OpenShift Virualizationã§ã¯ããã©ã«ãã§5ã¤ã®ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã®ã·ãªã¼ãºï¼NãCXãUãGNãMï¼ãç¨æããã¦ãã¾ãã
æ¨æºçãªãªã½ã¼ã¹ã®ãã®ããç¹å®ã®ã¯ã¼ã¯ãã¼ãã«ç¹åãããã®ï¼ãã¨ãã°GPUãæè¼ãããã®ãªã©ï¼ãããããé¸æã§ãã¾ãã
åã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã¯ããã«nano
ãã8xlarge
ã®ãµã¤ãºã¾ã§ã®éå½¢ãç¨æããã¦ãã¾ãã
ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã®åã·ãªã¼ãºã®ä¸ã«ãã¦ã¹ãªã¼ãã¼ããã¨ãã®ã·ãªã¼ãºã®è©³ç´°ã表示ããã¾ãã
ã¾ããã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã®åã·ãªã¼ãºä¸ã§é¸æããã¨ãã®ã·ãªã¼ãºã対å¿ãã¦ãããµã¤ãºã®ä¸è¦§ã表示ããã¾ãã ä»®æ³ãã·ã³ãä½æããæã¯ããããä»»æã®ãµã¤ãºãé¸æãã¾ãã
ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã®åãµã¤ãºã®å
容ãã©ã®ããã«å®ç¾©ããã¦ãããã¯oc get vmcf
ã³ãã³ãã使ã£ã¦è¡¨ç¤ºã§ãã¾ãã
ãã¨ãã°ãu1.medium
ã®ãµã¤ãºã®ã¹ããã¯ã®å®ç¾©ã¯ä¸è¨ã®ã³ãã³ãã§è¡¨ç¤ºã§ãã¾ãã
$ oc get vmcf u1.medium -o json | jq '.spec' { "cpu": { "guest": 1 }, "memory": { "guest": "4Gi" } }
ãªããæ¬é£è¼ã®ç°å¢ã§ã¯Uã·ãªã¼ãºã¾ãã¯Mã·ãªã¼ãºã®ã¿å©ç¨å¯è½ã§ããä»ã®ã·ãªã¼ãºãé¸æããå ´åã¯å¿ è¦ãªãªã½ã¼ã¹ãæä¾ã§ããªãããä»®æ³ãã·ã³ã®ä½æã失æãã¾ããã注æãã ããã
åèã«ãåã·ãªã¼ãºã®æå°ãµã¤ãºã®ã¹ããã¯ã®å®ç¾©ãè¼ãã¦ããã¾ããã©ã®ãããªå 容ãå®ç¾©ããã¦ãããã確èªãã ããã
u1.microã®specã®åºåçµæãéã
$ oc get vmcf u1.micro -o json | jq '.spec' { "cpu": { "guest": 1 }, "memory": { "guest": "1Gi" } }
gn1.xlargeã®specã®åºåçµæãéã
$ oc get vmcf gn1.xlarge -o json | jq '.spec' { "cpu": { "guest": 4 }, "gpus": [ { "deviceName": "nvidia.com/A400", "name": "gpu1" } ], "memory": { "guest": "16Gi" } }
cx1.mediumã®specã®åºåçµæãéã
$ oc get vmcf cx1.medium -o json | jq '.spec' { "cpu": { "dedicatedCPUPlacement": true, "guest": 1, "isolateEmulatorThread": true, "numa": { "guestMappingPassthrough": {} } }, "ioThreadsPolicy": "auto", "memory": { "guest": "2Gi", "hugepages": { "pageSize": "2Mi" } } }
m1.largeã®specã®åºåçµæãéã
$ oc get vmcf m1.large -o json | jq '.spec' { "cpu": { "guest": 2 }, "memory": { "guest": "16Gi", "hugepages": { "pageSize": "2Mi" } } }
n1.mediumã®specã®åºåçµæãéã
$ oc get vmcf n1.medium -o json | jq '.spec' { "annotations": { "cpu-load-balancing.crio.io": "disable", "cpu-quota.crio.io": "disable", "irq-load-balancing.crio.io": "disable" }, "cpu": { "dedicatedCPUPlacement": true, "guest": 4, "isolateEmulatorThread": true }, "memory": { "guest": "4Gi", "hugepages": { "pageSize": "1Gi" } } }
å®ç¾©æ¸ã¿ã®ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã«é¢ãã詳細ã¯ä¸è¨ããã¥ã¡ã³ããåç §ãã ããã
4-3 ä»®æ³ãã·ã³ã®ä½æ
Webã³ã³ã½ã¼ã«ãããVirtualization>Catalogããé¸æãã¾ãã
ä»®æ³ãã·ã³ãå®è¡ããããã®ããã¸ã§ã¯ããæ°è¦ä½æãã¾ãããããã¸ã§ã¯ãã®ä½æããé¸æãã¾ãã
ããã¸ã§ã¯ãåã¯ä»»æã®ååã§æ§ãã¾ããããããã§ã¯ãocp-virtãã¨ãã¾ããããã¸ã§ã¯ãåã®å ¥åå¾ããä½æããæ¼ãã¾ãã
å ã»ã©ä½æããããã¸ã§ã¯ãåãé¸æããã¦ãããã¨ã確èªããèµ·åããªã¥ã¼ã ãé¸æãã¾ãããâ Select volume to boot fromããããrhel9ããé¸æãã¾ã
次ã«ãã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ããé¸æãã¾ãããâ¡ Select InstanceTypeãããU seriesã®ãsmall: 1 CPUs, 2 GiB Memoryããé¸æãã¾ãã
èµ·åããªã¥ã¼ã ã®åOSã«ã¯å¿
è¦ãªã½ã¼ã¹è¦æ±ãå®ç¾©ããã¦ãã¾ãããã¨ãã°ãRHEL 9ã®å ´åã¯CPU1
ãã¡ã¢ãªã¼1536Mi
ãå¿
è¦ãªã½ã¼ã¹è¦æ±ã¨ãã¦å®ç¾©ããã¦ãã¾ãã
$ oc get vmcp rhel.9 -o json | jq .spec.requirements { "cpu": { "guest": 1 }, "memory": { "guest": "1536Mi" } }
ãã®ãããå¿ è¦ãªã½ã¼ã¹è¦æ±ãä¸åããµã¤ãºãé¸ãã å ´åã¯ã¨ã©ã¼ã«ãªããä»®æ³ãã·ã³ã®ä½æãã§ãã¾ããã
æå¾ã«ä»®æ³ãã·ã³ã®è©³ç´°è¨å®ãè¡ãã¾ããã⢠VirtualMachine detailsãã®Nameã¯èªåã§ä½æããã¾ããå¤æ´ããå ´åã¯ä»»æã®ååãæå®ãã¾ããããã«ãããã§ã¯SSHå ¬ééµã®è¨å®ãè¡ããããNot contifuredãã®ãªã³ã¯ãé¸æãã¾ãã
Public SSH Keyã®è¨å®ç»é¢å ã®ãNoneããUse existingããAdd newããããAdd newããé¸æãã¾ãããã¼ã®å ¥åæ¬ã«SSHå ¬ééµããã¼ã¹ããã¾ãã ãSecret nameãã«ä»»æã®ååãæå®ãã¾ããããã§ã¯ãmy-sshkeyãã¨ãã¾ãã ãAutomatically apply this key to any new VirtualMachine you create in this project.ãã®ãã§ãã¯ãå ¥ããã¨ãä»å¾åãããã¸ã§ã¯ãã§ä½æãããä»®æ³ãã·ã³ã«èªåã§åãSSHãã¼ã使ç¨ãã¾ãã æå¾ã«ãSaveããæ¼ãã¾ãã ãã®SSHãã¼ã®è¨å®ã¯cloud-iniã®æ©è½ã使ç¨ãã¦ãããcloud-initã«å¯¾å¿ããOSã®å ´åã¯èªåçã«SSHãã¼ãç»é²ããã¾ãã
ãPublic SSH keyãã®æ¬ã«å ã»ã©ä½æãããmy-sshkeyããç»é²ããã¦ãã¾ããã¾ããRHEL 9ã®å ´åã¯ãDynamic SSH key injectionãã«å¯¾å¿ãã¦ãã¾ãã®ã§ãã§ãã¯ãæå¹ã«ãã¾ãï¼ç¡å¹ã®ã¾ã¾ã§ãåé¡ããã¾ããï¼ã
ãã¹ã¦ã®è¨å®ã®å®äºå¾ããCreate VirtualMachineããæ¼ãã¦ä»®æ³ãã·ã³ã®ä½æãè¡ãã¾ãããã®éã«ãStart this VirtualMachine after creationãã«ãã§ãã¯ãå ¥ã£ã¦ããã¨ãä»®æ³ãã·ã³ã®ä½æå®äºã¨åæã«èµ·åãè¡ããã¾ãã
ä½æããSSHãã¼ã¯ãä»®æ³ãã·ã³ã®ä½æå¾ãVirtualization>Overview>Settings>User>Manage SSH keysãã§ç®¡çãè¡ãã¾ãã
ä»®æ³ãã·ã³ã®ä½æå¾ã詳細ç»é¢ã«é·ç§»ãã¾ããStatusããProvisioningãã¨ãªããèµ·åããªã¥ã¼ã ããã¯ãã¼ã³ãè¡ããã¾ãã
èµ·åããªã¥ã¼ã ã®ã¯ãã¼ã³ãå®äºããã¨ãStatusããRunningãã«å¤ãããOSãèµ·åãã¾ãã
4-4 ä»®æ³ãã·ã³ã¸ã³ã³ã½ã¼ã«ã§ã¢ã¯ã»ã¹
ä»®æ³ãã·ã³ã®èµ·åå¾ãConsoleã¿ãããä»®æ³ãã·ã³ã®ã³ã³ã½ã¼ã«ç»é¢ã¸ã¢ã¯ã»ã¹ã§ãã¾ãã
ã¾ããOverviewç»é¢ãããOpen web consoleãã®ãªã³ã¯ãé¸æããã¨å¥ã¦ã£ã³ãã¦ã§ã³ã³ã½ã¼ã«ç»é¢ãéããã¨ãã§ãã¾ãã
ã³ã³ã½ã¼ã«ç»é¢ã«ã¯ãGuest login credentialsãã®ãªã³ã¯ããããé¸æããã¨ãã®ä»®æ³ãã·ã³ã«ãã°ã¤ã³å¯è½ãªã¦ã¼ã¶ã¼åã¨ãã¹ã¯ã¼ãã表示ããã¾ãã ã¦ã¼ã¶ã¼åããã¹ã¯ã¼ããã³ãã¼ãããPasteããªã³ã¯ãé¸æããã¨èªåã§ã³ã³ã½ã¼ã«ã®å é¨ã«ã³ãã¼ããå 容ããã¼ã¹ãããã¾ãã
ãã®åæã¦ã¼ã¶ã¼ã¯sudo
ã³ãã³ãã®å®è¡ãå¯è½ã§ãããã¨ãã°sudo -i
ã³ãã³ããå®è¡ãããã®å¾passwd
ã³ãã³ãã§ã«ã¼ãã¦ã¼ã¶ã¼ã®ãã¹ã¯ã¼ããå¤æ´ã§ãã¾ãã
4-5 ä»®æ³ãã·ã³ã¸virtctlã§ãªã¢ã¼ãã¢ã¯ã»ã¹
ä»®æ³ãã·ã³ã®è©³ç´°ç»é¢ã®å³å´ã«ãããActionsããããããã¦ã³ã¡ãã¥ã¼ãããCopy SSH commandããé¸æãã¾ãã
ä¸è¨ã®ãããªã³ãã³ããã³ãã¼ããã¾ãã
virtctl -n ocp-virt ssh cloud-user@rhel-9-salmon-parrotfish-27 --identity-file=<path_to_sshkey>
virtctl
ã³ãã³ãã§ä»®æ³ãã·ã³å
ã¸SSHã®ãªã¢ã¼ãã¢ã¯ã»ã¹ãã§ãã¾ãã
è¸ã¿å°ãµã¼ãã¼ã«ç§å¯éµãã³ãã¼ãã¦ããªãå ´åã¯é£è¼ç¬¬1åãåèã«ãSSHã¨ã¼ã¸ã§ã³ã転éãå©ç¨ãã¦ãã ããã
ï¼ä½æ¥ç¨ç«¯æ«ã§å®è¡ï¼ % ssh -A bastion
SSHã¨ã¼ã¸ã§ã³ã転éãå©ç¨ãã¦è¸ã¿å°ãµã¼ãã¼ã«ãã°ã¤ã³å¾ãOpenShiftã«ãã°ã¤ã³ãã¾ãã ãã°ã¤ã³æ¹æ³ã¯ãkubeconfigã使ã£ããã°ã¤ã³ãã¾ãã¯ãoc loginãã®ã©ã¡ãã§ãæ§ãã¾ããã ãã°ã¤ã³æ¹æ³ã®è©³ç´°ã¯é£è¼ç¬¬2åãåèã«ãã¦ãã ããã
$ export KUBECONFIG=${HOME}/work/auth/kubeconfig $ oc whoami system:admin
OpenShiftã«ãã°ã¤ã³å¾ãå
ã»ã©ã³ãã¼ããvirtctl
ã³ãã³ããããç§å¯éµã®æå®ã®é¨åãé¤ãã¦å®è¡ãã¾ãã
ååã®ãã£ã³ã¬ã¼ããªã³ãã®ç¢ºèªã®å¾ãä»®æ³ãã·ã³ã«ãªã¢ã¼ãã¢ã¯ã»ã¹ãã§ãã¾ãã
$ virtctl -n ocp-virt ssh cloud-user@rhel-9-salmon-parrotfish-27 The authenticity of host 'vmi/rhel-9-salmon-parrotfish-27.ocp-virt (<no hostip for proxy command>)' can't be established. ED25519 key fingerprint is SHA256:pIksu6TcU4ShB3tptNic3M25cU5Sx0gGJzmnHOj8DCc. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'vmi/rhel-9-salmon-parrotfish-27.ocp-virt' (ED25519) to the list of known hosts. Register this system with Red Hat Insights: insights-client --register Create an account or view all your systems at https://red.ht/insights-dashboard Last login: Thu Jul 25 15:23:10 2024 [cloud-user@rhel-9-salmon-parrotfish-27 ~]$
5. ä»®æ³ãã·ã³ã®ä½æï¼ãã³ãã¬ã¼ãããä½æï¼
ãã³ãã¬ã¼ãã«ã¿ãã°ããä»®æ³ãã·ã³ã®å ã¨ãªããã³ãã¬ã¼ããé¸æããWindows Server 2022ãã¤ã³ã¹ãã¼ã«ããæ¹æ³ãç´¹ä»ãã¾ãã
5-1 ãã³ãã¬ã¼ãããä½æãã
ãã³ãã¬ã¼ãããä½æããæ¹æ³ã§ã¯ãã¤ã³ã¹ãã¼ã«ã®æºåãé¤ã2ã¤ã®ã¹ããããçµã¦ä»®æ³ãã·ã³ãä½æãã¾ãã
- ãã³ãã¬ã¼ãã®é¸æ
- ãã³ãã¬ã¼ãã®è©³ç´°è¨å®
OpenShift Virtualizationã®ãã³ãã¬ã¼ãã¨ã¯ãèµ·åããªã¥ã¼ã ã¨äºåã«å®ç¾©æ¸ã¿ã®ãªã½ã¼ã¹ãçµã¿åãããéå½¢ã®ãã¨ã§ãã ãã使ãçµã¿åãããäºåã«å®ç¾©ãã¦ãããã¨ã§ãç¹°ãè¿ãè¡ãä»®æ³ãã·ã³ã®ä½æä½æ¥ã軽æ¸ã§ãã¾ãã ã¾ããOpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«æã«èªå追å ãããèµ·åããªã¥ã¼ã ã使ã£ããã³ãã¬ã¼ããè¤æ°ç¨æããã¦ããã®ã§ããããç©æ¥µçã«ä½¿ãã®ãè¯ãã§ãããã
5-2 ã¤ã³ã¹ãã¼ã«ã®æºå
Microsoftã®Evaluation CenterããWindows Server 2022ã®è©ä¾¡çããã¦ã³ãã¼ããã¾ãã æ¬è¨äºã§ã¯ãã¦ã³ãã¼ãæé ã®è©³ç´°ã¯å²æãã¾ãã
Windows Server 2022 è©ä¾¡çã®ISOãã¡ã¤ã«ããã¡ã¤ã«ãè¸ã¿å°ãµã¼ãã¼ã¸ã³ãã¼ãã¾ãã
ä½æ¥ç¨ç«¯æ«ã®ã«ã¬ã³ããã£ã¬ã¯ããªã«ISOãã¡ã¤ã«ï¼SERVER_EVAL_x64FRE_ja-jp.iso
ï¼ãåå¨ãããã¨ã¨ãã¾ãã
% scp SERVER_EVAL_x64FRE_ja-jp.iso bastion:work
ISOãã¡ã¤ã«ãvirtctl
ã³ãã³ãã§OpenShiftã¸ã¢ãããã¼ãï¼PVCã®ä½æï¼ãã¾ãã
virtctl
ã³ãã³ãã«ãããã¡ã¤ã«ã®ã¢ãããã¼ãæ¹æ³ã¯ä¸è¨ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã
7.2. ã«ã¹ã¿ã ã¤ã¡ã¼ã¸ããã®ä»®æ³ãã·ã³ã®ä½æ | Red Hat Product Documentation
ocp-virt
ããã¸ã§ã¯ããé¸æããvirtctl image-upload
ã³ãã³ãã§ISOãã¡ã¤ã«ãã¢ãããã¼ããã¾ãã
å®è¡ã³ãã³ã
$ oc project ocp-virt $ virtctl image-upload dv win2022-ja-iso \ --size=10G \ --image-path=SERVER_EVAL_x64FRE_ja-jp.iso
win2022-ja-iso
ï¼PVCã®ååãããã§ã¯win2022-ja-iso
ã¨ãã¾ãã--size=10G
ï¼æ°è¦ä½æã®å ´åã¯ãµã¤ãºã®æå®ãå¿ è¦ã§ããISOãã¡ã¤ã«ãååã«åã¾ããµã¤ãºãæå®ãã ããã--image-path=SERVER_EVAL_x64FRE_ja-jp.iso
ï¼ã¢ãããã¼ãå ã®ãã¡ã¤ã«ãæå®ãã¾ãã
å®è¡ã³ãã³ãã¨çµæ
$ oc project ocp-virt Now using project "ocp-virt" on server "https://api.ocp.home.lab:6443". $ virtctl image-upload dv win2022-ja-iso \ --size=10G \ --image-path=SERVER_EVAL_x64FRE_ja-jp.iso PVC ocp-virt/win2022-ja-iso not found DataVolume ocp-virt/win2022-ja-iso created Waiting for PVC win2022-ja-iso upload pod to be ready... Pod now ready Uploading data to https://cdi-uploadproxy-openshift-cnv.apps.ocp.home.lab 4.85 GiB / 4.85 GiB [=============================================================================================================================================================================================================================================] 100.00% 54s Uploading data completed successfully, waiting for processing to complete, you can hit ctrl-c without interrupting the progress Processing completed successfully Uploading SERVER_EVAL_x64FRE_ja-jp.iso completed successfully
Webã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼ãããã¹ãã¬ã¼ã¸>PersistentVolumeClaimsããé¸æãã¾ãã ISOãã¡ã¤ã«ã¢ãããã¼ãæã«ä½æããPVCã¨å¯¾å¿ããPVãä½æããã¦ãã¾ãã
5-3 ä»®æ³ãã·ã³ã®ä½æ
Webã³ã³ã½ã¼ã«ã®ã¡ãã¥ã¼ãããVirtualization>OverviewããéãããTemplate catalogãã¿ããé¸æãã¾ãã
ãã³ãã¬ã¼ãã«ã¿ãã°ã¯ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã¨ã¯ç°ãªããOSã¨ãªã½ã¼ã¹ï¼CPUãã¡ã¢ãªã¼ï¼ãã»ããã«ãªã£ãç¶æ ã®ãã³ãã¬ã¼ãã¨ãã¦é¸æãã§ããããã«ãªã£ã¦ãã¾ãã ãSource availableãã®è¡¨ç¤ºããããã®ã¯èµ·åããªã¥ã¼ã ãåå¨ãããã®ã¾ã¾ä»®æ³ãã·ã³ã®ä½æãå¯è½ã«ãªã£ã¦ãããã®ã§ãã ãSource availableãã®è¡¨ç¤ºããªããã®ã¯èµ·åããªã¥ã¼ã ãåå¨ãããèµ·åããªã¥ã¼ã ãå¥éç¨æãããISOãã¡ã¤ã«ããã¤ã³ã¹ãã¼ã«ãè¡ãå¿ è¦ãããã¾ãã Windows Serverã¯ã©ãããSource availableãã®è¡¨ç¤ºããªããISOãã¡ã¤ã«ããã¤ã³ã¹ãã¼ã«ãå¿ è¦ã§ãã
ã¾ããMicrosoft Windows Server 2022 VMããé¸æãã¾ãã
ä»®æ³ãã·ã³ã®è©³ç´°è¨å®ç»é¢ã表示ãããããä¸è¨ã®éãã«è¨å®ãè¡ãã¾ãã
Boot from CD
ï¼æå¹åCD source
ï¼PVCï¼clone PVCï¼PVC project
ï¼ocp-virtPVC name
ï¼win2022-ja-isoDisk source
ï¼Blank
Disk sizeãVirtualMachine nameã¯ä»»æã§å¤æ´ãã¦ãã ããã ãStart this VirtualMachine after creationãã®ãã§ãã¯ã¯ãã®ã¾ã¾ã§ãä»®æ³ãã·ã³ã®ä½æã¨åæã«èµ·åãè¡ãã¾ãã ãã¹ã¦ã®ãã©ã¡ã¼ã¿ã¼ãè¨å®ã§ãããããQuick create VirtualMachineããé¸æãã¾ãã
ä»®æ³ãã·ã³ã®ä½æå¾ã詳細ç»é¢ã«é·ç§»ãã¾ããStatusããProvisioningãã¨ãªããISOã®PVã®ã¯ãã¼ã³ãè¡ããã¾ãã
StatusããRunningãã«å¤ãããISOããèµ·åãéå§ãã¾ãããPress any key to boot from CD or DVDã»ã»ã»ã» ã ã®è¡¨ç¤ºãåºããã¿ã¤ãã³ã°ããã¨ã³ã¿ã¼ãæ¼ãã¾ãã
ãã¨ã¯é常éãWindows Serverã®ã¤ã³ã¹ãã¼ã«ãç¶è¡ãã¾ãï¼æ¬è¨äºã§ã¯è©³ç´°ã¯å²æï¼ãã¤ã³ã¹ãã¼ã«ã®éä¸ã§ãã©ã¤ãã®è¿½å ãªã©ãä¸è¦ã§ãã
OSã®ã¤ã³ã¹ãã¼ã«å®äºå¾ããSend Keyãã®ãã«ãã¦ã³ã¡ãã¥ã¼ãããCtrl + Alt +Deleteããé¸æãã¦ãã°ã¤ã³ãã¾ãã
OSã®ã¤ã³ã¹ãã¼ã«ä¸ã«é©ç¨ãããªãã£ãä¸æãªããã¤ã¹ãã©ã¤ãã¯ãWindows Updateã®æ©è½ã«ããããã¯ã°ã©ã¦ã³ãã§èªåé©ç¨ããã¾ããç°å¢ã«ãã£ã¦ã¯é©ç¨å®äºã¾ã§ã«å°ãæéããããã¾ãã®ã§ããã°ããå¾ ã£ã¦ãã確èªãã ããã
6. ä»®æ³ãã·ã³ã®èµ·åã¨åæ¢
6-1 ä»®æ³ãã·ã³ã®åæ¢
èµ·åä¸ã®ä»®æ³ãã·ã³ãåæ¢ããã«ã¯ãä»®æ³ãã·ã³ã®è©³ç´°ç»é¢å ã®ãActionsãã¡ãã¥ã¼ããStopãé¸æãã¾ãï¼ã¾ãã¯Stopã®ã¢ã¤ã³ã³ãæ¼ãã¾ãï¼ã
ãã®éãä»®æ³ãã·ã³å ã®OSã¯ã·ã£ãããã¦ã³æä½ãè¡ããã¾ãï¼ãã¼ããªãã§ã¯ãªãï¼ã
OSã®ã·ã£ãããã¦ã³å®äºå¾ãèªåçã«ä»®æ³ãã·ã³ãåæ¢ãã¾ããStatusã¯ãStoppedãã«å¤ããã¾ãã
6-2 ä»®æ³ãã·ã³ã®èµ·å
ä»®æ³ãã·ã³ãèµ·åããã«ã¯ãä»®æ³ãã·ã³ã®è©³ç´°ç»é¢å ã®ãActionsãã¡ãã¥ã¼ããStartãé¸æãã¾ãï¼ã¾ãã¯Startã®ã¢ã¤ã³ã³ãæ¼ãã¾ãï¼ã
ä»®æ³ãã·ã³ã®èµ·åå¾ãStatusã¯ãRunningãã«å¤ããã¾ãã
6-3 OSå ã§ã·ã£ãããã¦ã³ããæã®åä½ã®å¤æ´
OpenShift Virtualizationã®ããã©ã«ãè¨å®ã§ã¯ãä»®æ³ãã·ã³ã®OSå ã§ã·ã£ãããã¦ã³ãã¦ãèªåçã«ä»®æ³ãã·ã³ãåèµ·åãã¦ãã¾ãã¾ãã ãã®ä»¶ã«é¢ãã¦ã¯ããã¥ã¡ã³ãã«è¨è¼ãããã¾ãã
spec.running: true ã§è¨å®ãããä»®æ³ãã·ã³ã¯ããã«åèµ·åããã¾ããspec.runStrategy ãã¼ã使ç¨ããã¨ãç¹å®ã®æ¡ä»¶ä¸ã§ä»®æ³ãã·ã³ãã©ã®ããã«åä½ãããã決å®ããããã®æè»æ§ãé«ã¾ãã¾ãã
ããã©ã«ãã®è¨å®ã確èªããã«ã¯ä¸è¨ã®ã³ãã³ããå®è¡ãã¾ãã
$ oc get vm win2k22-moccasin-elk-82 -n ocp-virt -o json | jq '.spec | {running: .running, runStrategy: .runStrategy}' { "running": true, "runStrategy": null }
ãã®spec.running
ãã¼ã®è¨å®ãç¡å¹åããspec.runStrategy
ãã¼ã®è¨å®ãè¡ããã¨ã§ããã©ã«ãã®åä½ãå¤æ´ã§ãã¾ãããªããããã¥ã¡ã³ãã«ä¸è¨ã®æ³¨æç¹ãè¨è¼ããã¦ãã¾ãã
spec.runStrategy ãã¼ã¨ spec.running ãã¼ã¯ç¸äºã«æä»çã§ãããããã 1 ã¤ã ãã 使ç¨ã§ãã¾ãã両æ¹ã®ãã¼ãå«ãä»®æ³ãã·ã³è¨å®ã¯ç¡å¹ã§ãã
ããã¯spec.running
ãã¼ã¨spec.runStrategy
ãã¼ãç¸äºã«å½±é¿ãåããããå¥ã
ã«è¨å®ãå¤æ´ã§ããªããã¨ãæå³ãã¾ãããã®ããspec.running
ãã¼ã¨spec.runStrategy
ãã¼ãåæã«å¤æ´ããæ¹æ³ã§è¨å®ãè¡ãã¾ãã
ï¼1ï¼OSå ããã®ã·ã£ãããã¦ã³ã§ä»®æ³ãã·ã³ã®åæ¢ãæå¹åãã
OSå
ã§ã®ã·ã£ãããã¦ã³ã§ä»®æ³ãã·ã³ãåæ¢ããã«ã¯ä¸è¨ã®ã³ãã³ãã§è¨å®ãå¤æ´ãã¾ãã
ãªãããã®è¨å®ã¯ä»®æ³ãã·ã³ãã¨ã®è¨å®ã«ãªãã¾ããoc patch vm
ã«ç¶ãã¦è¨å®å¤æ´ãããä»®æ³ãã·ã³åãæå®ãã¾ããä»®æ³ãã·ã³ã®ä½ææã«è¨å®ãé©ç¨ãããå ´åã¯
ã¾ãããã®è¨å®ãåæ ããããã«ã¯ä»®æ³ãã·ã³ã®åèµ·åãå¿
è¦ã§ããä»®æ³ãã·ã³ãåæ¢ããå¾ã«ã³ãã³ããå®è¡ããããä»®æ³ãã·ã³ãå®è¡ä¸ã«è¡ã£ãå ´åã¯ä»®æ³ãã·ã³ã®åèµ·åãè¡ãªã£ã¦ãã ããã
å®è¡ã³ãã³ã
$ oc patch vm win2k22-moccasin-elk-82 -n ocp-virt --type json -p '[{"op": "remove", "path": "/spec/running"},{"op": "add", "path": "/spec/runStrategy", "value": "Manual"}]'
å®è¡ã³ãã³ãã¨çµæ
$ oc patch vm win2k22-moccasin-elk-82 -n ocp-virt --type json -p '[{"op": "remove", "path": "/spec/running"},{"op": "add", "path": "/spec/runStrategy", "value": "Manual"}]' virtualmachine.kubevirt.io/win2k22-moccasin-elk-82 patched
確èªã³ãã³ã
$ oc get vm win2k22-moccasin-elk-82 -n ocp-virt -o json | jq '.spec | {running: .running, runStrategy: .runStrategy}'
確èªã³ãã³ãã¨çµæ
$ oc get vm win2k22-moccasin-elk-82 -n ocp-virt -o json | jq '.spec | {running: .running, runStrategy: .runStrategy}' { "running": null, "runStrategy": "Manual" }
è¨å®å¤æ´å¾ã¯OSå ã®ã·ã£ãããã¦ã³ã§ä»®æ³ãã·ã³ã®åæ¢ãã§ããããã«ãªãã¾ãã
ï¼2ï¼å ã®è¨å®ã«æ»ãæ¹æ³
å ã®è¨å®ã«æ»ãå ´åã¯ä¸è¨ã®ã³ãã³ããå®è¡ãã¾ãã
å®è¡ã³ãã³ã
$ oc patch vm win2k22-moccasin-elk-82 -n ocp-virt --type json -p '[{"op": "remove", "path": "/spec/runStrategy"},{"op": "add", "path": "/spec/running", "value": true}]'
å®è¡ã³ãã³ãã¨çµæ
$ oc patch vm win2k22-moccasin-elk-82 -n ocp-virt --type json -p '[{"op": "remove", "path": "/spec/runStrategy"},{"op": "add", "path": "/spec/running", "value": true}]' virtualmachine.kubevirt.io/win2k22-moccasin-elk-82 patched
確èªã³ãã³ã
$ oc get vm win2k22-moccasin-elk-82 -n ocp-virt -o json | jq '.spec | {running: .running, runStrategy: .runStrategy}'
確èªã³ãã³ãã¨çµæ
$ oc get vm win2k22-moccasin-elk-82 -n ocp-virt -o json | jq '.spec | {running: .running, runStrategy: .runStrategy}' { "running": true, "runStrategy": null }
7. ä»®æ³ãã·ã³ã®ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³
7-1 ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã«ã¤ãã¦
ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã¯ãã¡ã³ããã³ã¹ãªã©ã®ç®çã§ä»®æ³ãã·ã³ãåæ¢ããã«ç¨¼åä¸ã®ãã¹ãããå¥ã®ãã¹ãã«ä»®æ³ãã·ã³ã移è¡ããæ©è½ã§ãã VMware vSphereã®vMotionã¨åçã®æ©è½ã§ãã vMotionã¯å®è¡æã«ç§»è¡å ã®ãã¹ããæ示çã«æå®ãã¾ãããOpenShift Virtualizationã®ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã§ã¯ãã¹ãã®æå®ã¯ããã¾ããã ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã®å®è¡ãæå®ããã®ã¿ã§ããªã½ã¼ã¹ã®ç©ºãã®ãã移è¡å¯è½ãªãã¹ãã«èªåã§ç§»è¡ãè¡ããã¾ãã ãã®è¾ºãã®æåã¯ãã¼ã¹æè¡ãã³ã³ãããªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ã®Kubernetesãªãã§ã¯ã§ãã
ãªããæ¬é£è¼ã«ãããæ§æã§ã¯OpenShift Virtualization v4.16.0ã§ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã§ããªãä¸å ·åããããããæ¬è¨äºã2-3 ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ç¨ã¯ã¼ã¯ã¢ã©ã¦ã³ãã®å®æ½ããè¡ã£ã¦ãã ããã 該å½ãã¼ã¸ã§ã³ä»¥å¤ããä¸å ·åãçºçããªãå ´åã¯ã¯ã¼ã¯ã¢ã©ã¦ã³ãã®å®æ½ã¯ä¸è¦ã§ãã
7-2 ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã®å®è¡
ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ãå®è¡ããã«ã¯ãå®è¡ä¸ã®ä»®æ³ãã·ã³ã®è©³ç´°ç»é¢å ã®ãActionsãã¡ãã¥ã¼ããMigrateãé¸æãã¾ãã æä½ã¯ããã ãã§ãã
ä»®æ³ãã·ã³ã®ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ä¸ã¯ãåä»®æ³ãã·ã³ã®StatusãRunning
ããMigrating
ã«å¤ããã¾ãããNodeãæ¬ã確èªããã¨ãç¾å¨ã¯node-01
ä¸ã§å®è¡ãã¦ãããã¨ã確èªã§ãã¾ãã
ãã°ããå¾
ã£ã¦ãã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ãå®äºããã¨Running
ã«æ»ãã¾ãããNodeãæ¬ã確èªããã¨ãå®äºå¾ã¯node-02
ä¸ã§å®è¡ãã¦ãããã¨ã確èªã§ãã¾ãã
ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã®é²æã¯ãä»®æ³ãã·ã³ã®è©³ç´°è¨å®ã®Metricsã¿ããæ¼ããç»é¢ãä¸çªä¸ã«ã¹ã¯ãã¼ã«ãã¦ãMigration>LiveMigration progressãã確èªãã¾ãã
ã¾ã¨ã
OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¨å®è¡æ¹æ³ã«ã¤ãã¦è§£èª¬ãã¾ããã OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¯ãOpenShiftã¯ã©ã¹ã¿ã¼ã¨ã¹ãã¬ã¼ã¸ã®ç°å¢ããæ´ã£ã¦ããã°Webã³ã³ã½ã¼ã«ã®Operator Hubããé¸ãã§ã¤ã³ã¹ãã¼ã«ããã ãã§ãã®ã§ã¨ã¦ãç°¡åã«è¡ãã¾ãã ä»®æ³ãã·ã³ã®ä½æãèµ·åãåæ¢ãããã«ã¯ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ãGUIã®æä½ã§è¡ããã¨ãã§ããvSphereã®æä½ã«æ £ããæ¹ã§ããã°ããã»ã©éåæãªã使ãå§ãããã¾ãã ä»®æ³ãã·ã³ä½æã®ã©ã¤ããµã¤ã¯ã«ã®ä¸å¿ã«ãªãã®ãPVCãPVã¨ãã£ãã¹ãã¬ã¼ã¸ãéè¦ãªã®ã¯ç¹å¾´ããããã¾ããã ãã®ä»£ããã«ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãããã³ãã¬ã¼ããé§ä½¿ãããã¨ã§ãã»ã«ããµã¼ãã¹ãåæã¨ããä»®æ³ãã·ã³éç¨ã«å¤åã§ããã®ã¯å¤§ããªã¡ãªããã§ãã
ï¼æ¬¡åäºåï¼ æ¬¡åã¯Migration Toolkit for Virtualizationã使ã£ã¦ãvSphere/ESXiä¸ã®ä»®æ³ãã·ã³ã移è¡ããæ¹æ³ã解説ãã¾ãã
*1:ãµã¼ããã¼ãã£ã¼ã³ã³ãã¼ãã³ãã使ç¨ãã¦ããã客æ§ã«å¯¾ã㦠Red Hat ã¯ã©ã®ãããªãµãã¼ããæä¾ãã¦ãã¾ãã? - Red Hat Customer Portal
*2:å®éã«ã¯èªåçã«HyperConverged Operatorãã¤ã³ã¹ãã¼ã«ããã¾ã
*3:CNVã¯OpenShift Virtualizationã®ä»¥åã®ååãContainer Native Virtualizationã«ç±æ¥
*4:åä¸ãã¹ãä¸ã§ãªãã¦ããåããã¼ãã¦ã§ã¢æ§æã®ãã¼ãéã§ããã°åæ§ã«åé¡ãªãã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã§ããå¯è½æ§ãããã¾ã