I'm trying to provision a new Azure VM w/ Ubuntu 14.04 server and a reserved IP. I'm using Azure PowerShell for doing this. When everthing's said and done, I end up getting the error: New-AzureVM : BadRequest: Disktype Linux cannot be used with WindowsProvisioningConfigurationSet. How do I solve this problem?
Background: I began via Add-AzureAccount
and Set-AzureSubscription
. I then set values for: $vmName
, $username
, $password
, $location
, $reservedIP
, $imageFamily
and $imageName
.
FYI, $imageFamily = "Ubuntu Server 14.04 LTS"
and
$imageName = Get-AzureVMImage | where { $_.ImageFamily -eq $imageFamily } | sort PublishedDate -Descending | select -ExpandProperty ImageName -First 1
I finally executed New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location
New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location
New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location
and ended up getting the aforementioned error.
Note: If I change Add-AzureProvisioningConfig -Windows
to Add-AzureProvisioningConfig -Linux
, I get the error: parameter set cannot be resolved using the specified named parameters.
That Add-AzureVMConfig command is erroneous. The correct command in this case ought to be: New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Linux -LinuxUser $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location
New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Linux -LinuxUser $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location
Documentation for this can be found at https://msdn.microsoft.com/en-us/library/azure/dn495299.aspx
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.