上传默认的Image:API版本差异 [英] Uploading the default Image : API version diffrence
问题描述
尝试使用PS从MAS-CON VM上传默认图像到市场:> New-Server2016VMImage -ISOPath $ ISOPath -TenantId $ AADTenantID。使用的iso映像是窗口服务器2016映像。
Trying to upload the default image to market place from MAS-CON VM using PS:>New-Server2016VMImage -ISOPath $ISOPath -TenantId $AADTenantID. The iso image used is window server 2016 image.
执行如下:
VERBOSE:检查有效ISO的ISO路径。
VERBOSE:检查Azure Stack环境的授权
VERBOSE:授权验证
VERBOSE:创建服务器完整映像
VERBOSE:在以下位置创建VHD:C:\Azuretools; \\ AzureStack-Tools-master \ComputeAdmin \Server2016DatacenterFullEval.vhd,大小:
40960 MB
VERBOSE:准备VHD
VERBOSE:VHD安装在驱动器号上:E
VERBOSE:安装ISO
VERBOSE:ISO安装在驱动器号:F
VERBOSE:将图像Windows Server 2016 SERVERDATACENTER应用于VHD
VERBOSE:使VHD可启动
New-AzureRmResourceGroup:Operation返回无效的状态代码' BadRequest'
在C:\ Azuretools \AzureStack-Tools-master \ComputeAdmin \AzureStack.ComputeAdmin.psm1:127 char:9
+ New-AzureRmResourceGroup -Name $ resourceGroupName -Location $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
+ CategoryInfo :CloseError:(:) [New-AzureRmResourceGroup],CloudException
+ FullyQualifiedErrorId:Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupCmd
让
VERBOSE: Checking ISO path for a valid ISO.
VERBOSE: Checking authorization against your Azure Stack environment
VERBOSE: Authorization verified
VERBOSE: Creating Server Full Image
VERBOSE: Creating VHD at: C:\Azuretools\AzureStack-Tools-master\ComputeAdmin\Server2016DatacenterFullEval.vhd of size:
40960 MB
VERBOSE: Preparing VHD
VERBOSE: VHD is mounted at drive letter: E
VERBOSE: Mounting ISO
VERBOSE: ISO is mounted at drive letter: F
VERBOSE: Applying Image Windows Server 2016 SERVERDATACENTER to VHD
VERBOSE: Making VHD bootable
New-AzureRmResourceGroup : Operation returned an invalid status code 'BadRequest'
At C:\Azuretools\AzureStack-Tools-master\ComputeAdmin\AzureStack.ComputeAdmin.psm1:127 char:9
+ New-AzureRmResourceGroup -Name $resourceGroupName -Location $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmResourceGroup], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupCmd
let
New-AzureRmStorageAccount:在命名空间中找不到资源类型'checkNameAvailability'。对于api版本'2016-12-,
'Microsoft.Storage' 01' 。支持的api版本为$
'2016-01-01,2015-06-15,2015-05-01-preview'。
$
在C:\ Azuretools \ AzureStack-Tools-master \ComputeAdmin \ArureStack.ComputeAdmin.psm1:133 char:27
+ ... geAccount = New-AzureRmStorageAccount -Name $ storageAccountName -Loca ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
+ CategoryInfo :CloseError:(:) [New-AzureRmStorageAccount],CloudException
+ FullyQualifiedErrorId:Microsoft.Azure.Commands.Management.Storage.NewAzureStorageAccountCommand
New-AzureRmStorageAccount : The resource type 'checkNameAvailability' could not be found in the namespace
'Microsoft.Storage' for api version '2016-12-01'. The supported api-versions are
'2016-01-01,2015-06-15,2015-05-01-preview'.
At C:\Azuretools\AzureStack-Tools-master\ComputeAdmin\AzureStack.ComputeAdmin.psm1:133 char:27
+ ... geAccount = New-AzureRmStorageAccount -Name $storageAccountName -Loca ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmStorageAccount], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.NewAzureStorageAccountCommand
Set-AzureRmCurrentStorageAccount:无法找到资源组'addvmimageresourcegroup'。
在C: \ Azuretools \AzureStack-Tools-master \ComputeAdmin \AzureStack.ComputeAdmin.psm1:135 char:5
+ Set-AzureRmCurrentStorageAccount -StorageAccountName $ storageAcco ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
+ CategoryInfo :CloseError:(:) [Set-AzureRmCurrentStorageAccount],CloudException
+ FullyQualifiedErrorId:Microsoft.Azure.Commands.Management.Storage.SetAzureRmCurrentStorageAccount
Set-AzureRmCurrentStorageAccount : Resource group 'addvmimageresourcegroup' could not be found.
At C:\Azuretools\AzureStack-Tools-master\ComputeAdmin\AzureStack.ComputeAdmin.psm1:135 char:5
+ Set-AzureRmCurrentStorageAccount -StorageAccountName $storageAcco ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureRmCurrentStorageAccount], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.SetAzureRmCurrentStorageAccount
New-Server2016VMImage:无法获取存储上下文。 请传入存储上下文或设置当前的
存储上下文。
在行:1 char:1
+ New-Server2016VMImage -ISOPath $ ISOPath -TenantId $ AADTenantID
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo :CloseError :( :) [Write-Error],InvalidOperationException
+ FullyQualifiedErrorId:InvalidOperationException,New-Server2016VMImage
New-Server2016VMImage : Could not get the storage context. Please pass in a storage context or set the current
storage context.
At line:1 char:1
+ New-Server2016VMImage -ISOPath $ISOPath -TenantId $AADTenantID
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Write-Error], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,New-Server2016VMImage
                                                   
AzureStack模块版本为1.2.9,AzureRM.Storage版本为2.7.0,AzureRM.Resources 版本3.7.0
The AzureStack module verion is 1.2.9, AzureRM.Storage version is 2.7.0, AzureRM.Resources version 3.7.0
有没有办法摆脱API不匹配错误。
Is there any way to get out of API mismatch error.
谢谢&此致,
Isahac
推荐答案
我有类似的问题。
I had similar issues.
Gary Gallanes回复了我关于这个主题的帖子:
Gary Gallanes replied to my post on the subject:
"我们发现问题与Azure Stack-Tools模块和&旧版本的
Azure资源管理器模块。
请删除旧的Azure Stack工具和Azure Resource Manager模块并下载/安装
最新版本(1.28)
###
卸载Azure模块,下载,安装和导入AzureRM模块
### Uninstall Azure Modules, Download, Install and Import AzureRM Module
Get-Module
-ListAvailable | where-Object(
Get-Module -ListAvailable | where-Object (
_。Name-like"Azure *")| Uninstall-Module
_.Name -like "Azure*") | Uninstall-Module
Set-PSRepository
-Name" PSGallery" -InstallationPolicy Trusted
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
AzureModule
=" c:\Program Files \ WindowsPowerShell \Modules \ AzureRM \1.2.8 \AzureRM.psd1"
AzureModule = "c:\Program Files\WindowsPowerShell\Modules\AzureRM\1.2.8\AzureRM.psd1"
if
(Test-Path
if (Test-Path
这篇关于上传默认的Image:API版本差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!