Red Hat Training
A Red Hat training course is available for Red Hat Virtualization
B.55. 디스크 연결로 교체 된 디스크
API 가상 머신 및 템플릿의 버전 3에는 디스크
와 연결된 디스크의 모든 정보가 포함된 디스크 컬렉션이 있었습니다. API 버전 4에서 이러한 디스크 컬렉션이 제거되어 디스크에 대한 참조와 디스크와 연결된 가상 머신 또는 템플릿 간의 관계만 포함하는 새 디스크 연결
컬렉션으로 교체 되었습니다
.
가상 머신에 연결된 디스크를 찾으려면 다음과 같은 요청을 보냅니다.
GET /ovirt-engine/api/vms/123/diskattachments
다음과 같은 응답이 반환됩니다.
<disk_attachments> <disk_attachment href="/vms/123/diskattachments/456" id="456"> <bootable>false</bootable> <interface>virtio</interface> <disk href="/disks/456" id="456"/> <vm href="/vms/123" id="123"/> </disk_attachment> ... <disk_attachments>
디스크의 나머지 세부 정보를 찾으려면 제공된 링크를 따르십시오.
가상 머신 또는 템플릿에 디스크를 추가하면 새로운 disk_attachment
요소도 사용됩니다. request는 다음과 같습니다.
POST /ovirt-engine/api/vms/123/diskattachments
디스크가 존재하지 않고 생성하려는 경우 다음 본문을 사용합니다.
<disk_attachment> <bootable>false</bootable> <interface>virtio</interface> <disk> <description>My disk</description> <format>cow</format> <name>mydisk</name> <provisioned_size>1048576</provisioned_size> <storage_domains> <storage_domain> <name>mydata</name> </storage_domain> </storage_domains> </disk> </disk_attachment>
또는 디스크가 이미 존재하는 경우 다음 본문을 사용하여 가상 머신에 연결합니다.
<disk_attachment> <bootable>false</bootable> <interface>virtio</interface> <disk id="456"/> </disk_attachment>
vm.disks
및 template.disks
attribtes에 모든 사용법에 대해 disk_attachments
가 있음을 고려하십시오. 예를 들어 템플릿을 생성할 때 vm.disks
요소는 템플릿 디스크를 생성할 스토리지 도메인을 나타내는 데 사용되었습니다. 이 사용량도 vm.disk_attachments
로 교체되었으므로 특정 스토리지 도메인의 디스크로 템플릿을 자격하라는 요청도 다음과 같이 표시됩니다.
<template> <name>mytemplate</name> <vm id="123"> <disk_attachments> <disk_attachment> <disk id="456"> <storage_domains> <storage_domain id="789"/> </storage_domains> </disk> </disk_attachment> ... </disk_attachments> </vm> </template>