ovftool匯出虛擬機器報錯處理過程!

tonykorn97發表於2019-05-12

ovftool命令參考

ovftool --X:logFile=upload1.log --X:logLevel=verbose --noSSLVerify vi://[user]:[pass]@[ESXi IP]:[port]/my_datacenter/vm/my_vm_folder/my_vm_name /tmp/test.OVF


實際操作步驟:

C:\Program Files\VMware\VMware OVF Tool>ovftool --X:logFile=d:\upload1.log --X:logLevel=verbose --noSSLVerify vi://root:@10.20.30.40/dandianscm d:\

Error: cURL error: SSL connect error

Completed with errors

C:\Program Files\VMware\VMware OVF Tool>


檢視日誌檔案:

2019-05-12T14:38:51.681+08:00 verbose -[11392] [Originator@6876 sub=Default] [SSL_DB] Using C:\Users\haoxutao\AppData\Roaming\VMware\ovftool_SSLDB as SSL DB

2019-05-12T14:38:51.693+08:00 verbose -[11392] [Originator@6876 sub=Default] Subscribing to signal: 2 (SIGINT)

2019-05-12T14:38:51.693+08:00 verbose -[11392] [Originator@6876 sub=Default] Subscribing to signal: 4 (SIGILL)

2019-05-12T14:38:51.693+08:00 verbose -[11392] [Originator@6876 sub=Default] Subscribing to signal: 22 (SIGABRT)

2019-05-12T14:38:51.693+08:00 verbose -[11392] [Originator@6876 sub=Default] Subscribing to signal: 8 (SIGFPE)

2019-05-12T14:38:51.693+08:00 verbose -[11392] [Originator@6876 sub=Default] Subscribing to signal: 15 (SIGTERM)

2019-05-12T14:38:51.693+08:00 verbose -[11392] [Originator@6876 sub=Default] Initializing progress

2019-05-12T14:38:51.693+08:00 verbose -[11392] [Originator@6876 sub=Default] OvfTool Version: VMware ovftool 4.1.0 (build-2459827)

2019-05-12T14:38:51.693+08:00 verbose -[11392] [Originator@6876 sub=Default] Using home directory: C:\Users\haoxutao\AppData\Roaming\VMware\ovftool.cfg

2019-05-12T14:38:51.699+08:00 verbose -[11392] [Originator@6876 sub=Default] Curl Version: 7.30.0

2019-05-12T14:38:51.699+08:00 verbose -[11392] [Originator@6876 sub=Default] Done initializing libs

2019-05-12T14:38:51.699+08:00 verbose -[11392] [Originator@6876 sub=Default] Determining source

2019-05-12T14:38:51.699+08:00 verbose -[11392] [Originator@6876 sub=Default] Determining target

2019-05-12T14:38:51.699+08:00 verbose -[11392] [Originator@6876 sub=Default] Getting source

2019-05-12T14:38:51.699+08:00 verbose -[11392] [Originator@6876 sub=Default] Getting vi source

2019-05-12T14:38:51.700+08:00 verbose -[11392] [Originator@6876 sub=Default] Connecting to vi host

2019-05-12T14:38:51.700+08:00 verbose -[11392] [Originator@6876 sub=Default] Skip SSL verification

2019-05-12T14:38:51.700+08:00 verbose -[11392] [Originator@6876 sub=HttpConnectionPool-000000] HttpConnectionPoolImpl created. maxPoolConnections = 20; idleTimeout = 900000000; maxOpenConnections = 20; maxConnectionAge = 0

2019-05-12T14:38:51.700+08:00 verbose -[11392] [Originator@6876 sub=Default] Getting version of the VI host : 10.20.30.40

2019-05-12T14:38:51.700+08:00 verbose -[11392] [Originator@6876 sub=Default] Initializing new curl session

2019-05-12T14:38:51.704+08:00 verbose -[11392] [Originator@6876 sub=Default] WebRequest set basic http authorization, username : root

2019-05-12T14:38:51.704+08:00 verbose -[11392] [Originator@6876 sub=Default] Getting http page:

2019-05-12T14:38:51.718+08:00 verbose -[07436] [Originator@6876 sub=Default] Curl_perform error code 35 (SSL connect error)

2019-05-12T14:38:51.718+08:00 verbose -[11392] [Originator@6876 sub=Default] CURL error buffer: Unknown SSL protocol error in connection to 10.20.30.40:443

2019-05-12T14:38:51.718+08:00 verbose -[11392] [Originator@6876 sub=Default] Curl session torn down

2019-05-12T14:38:51.721+08:00 verbose -[11392] [Originator@6876 sub=Default] Backtrace:

-->

--> [backtrace begin] product: VMware Workstation, version: e.x.p, build: build-2444548, tag: -

--> backtrace[00] vmacore.dll[0x001BBC9A]

--> backtrace[01] vmacore.dll[0x0005D18F]

--> backtrace[02] vmacore.dll[0x0005E3CE]

--> backtrace[03] vmacore.dll[0x00012C5B]

--> backtrace[04] ovftool.exe[0x0009025F]

--> backtrace[05] ovftool.exe[0x000AE63F]

--> backtrace[06] ovftool.exe[0x000AEA1A]

--> backtrace[07] ovftool.exe[0x000E4DFA]

--> backtrace[08] ovftool.exe[0x000E5626]

