DZone
Cloud Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Cloud Zone > Moving a Microsoft Azure VM to a Different Subnet Within a Virtual Network

Moving a Microsoft Azure VM to a Different Subnet Within a Virtual Network

Yung Chou user avatar by
Yung Chou
·
May. 06, 14 · Cloud Zone · Interview
Like (0)
Save
Tweet
6.93K Views

Join the DZone community and get the full member experience.

Join For Free

in microsoft azure, an administrator can now use powershell to migrate a vm from one subnet to another within the same virtual network. this offers an opportunity to reorganize an application topology for better managing subnet capacity and grouping. for instance, when an existing subnet, abc, is running out of ip addresses, customers can move  the associated vms to a different and perhaps larger subnet. at this time, subnet abc can then be deleted to recover the ip address space.

the logical process to carry out a subnet migration is to:

  1. migrate a vm from one subnet to another, followed by
  2. update the vm configuration which will restart the vm

the msdn documentation at http://msdn.microsoft.com/en-us/library/azure/dn643636.aspx offers a sample powershell statement as below.

get-azurevm –name <a target vm name> –servicename <the associated service name> `
| set-azuresubnet –subnetnames <a target subnet to migrate to> `
| update-azurevm

and i am here providing a sample scenario of moving a vm from a dev subnet to a test one as illustrated below.

image

a virtual network, foonet, has three subnets: ad, dev, and test, while each subnet is configured with a specific ip address range as shown.

image the intent is to move the vm, app1, currently in dev to the subnet, test.
image the vm, app1, is deployed to the service, foo-devtest, i.e. http://foo-devtest.cloudapp.net.
image an ise session is connecting to the microsoft azure subscription account and has successfully moved the vm to the target subnet, test.

for those who are not familiar with microsoft azure powershell, a self-training tool called quick start kit (qsk) is available at http://yungchou.wordpress.com/2014/01/21/announcing-windows-azure-iaas-quick-start-kit-qsk-at-http-aka-ms-qsk/ .
image the vm now resides in the subnet, test.
azure Virtual Machine Network

Published at DZone with permission of Yung Chou, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • An Overview of 3 Java Embedded Databases
  • 5 Steps to Strengthen API Security
  • APIs Outside, Events Inside
  • Instancio: Test Data Generator for Java (Part 2)

Comments

Cloud Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo