CSuploadなんて無かった!(Azureに仮想マシンイメージをアップロードする方法


Microsoft Azureに仮想マシンイメージをアップロードしようとした。
ぐぐったら、CSUploadというコマンドを使うらしく、Azure SDKをインストールすればいいらしい・・・

Azure SDKをインストールして、実行!

PS C:\> CSupload
CSupload : 用語 'CSupload' は、コマンドレット、関数、スクリプト ファイル、または操作可能なプログラ
れません。名前が正しく記述されていることを確認し、パスが含まれている場合はそのパスが正しいことを確
てください。
発生場所 行:1 文字:1
+ CSupload
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (CSupload:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\>

そんなコマンドは無いらしい。

気を取り直して公式系情報を探す。

Create and upload a Windows Server VHD to Azure

「Add-AzureVhd」コマンドを使うようだ。

固定長で作成したWindows7 64bit評価版のインストール済みvhdファイルを指定して実行。

PS C:\> add-azurevhd

コマンド パイプライン位置 1 のコマンドレット Add-AzureVhd
次のパラメーターに値を指定してください:
(ヘルプを表示するには、「!?」と入力してください。)
Destination: http://~.blob.core.windows.net/images/win7-64.vhd
LocalFilePath: C:\Users\Public\Documents\Hyper-V\Virtual hard disks\win7-64.vhd
MD5 hash is being calculated for the file  C:\Users\Public\Documents\Hyper-V\Virtual hard disks\win7-64.vhd.
MD5 hash calculation is completed.
Elapsed time for the operation: 00:07:35
Creating new page blob of size 21474836992...
Detecting the empty data blocks in the local file.
Detecting the empty data blocks completed.
Elapsed time for upload: 00:32:17

LocalFilePath                                               DestinationUri
-------------                                               --------------
C:\Users\Public\Documents\Hyper-V\Virtual hard disks\win... http://~.blob.core.windows.net/images/win7-6...


PS C:\>

ネットワークの転送量を見ていると、「Detecting the empty data blocks in the local file.」から「Detecting the empty data blocks completed.」までが案外長い。
動いてるのかなぁ?と悩むぐらいに。(注:転送前にローカルのVHDファイル内の空きブロック検出して、送らなくてもいい部分を探しているので、時間がかかっている)

転送終了後、無事、仮想マシンの新規作成にこのイメージが使用できる、ということを確認できました。