--> backtrace[09] ovftool.exe[0x000E60A4]

--> backtrace[10] ovftool.exe[0x0002B89F]

--> backtrace[11] ovftool.exe[0x00074D17]

--> backtrace[12] ovftool.exe[0x000755C4]

--> backtrace[13] ovftool.exe[0x00307F46]

--> backtrace[14] KERNEL32.DLL[0x00017974]

--> backtrace[15] ntdll.dll[0x0006A271]

--> [backtrace end]

-->




錯誤原因經查詢為版本問題

C:\Program Files\VMware\VMware OVF Tool>ovftool.exe -v

VMware ovftool 4.1.0 (build-2459827)

C:\Program Files\VMware\VMware OVF Tool>



升級為4.3,一臺機器已OK

C:\Program Files\VMware\VMware OVF Tool>ovftool.exe -v

VMware ovftool 4.3.0 (build-7948156)

C:\Program Files\VMware\VMware OVF Tool>


另外一臺機器,繼續匯出報錯,報錯內容為:

C:\Program Files\VMware\VMware OVF Tool>ovftool --X:logFile=d:\vmware\upload1.log --X:logLevel=verbose --noSSLVerify vi://root:@10.20.30.40/backup d:\vmware

Enter login information for source vi://10.20.30.40/

Username: root

Password: **********

Error: Could not lookup host: root

Completed with errors

C:\Program Files\VMware\VMware OVF Tool



檢視日誌檔案

2019-05-12T15:07:04.682+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] [SSL_DB] Using C:\Users\Administrator\AppData\Roaming\VMware\ovftool_SSLDB as SSL DB

2019-05-12T15:07:04.783+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Subscribing to signal: 2 (SIGINT)

2019-05-12T15:07:04.783+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Subscribing to signal: 4 (SIGILL)

2019-05-12T15:07:04.783+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Subscribing to signal: 22 (SIGABRT)

2019-05-12T15:07:04.783+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Subscribing to signal: 8 (SIGFPE)

2019-05-12T15:07:04.783+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Subscribing to signal: 15 (SIGTERM)

2019-05-12T15:07:04.783+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Initializing progress

2019-05-12T15:07:04.783+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] OvfTool Version: VMware ovftool 4.3.0 (build-7948156)

2019-05-12T15:07:04.784+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Using home directory: C:\Users\Administrator\AppData\Roaming\VMware\ovftool.cfg

2019-05-12T15:07:04.791+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Curl Version: 7.58.0

2019-05-12T15:07:04.791+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Done initializing libs

2019-05-12T15:07:04.791+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Determining source

2019-05-12T15:07:04.791+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Determining target

2019-05-12T15:07:04.792+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Getting source

2019-05-12T15:07:04.792+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Getting vi source

2019-05-12T15:07:04.792+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Constructing URL...

2019-05-12T15:07:04.792+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Resolving host name root...

2019-05-12T15:07:16.369+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Failed to lookup host: root, error code: 11001

2019-05-12T15:07:16.377+08:00 verbose OVFTool[10456] [Originator@6876 sub=Default] Backtrace:

--> [backtrace begin] product: VMware Workstation, version: e.x.p, build: build-7948156, tag: OVFTool, cpu: x86_64, os: windows, buildType: release

--> backtrace[00] vmacore.dll[0x001F59FA]

--> backtrace[01] vmacore.dll[0x00064E70]

--> backtrace[02] vmacore.dll[0x0006763E]

--> backtrace[03] vmacore.dll[0x000254AC]

--> backtrace[04] ovftool.exe[0x00013FB6]

--> backtrace[05] ovftool.exe[0x000A886F]

--> backtrace[06] ovftool.exe[0x000FBA1A]

--> backtrace[07] ovftool.exe[0x0012C82D]

--> backtrace[08] ovftool.exe[0x00128F6F]

--> backtrace[09] ovftool.exe[0x0003F1B0]

--> backtrace[10] ovftool.exe[0x000DA8DD]

--> backtrace[11] ovftool.exe[0x000DB624]

--> backtrace[12] ovftool.exe[0x00382845]

--> backtrace[13] kernel32.dll[0x000159CD]

--> backtrace[14] ntdll.dll[0x0002A561]

--> [backtrace end]



可能原因處理,更改主機名稱,登入esxi控制檯

[root@localhost:~] esxcfg-advcfg -s ESX02 /Misc/hostname

Value of HostName is ESX02

[root@ESX02:~]

改名參考文件:



繼續測試還是不行:

然後參考這個文件:

執行下面報錯:

ovftool --X:logFile=d:\vmware\upload1.log --X:logLevel=verbose --noSSLVerify vi://root:cFnD_MNi#ba@10.20.30.40


執行這個不報錯:

ovftool --X:logFile=d:\vmware\upload1.log --X:logLevel=verbose --noSSLVerify vi://root:abc123@10.20.30.40

顯然ovftool無法處理密碼中的特殊字元。有沒有辦法繞過這個而不改變root密碼?


處理辦法:對密碼進行URL編碼,就像這樣

ovftool --X:logFile=d:\vmware\upload1.log --X:logLevel=verbose --noSSLVerify vi://root:cFnD_MNi%23ba@10.20.30.40 /dandianscm d:\vmware

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-2644071/,如需轉載,請註明出處,否則將追究法律責任。

相關文章