2017-10-29 6 views
0

タイトルが言うように、私はopennebulaでPython APIを使ってVMを作成しようとしています。 (これは1で作業初めてです、私はanythingsのゼロの手掛かりを持っているので、plzは私と一緒にあまりにもハードではないこと)python apiでopennebulaでvmを作成

#!/usr/bin/python3 

import oca 
client = oca.Client('username:passwd', 'ip:2633/RPC2') 
oca.VirtualMachine.allocate(client, 'test') 
#'test' is the name of the template i want to use 

それは私にこのエラー与える:

oca.exceptions.OpenNebulaException: [VirtualMachineAllocate] Error allocating a new virtual machine. Parse error: syntax error, unexpected $end, expecting EQUAL or EQUAL_EMPTY at line 1, columns 1:5 

誰かのアイデアをこれを修正するには?ありがとうございます。

+0

あなたの編集を回答として質問に答えてください – 0TTT0

答えて

0

ok ..私は愚かで、適切な場所に4時間おいてから検索しています - > gitリポジトリと 'issues'タブ。

vm_templ = oca.VmTemplatePool(client) 
vm_templ.info() 

for templ in vm_templ: 
    if templ.name == "Ubuntu 14.04 - KVM": 
     templ.instantiate("oca-test") 

これは、Python経由で既存のテンプレートのVMを作成する方法です。 (接続部分はありませんが、それは簡単です)。

私はこの質問を削除しませんが、おそらく誰かがこれで苦労するでしょう。

関連する問題