Adding Affinity Group and Storage

$adminPassword=”hhhhhhhh”

Select-AzureSubscription -SubscriptionName “Azure”

New-AzureAffinityGroup -Name “PowerAFG3” -Location “East US”

New-AzureStorageAccount -StorageAccountName “PowerStorage3”.ToLower() -AffinityGroup “PowerAFG3”.ToLower() -Label “PowerStorage3”.ToLower()
Set-AzureStorageAccount -StorageAccountName “PowerStorage3”.ToLower() -GeoReplicationEnabled $false

Set-AzureSubscription -CurrentStorageAccountName “PowerStorage3” -SubscriptionName “Azure xxx”

$config=New-AzureVMConfig -Name “MyNewVM” -InstanceSize ExtraSmall -ImageName (Get-AzureVMImage)[4].ImageName
$config=$config | Add-AzureProvisioningConfig -Windows -Password $adminPassword -AdminUsername “PsTestAdmin”
$config=$config| New-AzureVM -ServiceName “MySvc2” -AffinityGroup “PowerAFG3” -WaitForBoot

Get-AzureSubscription | Format-List -Property SubscriptionName,IsDefault,CurrentStorageAccountName

Set-AzureStorageAccount -StorageAccountName “powerstoss”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s