Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

Attach VM to VNet Failed

$
0
0

Hi,

I've got issue creating a VM inside a virtual network using powershell.

I have a VirtualNetwork :

<VirtualNetworkSites><VirtualNetworkSite name="rsp-eu-west" Location="West Europe"><AddressSpace><AddressPrefix>10.155.8.0/21</AddressPrefix></AddressSpace><Subnets><Subnet name="RSP"><AddressPrefix>10.155.8.0/24</AddressPrefix></Subnet></Subnets></VirtualNetworkSite>

A CloudService in an affinity group located in West Europe, A Storage Account in the same affinity group.

Then I use the following script :

$vm1 = New-AzureVMConfig -Name $vmName -InstanceSize $vmSize -ImageName $imageName | Set-AzureSubnet "subnet-1"  |
        Add-AzureProvisioningConfig -Linux `
                                    -LinuxUser $user `
									-NoSSHPassword `
									-SSHPublicKeys $sshkey




New-AzureVM -ServiceName $cloudservice `
            -VMs $vm1 `
            -ReservedIPName $cloudservice 

But  the command return :

New-AzureVM : BadRequest: The virtual network name cannot be null or empty.

Do you have any idea about what's wrong here ?

Thanks.


Viewing all articles
Browse latest Browse all 12545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>