【发布时间】:2016-11-17 09:40:19
【问题描述】:
我正在尝试将 VHD 文件上传到 Azure 存储(经典)。在cmd中,我正在执行这个命令:
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
更新:
即使出现错误,该文件似乎也出现在 Azure 门户中,但我吓坏了,因为它显示大小为 19.53GiB
【问题讨论】:
-
您是否从 D:\VHDimage 之类的普通文件夹中尝试过。也许powershell没有system32文件夹的权限。
-
@Aravind 我将文件移动到
D:\boot2dockerhyperv,但我得到了同样的 PowerShell 错误。但是,当我检查门户时,我可以看到该文件。但为什么它是 19.53GB?请看更新:) -
如果您按照正确的步骤操作,我不确定 powershell 错误。就 VHD 文件大小而言,它必须与您的机器的大小(您使用 sysprep 创建的那个)相同。 docs.microsoft.com/en-in/azure/virtual-machines/…
-
任何更新,你解决了这个问题吗?
标签: azure cloud azure-storage azure-blob-storage azure-cli