11.4. 가상 머신 배포


OpenShift Virtualization 및 CDI(Containerized Data Importer)를 설치 및 활성화한 후 네임스페이스를 생성하고 VM(가상 머신)을 배포합니다.

프로세스

  • VM 정의와 Fedora 운영 체제가 포함된 데이터 볼륨을 모두 생성하는 YAML을 배포합니다.

    다음 예제에서는 네임스페이스 mig-vm 이 사용되고 다음 YAML은 Fedora VM을 생성하고, Fedora 운영 체제가 포함된 datavolume을 생성하는 데 사용됩니다.

    apiVersion: kubevirt.io/v1
    kind: VirtualMachine
    metadata:
      name: rhel9-lime-damselfly-72
      namespace: mig-vm 
    1
    
      labels:
        app: rhel9-lime-damselfly-72
        kubevirt.io/dynamic-credentials-support: 'true'
        vm.kubevirt.io/template: rhel9-server-small
        vm.kubevirt.io/template.namespace: openshift
        vm.kubevirt.io/template.revision: '1'
        vm.kubevirt.io/template.version: v0.31.1
    spec:
      dataVolumeTemplates:
        - apiVersion: cdi.kubevirt.io/v1beta1
          kind: DataVolume
          metadata:
            name: rhel9-lime-damselfly-72
          spec:
            sourceRef:
              kind: DataSource
              name: rhel9
              namespace: openshift-virtualization-os-images
            storage:
              resources:
                requests:
                  storage: 30Gi
      running: true 
    2
    
      template:
        metadata:
          annotations:
            vm.kubevirt.io/flavor: small
            vm.kubevirt.io/os: rhel9
            vm.kubevirt.io/workload: server
          creationTimestamp: null
          labels:
            kubevirt.io/domain: rhel9-lime-damselfly-72 
    3
    
            kubevirt.io/size: small
            network.kubevirt.io/headlessService: headless
        spec:
          architecture: amd64
          domain:
            cpu:
              cores: 1
              sockets: 1
              threads: 1
            devices:
              disks:
                - disk:
                    bus: virtio
                  name: rootdisk
                - disk:
                    bus: virtio
                  name: cloudinitdisk
              interfaces:
                - masquerade: {}
                  model: virtio
                  name: default
              rng: {}
            features:
              acpi: {}
              smm:
                enabled: true
            firmware:
              bootloader:
                efi: {}
            machine:
              type: pc-q35-rhel9.4.0
            memory:
              guest: 2Gi
            resources: {}
          networks:
            - name: default
              pod: {}
          terminationGracePeriodSeconds: 180
          volumes:
            - dataVolume:
                name: rhel9-lime-damselfly-72
              name: rootdisk
            - cloudInitNoCloud:
                userData: |-
                  #cloud-config
                  user: cloud-user
                  password: password
                  chpasswd: { expire: False }
              name: cloudinitdisk
    Copy to Clipboard Toggle word wrap
1
이 예에서는 mig-vm 네임스페이스가 사용됩니다.
2
running: true 를 사용하여 생성 후 VM을 시작해야 함을 나타냅니다.
3
데이터 볼륨은 데이터 볼륨과 동일한 이름의 rhel9-lime-damselfly-72 라는 PVC(영구 볼륨 클레임)를 생성합니다.

PV(영구 볼륨)는 운영 체제로 채워지고 VM이 시작됩니다.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat