Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

Bulk Creation of StorSimple volumes

$
0
0

This blog is to demonstrate the steps required to create StorSimple volumes in bulk using CSV file and Azure PowerShell.

Pre-requisites

  • Having your StorSimple device configured and registered with Azure subscription
  • Azure PowerShell installed on local machine, Azure PowerShell, for how to install and configure Azure PowerShell see https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/
  • Create and CSV file having two columns VolumeName,Size and name the file Volumes.csv
  • Within the CSV file Enter the desired volume name and size in bytes as per the below example

VolumeName,Size
VL01,3221225472
VL02,3221225472
VL03,3221225472

The above example will result in creating three volumes named VL01,VL02,VL03 with a size of 3 GB each.

Creation steps

Replace all parameters highlighted in green with your environment specific values.

  1. Open Azure PowerShell, add your subscription credentials using this command  Add-AzureAccount .
  2. Connect to Device using 

Select-AzureStorSimpleResource –ResourceName “StorSimple Manager Name” –RegistrationKey 909740526525357691:MSgU5AXOpMrPWknD69xch5u6oNEduFXBdANywYGHKKA=:jkfVqWgcs1Z0vJLA94dJLk==#a812248806f1a7f9

Registration key can be obtained under StorSimple manager dashboard

     3. Import the CSV file entries into PowerShell using this command $volumeList=IMPORT-CSV volumes.csv 

Now we have to two options, we can create the volumes with no association/sharing with server hosts or having all previously created server hosts on the this StorSimple enumerated and assigned to the newly created volumes

  1. Option A: we will create primary volumes with monitoring , default backup enabled and no association to any of the hosts 

$volumeList | FOREACH-OBJECT { Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Device Name" -VolumeContainerName "Container Name" | New-AzureStorSimpleDeviceVolume -DeviceName "Device Name" -VolumeName $_.volumeName -Size $_.size -AccessControlRecords @() -VolumeAppType PrimaryVolume -Online $True -EnableDefaultBackup $true -EnableMonitoring $true}

     2. Option B: we will create primary volumes with monitoring , default backup enabled and association to all server hosts previously defined on the StorSimple manager

$AcrList = Get-AzureStorSimpleAccessControlRecord
$volumeList=IMPORT-CSV volumes.csv
$volumeList | FOREACH-OBJECT { Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "device name" -VolumeContainerName "Container Name" | New-AzureStorSimpleDeviceVolume -DeviceName "device name" -VolumeName $_.volumeName -Size $_.size -AccessControlRecords $AcrList -VolumeAppType PrimaryVolume -Online $True -EnableDefaultBackup $true -EnableMonitoring $true}

 

Warning: Try the above commands in test environment first and make sure of any parameters used


Viewing all articles
Browse latest Browse all 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>