我試圖上傳一個VHD文件到Azure存儲(經典)。在CMD,我在執行這個命令:Azure錯誤:沒有這樣的文件或目錄,stat'C: WINDOWS system32 ''
C:\WINDOWS\system32>azure vm image create boot2dockerhyperv ` --blob-url https://URL.blob.core.windows.net/vhds/boot2dockerhyperv.vhd ` --os Linux "C:\Users\USERNAME\Desktop\boot2dockerhyperv.vhd"`
而且我發現了以下錯誤:
info: Executing command vm image create
error: ENOENT: no such file or directory, stat 'C:\WINDOWS\system32\`'
error: Error information has been recorded to C:\Users\USERNAME\.azure\azure.err
這是azure.err
2016-11-17T09:25:34.903Z:
{ [Error: ENOENT: no such file or directory, stat 'C:\WINDOWS\system32\`']
errno: -4058,
code: 'ENOENT',
syscall: 'stat',
path: 'C:\\WINDOWS\\system32\\`' }
Error: ENOENT: no such file or directory, stat 'C:\WINDOWS\system32\`'
at Error (native)
at Object.fs.statSync (fs.js:844:18)
at uploadPageBlobFromBlobService (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\asm\iaas\upload\pageBlob.js:278:17)
at Object.uploadPageBlob (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\asm\iaas\upload\pageBlob.js:221:3)
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\asm\iaas\upload\uploadVMImage.js:83:16
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\asm\iaas\upload\uploadVMImage.js:65:5
at callbacks.(anonymous function) (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\util\callbackAggregator.js:81:30)
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\azure-asm-storage\lib\storageManagementClient.js:1419:14
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\util\logging.js:339:7
at handleRedirect (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\util\utils.js:564:9)
的內容時,在PowerShell中執行,我得到不同的錯誤
info: Executing command vm image create
info: VHD size : 20 GB
info: Uploading 59392.5 KB
error: body.outputStream.on is not a function
error: Error information has been recorded to C:\Users\USERNAME\.azure\azure.err
UPDATE:
文件似乎出現在Azure的門戶網站即使有錯誤,但我嚇壞了,因爲它顯示出大小19.53GiB
你是否像D:\ VHDimage之類的普通文件夾試過。也許powershell沒有權限到system32文件夾。 – Aravind
@Aravind我把文件移動到了'D:\ boot2dockerhyperv',但是我得到了相同的PowerShell錯誤。但是,當我查看門戶時,我可以看到該文件。但爲什麼它會出現19.53GB?請參閱更新:) – jmc
如果你遵循正確的步驟,我不確定PowerShell錯誤。就VHD文件大小而言,它必須與您使用機器的大小(使用sysprep創建的大小)相同。 https://docs.microsoft.com/en-in/azure/virtual-machines/virtual-machines-windows-upload-image?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json – Aravind