Show Table of Contents
A.7. カスタムプロパティーの定義
Red Hat Enterprise Virtualization Manager によって受け入れられ、カスタムフックに渡されるカスタムプロパティーは、
engine-config コマンドを使用して定義します。Red Hat Enterprise Virtualization Manager がインストールされているホストで、root ユーザーとしてこのコマンドを実行してください。
UserDefinedVMProperties および CustomDeviceProperties の設定キーは、サポートされているカスタムプロパティーの名前を保管するのに使用します。これら設定キーには、名付けられた各カスタムプロパティーの有効な値を定義する正規表現も含まれます。
複数のカスタムプロパティーは、セミコロンで区切ります。設定キーの設定時には、そのキーに含まれている既存の値が上書きされる点に注意してください。新規および既存のカスタムプロパティーを組み合わせる場合には、キーの値を設定するのに使用するコマンドにすべてのカスタムプロパティーを入れる必要があります。
設定キーを更新した後には、
ovirt-engine サービスを再起動して変更を有効にする必要があります。
例A.1 仮想マシンプロパティー: smartcard カスタムプロパティーの定義
- 以下のコマンドを使用して、
UserDefinedVMProperties設定キーによって定義されている既存のカスタムプロパティーを確認します。# engine-config -g UserDefinedVMProperties
以下の出力に示されているように、カスタムプロパティーmemoryは既に定義済みです。正規表現^[0-9]+$により、カスタムプロパティーに数字のみが含まれるようになっています。# engine-config -g UserDefinedVMProperties UserDefinedVMProperties: version: 3.0 UserDefinedVMProperties: version: 3.1 UserDefinedVMProperties: version: 3.2 UserDefinedVMProperties: version: 3.3 UserDefinedVMProperties : memory=^[0-9]+$ version: 3.2
memoryカスタムプロパティーは、UserDefinedVMProperties設定キーですでに定義済みなので、そこに新規カスタムプロパティーを追加する必要があります。追加のカスタムプロパティーsmartcardは、設定キーの値に追加します。新規カスタムプロパティーには、trueまたはfalseの値を適用することができます。# engine-config -s UserDefinedVMProperties='memory=^[0-9]+$;smartcard=^(true|false)$' --cver=3.2
UserDefinedVMProperties設定キーで定義されているカスタムプロパティーが正しく更新されたかどうかを確認します。# engine-config -g UserDefinedVMProperties UserDefinedVMProperties: version: 3.0 UserDefinedVMProperties: version: 3.1 UserDefinedVMProperties: version: 3.2 UserDefinedVMProperties: version: 3.3 UserDefinedVMProperties : memory=^[0-9]+$;smartcard=^(true|false)$ version: 3.2
- 最後に、
ovirt-engineサービスを再起動して、変更を有効にします。# service ovirt-engine restart
例A.2 デバイスプロパティー: interface カスタムプロパティーの定義
- 以下のコマンドを使用して、
CustomDeviceProperties設定キーによって定義されている既存のカスタムプロパティーを確認します。# engine-config -g CustomDeviceProperties
以下の出力に示されているように、カスタムプロパティーはまだ定義されていません。# engine-config -g CustomDeviceProperties CustomDeviceProperties: version: 3.0 CustomDeviceProperties: version: 3.1 CustomDeviceProperties: version: 3.2 CustomDeviceProperties: version: 3.3
interfaceカスタムプロパティーは、まだ存在していないので、そのまま追加することができます。以下の例では、speedサブプロパティーの値は 0 から 99999 までの範囲に設定し、duplexサブプロパティーの値にはfullまたはhalfのいずれかを選択して設定します。# engine-config -s CustomDeviceProperties="{type=interface;prop={speed=^([0-9]{1,5})$;duplex=^(full|half)$}}" --cver=3.3CustomDeviceProperties設定キーで定義されているカスタムプロパティーが正しく更新されたかどうかを確認します。# engine-config -g CustomDeviceProperties UserDefinedVMProperties: version: 3.0 UserDefinedVMProperties: version: 3.1 UserDefinedVMProperties: version: 3.2 UserDefinedVMProperties : {type=interface;prop={speed=^([0-9]{1,5})$;duplex=^(full|half)$}} version: 3.3- 最後に、
ovirt-engineサービスを再起動して、変更を有効にします。# service ovirt-engine restart

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.