Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1175366
  • 博文数量: 150
  • 博客积分: 2739
  • 博客等级: 少校
  • 技术积分: 2392
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-07 12:28
文章分类

全部博文(150)

文章存档

2015年(2)

2014年(16)

2013年(10)

2012年(58)

2011年(64)

分类: PERL

2014-05-08 11:54:49


Windows Azure Poweshell batch to create virtual machines
batch to create windows virtual machines 

点击(此处)折叠或打开


  1. #The subscribe ID number..
  2. $ID = "MS-85"
  3. #The Storage account
  4. $STORAGE = "portalftest148"
  5. #The Location
  6. $location = "China North"
  7. #Switch the subscribe
  8. Select-AzureSubscription -SubscriptionName $ID
  9. #Create New Storage account
  10. New-AzureStorageAccount -StorageAccountName $STORAGE -Location $location
  11. #set Azure storage account default..
  12. Set-AzureSubscription -SubscriptionName $ID -CurrentStorageAccountName $STORAGE
  13. #Set System image 
  14. $imageName = "55bc2b193643443bb879a78bda516fc8__Win2K8R2SP1-Datacenter-201403.01-zh.cn-127GB.vhd"
  15. #Create New Windows VM machine
  16. 147..148|ForEach {New-AzureVMConfig -Name ftest$_ -InstanceSize 'Small' -ImageName $imageName ` |
  17. Add-AzureProvisioningConfig –Windows –AdminUsername ‘testadmin’ -Password 'Passw0rd' ` |
  18. Add-AzureEndpoint -Name "Http" -Protocol "tcp" -PublicPort 80 -LocalPort 80 
  19. Add-AzureEndpoint -Name "Ftp" -Protocol "tcp" -PublicPort 21 -LocalPort 21 |
  20. New-AzureVM -ServiceName ftest$_}

batch to create linux virtual machines 

点击(此处)折叠或打开

  1. #The subscribe ID number..
  2. $ID = "MS-85"
  3. #The Storage account
  4. $STORAGE = "portalftest148"
  5. #The Location
  6. $location = "China North"
  7. #Switch the subscribe
  8. Select-AzureSubscription -SubscriptionName $ID
  9. #Create New Storage account
  10. New-AzureStorageAccount -StorageAccountName $STORAGE -Location $location
  11. #set Azure storage account default..
  12. Set-AzureSubscription -SubscriptionName $ID -CurrentStorageAccountName $STORAGE
  13. #Set System image
  14. $imageName = "55bc2b193643443bb879a78bda516fc8__Win2K8R2SP1-Datacenter-201403.01-zh.cn-127GB.vhd"
  15. #Create New Windows VM machine
  16. 147..148|ForEach {New-AzureVMConfig -Name ftest_ -InstanceSize $VMSIZE -ImageName $imageName ` |
  17. Add-AzureProvisioningConfig -Linux LinuxUser ‘testadmin’ -Password 'Passw0rd' ` |
  18. Add-AzureEndpoint -Name "Http" -Protocol "tcp" -PublicPort 80 -LocalPort 80 |
  19. Add-AzureEndpoint -Name "Ftp" -Protocol "tcp" -PublicPort 21 -LocalPort 21 |
  20. New-AzureVM -ServiceName ftest$_ -Location 'China North'}




阅读(6201) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~