Show Table of Contents
2.10. リソースへのサブリソース追加
以下の例では、リソースにサブリソースを追加する方法を説明します。この例では、サイズが「1073741824L」で、「virtio」インターフェースを使用する「cow」形式の新規ディスクを「test」という名前の仮想マシンに追加します。
手順2.6 リソースへのサブソースの追加
- サブリソースを追加するリソースのインスタンスを宣言します。
VM vm = api.getVMs().get("test"); - そのリソースの属性を定義するパラメーターを作成します。
Disk diskParam = new Disk(); diskParam.setProvisionedSize(1073741824L); diskParam.setInterface("virtio"); diskParam.setFormat("cow"); - サブリソースを追加します。
Disk disk = vm.getDisks().add(diskParam);

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.