Azure StorSimple 関連の PowerShell コマンドレット (Set-AzureStorSimpleDevice) について

ブログ エントリ内にアフィリエイト広告が含まれています
スポンサーリンク

StorSimple は、Microsoft 社が提供するハイブリッドのクラウド ストレージ サービスです。 Microsoft Azure と組み合わせることで、Azure ストレージを拡張領域として利用することが可能であり、また別拠点でのデータ復旧が可能であることから、効率的なデータ管理、災害対策が実現できます。

Azure StorSimple デバイスの管理に使用することが可能な PowerShell コマンドレットが提供されており、設定方法について MSDN サイト上で公開されていますが、PowerShell コマンドレットのヘルプについては英語のみであり、日本語による情報はほとんど公開されていません。

Azure StorSimple 関連の PowerShell コマンドレットの 1 つである「Set-AzureStorSimpleDevice」について、本ブログにて日本語の情報として纏めてみました((他の PowerShell コマンドレットについては、「Azure StorSimple 関連の PowerShell コマンドレットについて」を参照) (Windows Azure PowerShell バージョン 0.9.7 で確認しているものとなります)。

■名前

Set-AzureStorSimpleDevice

■概要

デバイスに対するデバイス構成を変更します。

■構文

Set-AzureStorSimpleDevice [-DeviceId] <String> [[-NewName] [<String>]] [[-TimeZone] [<TimeZoneInfo>]] [[-SecondaryDnsServer] [<String>]] [[-StorSimpleNetworkConfig] [<NetworkConfig[]>]] [-Profile [<AzureProfile>]] [<CommonParameters>]

Set-AzureStorSimpleDevice [-DeviceName] <String> [[-NewName] [<String>]] [[-TimeZone] [<TimeZoneInfo>]] [[-SecondaryDnsServer] [<String>]] [[-StorSimpleNetworkConfig] [<NetworkConfig[]>]] [-Profile [<AzureProfile>]] [<CommonParameters>]

■説明

Set-AzureStorSimpleDevice コマンドレットは、デバイスに対するデバイス構成を変更します。初めてデバイスを設定する場合、-TimeZone-SecondaryDnsServer、および StorSimpleNetworkConfig パラメーターを指定する必要があります。controller0、controller1、および IP アドレスを持つ Data0 に対するネットワーク構成を含む必要があります。初めてデバイスを構成するには、少なくとも インターネット SCSI (iSCSI) 有効ネットワーク インターフェイスが必要です。

■パラメーター

-DeviceId <String>
構成する StorSimple デバイスのインスタンス ID を指定します。

必須 true
位置 1
既定値 なし
パイプライン入力を許可する false
ワイルドカード文字を許可する false

-DeviceName <String>
構成する StorSimple デバイスのフレンドリ名を指定します。

必須 true
位置 1
既定値 なし
パイプライン入力を許可する false
ワイルドカード文字を許可する false

-NewName [<String>]
StorSimple デバイスの新しいフレンドリ名を指定します。

必須 false
位置 2
既定値 なし
パイプライン入力を許可する false
ワイルドカード文字を許可する false

-Profile [<AzureProfile>]
Azure プロファイルを指定します。

必須 false
位置 named
既定値 なし
パイプライン入力を許可する false
ワイルドカード文字を許可する false

-SecondaryDnsServer [<String>]
StorSimple デバイスに対するセカンダリ DNS サーバーを指定します。

必須 false
位置 4
既定値 なし
パイプライン入力を許可する false
ワイルドカード文字を許可する false

-StorSimpleNetworkConfig [<NetworkConfig[]>]
デバイス上のインターフェイスに対するネットワーク構成オブジェクトの配列を指定します。NetworkConfig オブジェクトを取得するために、New-AzureStorSimpleNetworkConfig コマンドレットを用います。

必須 false
位置 5
既定値 なし
パイプライン入力を許可する true(ByValue)
ワイルドカード文字を許可する false

-TimeZone [<TimeZoneInfo>]
デバイスのタイム ゾーンを指定します。GetSystemTimeZone() メソッドを用いて TimeZoneInfo オブジェクトの作成が可能です。例として、太平洋標準時間帯のタイム ゾーン情報オブジェクトを作成します: [System.TimeZoneInfo]::GetSystemTimeZones() | where { $_.Id -eq “Pacific Standard Time” }

必須 false
位置 3
既定値 なし
パイプライン入力を許可する true(ByValue)
ワイルドカード文字を許可する false

<CommonParameters>
このコマンドレットは、次の共通パラメーターをサポートします: –Verbose、-Debug、-ErrorAction-ErrorVariable、-WarningAction、-WarningVariable、-OutBuffer、-PipelineVariable、および -OutVariable。詳細については、about_CommonParameters を参照してください。

■入力

  • NetworkConfig, TimeZoneInfo
    このコマンドレットへ、NetworkConfig オブジェクトもしくは TimeZoneInfo オブジェクトを渡すことが可能です。

■出力

  • DeviceDetails
    このコマンドレットは、仮想デバイスに対する更新されたデバイスの詳細を返します。

■メモ

  • 詳細については、「Get-Help Set-AzureStorSimpleDevice -detailed」と入力してください。
  • 技術情報については、「Get-Help Set-AzureStorSimpleDevice -full」と入力してください。

■エイリアス

  • なし

■例

例 1: デバイスに対する構成の修正

$NetworkConfigData0 = New-AzureStorSimpleNetworkConfig -InterfaceAlias Data0 -EnableIscsi $True -Controller0IPv4Address "10.67.64.48" -Controller1IPv4Address "10.67.64.49"
$TimeZoneInfo = [System.TimeZoneInfo]::GetSystemTimeZones() | where { $_.Id -eq "Pacific Standard Time" }
$OnlineDevice = @(Get-AzureStorSimpleDevice | Where { $_.Status -eq "Online"})[0]
$UpdatedDetails = Set-AzureStorSimpleDevice -DeviceId $OnlineDevice.DeviceId -NewName "Device22" -TimeZone $TimeZoneInfo -SecondaryDnsServer 10.8.8.8 -StorSimpleNetworkConfig $NetworkConfigData0
VERBOSE: ClientRequestId: 0f163163-5ad0-4635-a7b5-870d47297f66_PS
VERBOSE: Successfully created a StorSimple Network Configuration for interface Data0
VERBOSE: ClientRequestId: 552e4a6c-7006-4015-a20b-9def6428a85e_PS
VERBOSE: ClientRequestId: f31cc84c-bc8a-404a-9da6-4670a7999e75_PS
VERBOSE: 1 StorSimple device found!
VERBOSE: ClientRequestId: 545bc1a9-3c1b-4e50-89a6-9678aefe79e5_PS
VERBOSE: ClientRequestId: f114ad08-47f5-4fb8-8a01-1ea7f1ed1b98_PS
VERBOSE: About to configure the device : Device22 !
VERBOSE: ClientRequestId: 6afe7927-1c19-48d3-ac22-68148fd056b8_PS
VERBOSE: The task created for your Setup operation has completed successfully.
VERBOSE: ClientRequestId: 467c142c-90da-4d75-82a4-c114afce953d_PS
VERBOSE: Successfully updated configuration for device Device22 with id 865e68f6-1e71-47b6-80d5-15d3a23bd2b0

1 番目のコマンドは、Data0 インターフェイスに対してネットワーク構成を作成します。このコマンドは、-Controller0IPv4Address-Controller1IPv4Address、および -EnableIscsi パラメーターを指定します。コマンドは、変数 $NetworkConfigData0 内に結果を格納します。

2 番目のコマンドは、太平洋標準時間帯を取得するために System.TimeZoneInfo .NET クラスと標準構文を用いて、変数 $TimeZoneInfo 内のオブジェクトに格納します。

3 番目のコマンドは、オンライン StorSimple デバイスを取得するために Get-AzureStorSimpleDevice コマンドレット、および Where-Object コマンドレットを用いて変数 $OnlineDevice 内に格納します。

最後のコマンドは、指定したデバイス ID を持つデバイスの構成を修正します。コマンドは、現在のコマンドレットが 1 番目のコマンドで作成された構成オブジェクトを用います。コマンドは $TimeZoneInfo に格納されたタイム ゾーンを用います。

例 2: デバイスを修正するために構成オブジェクトをパイプ

$TimeZoneInfo = [System.TimeZoneInfo]::GetSystemTimeZones() | where { $_.Id -eq "Pacific Standard Time" }
$OnlineDevice = @(Get-AzureStorSimpleDevice | Where { $_.Status -eq "Online"})[0]
$UpdatedDetails = New-AzureStorSimpleNetworkConfig -InterfaceAlias Data0 -EnableIscsi $True -Controller0IPv4Address "10.67.64.48" -Controller1IPv4Address "10.67.64.49" | Set-AzureStorSimpleDevice -DeviceId $OnlineDevice.DeviceId -NewName "Device22" -TimeZone $TimeZoneInfo -SecondaryDnsServer 10.8.8.8
VERBOSE: ClientRequestId: fa2f5000-169c-4feb-abbf-23f4b5c837fa_PS
VERBOSE: Successfully created a StorSimple Network Configuration for interface Data0
VERBOSE: ClientRequestId: fae6a491-919c-44b2-93e0-0c51f202c24b_PS
VERBOSE: ClientRequestId: e1803427-a097-4d58-ab7d-14a4c39fd768_PS
VERBOSE: 1 StorSimple device found!
VERBOSE: ClientRequestId: 9e796c3d-3100-46ab-9a09-0e10c73a296f_PS
VERBOSE: ClientRequestId: 5b4cad96-31f4-4d07-a278-df5af3e06ad4_PS
VERBOSE: About to configure the device : Device22 !
VERBOSE: ClientRequestId: 9061f7df-144f-4f30-858c-045d882ca392_PS
VERBOSE: The task created for your Setup operation has completed successfully.
VERBOSE: ClientRequestId: 2ed2fa9b-8459-4cd6-9a61-5fc25ced2815_PS
VERBOSE: Successfully updated configuration for device Device22 with id 865e68f6-1e71-47b6-80d5-15d3a23bd2b0

この例は、最後のコマンドでパイプライン操作を用いて現在のコマンドレットへネットワーク構成オブジェクトを渡すことを除いて、例 1 と同じ構成の更新を行います。

例 3: デバイスを修正するためにタイム ゾーン オブジェクトのパイプ

$NetworkConfigData0 = New-AzureStorSimpleNetworkConfig -InterfaceAlias Data0 -EnableIscsi $True -Controller0IPv4Address "10.67.64.48" -Controller1IPv4Address "10.67.64.49"
$OnlineDevice = @(Get-AzureStorSimpleDevice | Where { $_.Status -eq "Online"})[0]
$UpdatedDetails = [System.TimeZoneInfo]::GetSystemTimeZones() | where { $_.Id -eq "Pacific Standard Time" } | Set-AzureStorSimpleDevice -DeviceId $OnlineDevice.DeviceId -NewName "Device22" -SecondaryDnsServer 10.8.8.8 -StorSimpleNetworkConfig $NetworkConfigData0
VERBOSE: ClientRequestId: cfc3f3c7-a8b6-462b-96f4-124050b736fe_PS
VERBOSE: Successfully created a StorSimple Network Configuration for interface Data0
VERBOSE: ClientRequestId: 6017b76f-a771-4bf8-901e-14876e0f9962_PS
VERBOSE: ClientRequestId: 59a9275c-9005-4e8a-b68b-efa1e6c27d47_PS
VERBOSE: 1 StorSimple device found!
VERBOSE: ClientRequestId: 08e5142a-b038-4607-8690-0c5a8b948352_PS
VERBOSE: ClientRequestId: 218af244-b8f4-4a4b-817e-8f67e1323f03_PS
VERBOSE: About to configure the device : Device22 !
VERBOSE: ClientRequestId: fbd1f32d-1d74-432e-9dc0-90b46674884a_PS
VERBOSE: The task created for your Setup operation has completed successfully.
VERBOSE: ClientRequestId: 981cb941-252c-4898-ba9f-f19e5b8bcaa4_PS
VERBOSE: Successfully updated configuration for device Device22 with id 865e68f6-1e71-47b6-80d5-15d3a23bd2b0

この例は、最後のコマンドでパイプライン操作を用いて現在のコマンドレットにタイムゾーン オブジェクトを渡すことを除いて、例 1 と同じ構成の更新を行います。

■関連するトピック

  • New-AzureStorSimpleNetworkConfig
  • Set-AzureStorSimpleVirtualDevice

[参考]

タイトルとURLをコピーしました