【问题标题】:Import VMware Image to Azure - Credentials?将 VMware 映像导入 Azure - 凭据?
【发布时间】:2016-05-19 09:01:38
【问题描述】:

我尝试从 VMWare 映像在 Azure 门户中创建虚拟计算机。我使用了本教程:

在德语教程中你会发现

$vm = Set-AzureRmVMOperatingSystem -VM $vmConfig -Windows -ComputerName $computerName -Credential $cred -ProvisionVMAgent -EnableAutoUpdate

为了获得我使用的 $cred:

$cred = Get-Credentials

将出现一个登录窗口以输入凭据

我必须在这里输入什么样的凭据?映像或 Azure 的凭据?我必须以什么格式输入?我尝试了 Computername\User 和密码(例如 ARES\Administrator 和密码。

编辑 1

使用机器凭据 MyMachineName\Administrator 我收到以下错误:

PS C:\WINDOWS\system32> $cred = Get-Credential

Cmdlet Get-Credential an der Befehlspipelineposition 1
Geben Sie Werte für die folgenden Parameter an:
Credential
PS C:\WINDOWS\system32> $vm = Set-AzureRmVMOperatingSystem -VM $vmConfig -Windows -ComputerName $computerName -Credential $cred -ProvisionVMAgent -EnableAutoUpdate
PS C:\WINDOWS\system32> $result = New-AzureRmVM -ResourceGroupName $rgName -Location $location -VM $vm
New-AzureRmVM : Windows admin user name cannot be more than 20 characters long, end with a period(.), or contain the following characters: \ / " [ ] : | < > + = ; , ? * @.
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : ''
In Zeile:1 Zeichen:11
+ $result = New-AzureRmVM -ResourceGroupName $rgName -Location $locatio ...
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureRmVM], ComputeCloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand

编辑 2

在阅读https://msdn.microsoft.com/en-us/library/mt603843.aspx 示例的提示之后,我得到了这个。我的用户是管理员,但我收到消息,不允许吗?!

PS C:\WINDOWS\system32> $SecurePassword = ConvertTo-SecureString "mypassword" -AsPlainText -Force
PS C:\WINDOWS\system32> $Credential = New-Object System.Management.Automation.PSCredential ("Administrator", $SecurePassword);
PS C:\WINDOWS\system32> $AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "KGSCloud"
PS C:\WINDOWS\system32> $vmName = "titan"
PS C:\WINDOWS\system32> $computerName = "TITAN"
PS C:\WINDOWS\system32> $vm = Set-AzureRmVMOperatingSystem -VM $vmConfig -Windows -ComputerName $computerName -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate
PS C:\WINDOWS\system32> $result = New-AzureRmVM -ResourceGroupName $rgName -Location $location -VM $vm
New-AzureRmVM : The Admin Username specified is not allowed.
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : ''
In Zeile:1 Zeichen:11
+ $result = New-AzureRmVM -ResourceGroupName $rgName -Location $locatio ...
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureRmVM], ComputeCloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand

有人可以帮我吗?

亲切的问候

【问题讨论】:

    标签: powershell azure azure-powershell


    【解决方案1】:

    对于Set-AzureRmVMOperatingSystem,您需要输入虚拟机的凭据。因此,此阶段的格式将是本地管理员帐户和密码。

    【讨论】:

    猜你喜欢
    • 2020-05-08
    • 1970-01-01
    • 2014-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-28
    • 1970-01-01
    • 2010-09-11
    相关资源
    最近更新 更多