none
New vnet fails to create with existing subscription RRS feed

  • Question

  • I have my Azure account with one affinity group, one virtual network, and a bunch of VMs hanging off of it.

    I’m now trying to create a second of each…basically a mirror of the first with new names/IPs/… However, it’s giving me a weird error.

     The files, when run, give this error:

    set-azurevnetconfig : Failed: Cannot delete or modify virtual network while in use 'topo8vnet'.

    At C:\foo\net.ps1:3 char:1

    + set-azurevnetconfig -ConfigurationPath "$pathDir\topo9.netcfg"

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : CloseError: (:) [Set-AzureVNetConfig], Exception

        + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.IaaS.SetAzureVNetConfigCommand

     

    Note that the network name is topo8vnet in the error.  What’s so interesting is that the files executed never reference this name…they are referring to topo9. Topo8 does exist (that's my first one that already exists), but I’m trying to create topo9.

    Why is the set-azurevmconfig command targeting the wrong affinity group? I assume I must be missing some important command which tells it which affinity group to target and so it’s picking a default of some sort, but for the life of me I can’t find it…

    Thx!

    Tuesday, January 15, 2013 3:54 AM

Answers

  • Hi Eric,

    Thanks for posting your question here.

    Your netcfg describes your entire subscription’s VNet config. Omitting the specification for 'topo8vnet' in the file implies that the VNet by that should be deleted. In fact, that's how VNets are deleted.

    Solution:

    1. Export your existing VNet config file
    2. Make changes to it to reflect what you’d like your subscription’s VNet state (all the VNet in your subscription) should look like.
    3. Use that resulting file to make changes to your VNet config.

    Best regards,

    -Steve

    Wednesday, January 16, 2013 12:07 AM
    Moderator