我们在项目当中经常会遇到VM中的IO性能问题,随着新的高级存储的推出,Windows Azure 现在提供两种类型的持久性存储:高级存储和标准存储。高级存储将数据存储在采用最新技术的固态硬盘 (SSD) 上,而标准存储将数据存储在硬盘驱动器 (HDD) 上。
目前mooncake版的此功能只是能在China East支持,暂时不能再portal页面进行直接配置,只能通过powershell 或者API进行配置,因为mooncake的账号到期被封,暂时只能通过globe的Azure进行测试。
1.首先使用powershell创建高级存储账号
New-AzureStorageAccount -StorageAccountName "jeffdemopremiumaccount" -Location "West US" -Type "Premium_LRS"
2. 验证此账户是否创建成功
PS C:\> Get-AzureStorageAccount
详细信息: 13:48:01 - Begin Operation: Get-AzureStorageAccount
详细信息: 13:48:06 - Completed Operation: Get-AzureStorageAccount
StorageAccountDescription :
AffinityGroup :
Location : West US
GeoReplicationEnabled :
GeoPrimaryLocation : West US
GeoSecondaryLocation :
Label : jeffdemopremiumaccount
StorageAccountStatus : Created
StatusOfPrimary : Available
StatusOfSecondary :
Endpoints : {https://jeffdemopremiumaccount.blob.core.windows.net/}
AccountType : Premium_LRS
StorageAccountName : jeffdemopremiumaccount
OperationDescription : Get-AzureStorageAccount
OperationId : 92019e61-d8ad-9eee-8942-462653a001ae
OperationStatus : Succeeded
3. 接下来,请创建新的 DS 系列 VM,并在控制台窗口中运行以下PowerShell cmdlet 以指定你要使用高级存储
$storageAccount = "jeffdemopremiumaccount"
$adminName = "xxxx"
$adminPassword = "xxxx"
$vmName ="jeffdemocloud"
$location = "West US"
$imageName = "03f55de797f546a1b29d1b8d66be687a__Team-Foundation-Server-2013-Update4-WS2012R2"
$vmSize ="Standard_DS2"
$OSDiskPath = "https://" + $storageAccount + ".blob.core.windows.net/vhds/" + $vmName + "_OS_PIO.vhd"
$vm = New-AzureVMConfig -Name $vmName -ImageName $imageName -InstanceSize $vmSize -MediaLocation $OSDiskPath
Add-AzureProvisioningConfig -Windows -VM $vm -AdminUsername $adminName -Password $adminPassword
New-AzureVM -ServiceName $vmName -VMs $VM -Location $location
注:vmSize 建议直接使用DS序列的虚机,这里的Image 还只能用系统默认的,自定义的还是不可用,后续会测试更新。
4.通过portal或者powershell命令附加数据磁盘,查看磁盘是否为SSD格式:
PS C:\> Get-AzureDisk
详细信息: 14:32:18 - Begin Operation: Get-AzureDisk
详细信息: 14:32:33 - Completed Operation: Get-AzureDisk
AffinityGroup :
AttachedTo : RoleName: jeffdemocloud
DeploymentName: jeffdemocloud
HostedServiceName: jeffdemocloud
IsCorrupted : False
Label :
Location : West US
DiskSizeInGB : 128
MediaLink : https://jeffdemopremiumaccount.blob.core.windows.net/vhds/jeffdemocloud_OS_PIO.vhd
DiskName : jeffdemocloud-jeffdemocloud-0-201505110602150330
SourceImageName : 03f55de797f546a1b29d1b8d66be687a__Team-Foundation-Server-2013-Update4-WS2012R2
OS : Windows
IOType : Provisioned
OperationDescription : Get-AzureDisk
OperationId : fc6cb0f7-5d18-9d38-8b1b-1de698b2e811
OperationStatus : Succeeded
AffinityGroup :
AttachedTo : RoleName: jeffdemocloud
DeploymentName: jeffdemocloud
HostedServiceName: jeffdemocloud
IsCorrupted : False
Label :
Location : West US
DiskSizeInGB : 15
MediaLink : https://jeffdemopremiumaccount.blob.core.windows.net/vhds/jeffdemocloud-jeffdemocloud-0511-1.vhd
DiskName : jeffdemocloud-jeffdemocloud-0-201505110631330609
SourceImageName :
OS :
IOType : Provisioned
OperationDescription : Get-AzureDisk
OperationId : fc6cb0f7-5d18-9d38-8b1b-1de698b2e811
OperationStatus : Succeeded
至此,此功能配置完毕。