LoginSignup
0

More than 5 years have passed since last update.

Azure Storage RA-GRS セカンダリストレージをAzure Cli 2.0から触ったときメモ

Posted at

RA-GRSを使ったPage Blobからの復旧をazure cli 2.0を使って試そうとしたときのメモ
ちょっとつまったので。

RA-GRS

Azure Storage のストレージタイプをRA-GRSにすろとセカンダリリージョン(東日本ならセカンダリは西日本)にデータのコピーが非同期でとられる。確か15分以内に同期されたと思う。
普通のGRSなら東日本で障害発生時にMicrosoftの判断でセカンダリに切り替わるが、RA-GRSならいつでもセカンダリリージョンからReadができる。

シナリオ

  • 東日本に適当なVMを立て、そのストレージをRA-GRSにする。
  • 東日本のVMを止める(障害発生模擬)。
  • セカンダリリージョンから西日本の別のストレージアカウントへpage blobコピー
  • コピーしたpage blobからvm起動

ここからメモ

リソースグループに-secondaryのストレージアカウントは表示されない

タイトルの通りですが、前は表示されていた気がするけど、気のせい?
ポータルからや、az storage account listからは確認できず。

セカンダリストレージアカウントがないといわれる

copy start実行時にnot found
az storage blob copy start -b XXX.vhd -c vhds --source-account-name "hoge-secondary" --source-blob XXX.vhd --source-container vhds --source-sas "sas...." --account-name weststorage --sas-token "wsas..."

az storage blob copy start: error: Source storage account mitsuiragrs-secondary not found.

ちなみにgenerateもできなかった。これはプライマリと共通なので支障なし。
az storage account generate-sas --expiry "2017-4-01T12:00Z" --permissions rl --resource-types sco --services bfqt --account-name hoge-secondary

az storage account generate-sas: error: Storage account 'mitsuiragrs-secondary' not found.

でもshotやlistはいける

az storage blob show -n XXX.vhd -c vhds --account-name hoge-secondary --sas-token "sas..."
az storage blob list -c vhds --account-name hoge-secondary --sas-token "sas..."

--source-uriならいける

az storage blob copy start -b hoge.vhd -c vhds --source-uri "https://hoge-secondary.blob.core.windows.net/vhds/XXX.vhd<sas-token>" --account-name weststorage --sas-token "wsas..."
でいけました。
AzCopyもuri指定するのでいけました。

Portalで生成したsasだといけなかった

portalから生成できる?sv=2016-05-31&ss=bfqt&...のsasだと認証エラーだった。
403: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
az storage account generate-sasで生成できる、?ss=bqtf&sp=rl&sv=2015-07-08&...なsasだとイケました。

412 ConditionNotMet Copy failed when reading the source

copy startしてるときに(azcopyも)ソースのetagが変わってたりすると出るエラー。
コピーする前にVMを止めたつもりが止まってなくてちょっと苦しめられました...

まとめ

とりあえずurl使えばいけます。
いろいろ書きましたが、なんかクライアントの問題な気がします。
ソースとか見ていません。既知の問題だったらごめんなさい。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0