ディスクをホストする一時仮想マシンを作成する
ここでは、Microsoft Azure仮想マシン(VM)を作成し、それを使用してディスクを作成する方法について説明します。VMを作成するには、Microsoft Azure Portalまたはコマンドラインを使用します。
Microsoft Azure Portalを使用する
- Microsoft Azure Portalにサインインします。
- メニューからすべてのサービス(All Services)を選択します。
- 仮想マシン(Virtual Machines)を選択します。または、お気に入りのリストから(Virtual Machines)仮想マシン([Virtual Machines)]を選択することもできます。
- 追加(Add)をクリックします。仮想マシンの作成(Create a virtual machine)ページが表示されます。
- リソースグループ(Resource group)のドロップダウンメニューからリソースグループを選択します。
- 仮想マシン名(Virtual machine name)フィールドで、新しいVMの名前を入力します。
- リソースグループを含む地域を選択します。
- 画像(Image)のドロップダウンメニューから、Ubuntu Server LTSの利用可能な任意のバージョンを選択します。
- サイズ(Size)フィールドに
Standard D2s V3と入力します。 - 管理者アカウント(Administrator Account)セクションで、認証タイプ(Authentication Type)(Password)にパスワード(Password)(Authentication Type)を選択し、VMに適用するユーザー名とパスワードを入力します。
- 受信ポートのルール(Inbound Port rules)セクションで、受信ポートを選択(Select inbound ports)フィールドに
ssh(22)と入力します。 - 次の手順:ディスク(Next: Disks)をクリックします。
- 新しいディスクを作成して添付(Create and attach a new disk)をクリックします。
- ディスク容量の変更(Change disk size)をクリックして512gbを選択します。
- OK(Ok)をクリックします。
- 次の手順:ネットワーキング([Next: Networking)] をクリックします。
- 受信ポートを選択(Select inbound ports)フィールドに
ssh(22)と入力します。 - 作成・レビュー(Create and review)をクリックし、検証プロセスが終了するまで待ちます。
- 作成(Create)をクリックします。
- デプロイメントが完了(Deployment is Complete)プロンプトが表示されたら、リソースに進む(Goto Resource)をクリックします。新しいVMを調べ、外部IPアドレスをメモします。
コマンドラインを使用する
- 次のオプションと
az vm createコマンドを使用してVMを作成します。az vm create --name <name> --resource-group <resource-group> --location <region> \ --image "ubuntults" --size "Standard_D2s_v3" --data-disk-sizes-gb 500 \ --authentication-type "password" --admin-username "okta" --admin-password "AlwaysOn@123"-
<name>:イメージの名前。 -
<region>:VMを格納する地域。 -
<name-of-vm>:VMの名前。 -
<virtual-disk>:VMに関連付けられた仮想ディスクの名前。 -
<resource-group>:VMが含まれる事前作成したリソースグループの名前。
以下は、パラメーターにサンプル値を入力した
az vm createコマンドの例です。az vm create --name "Upload-OAG-VHD" \ --resource-group "AccessGateway" --location "eastus" --image "ubuntults" \ --size "Standard_D2s_v3" --data-disk-sizes-gb 500 \ --authentication-type "password" --admin-username "okta" --admin-password "AlwaysOn@123このコマンドから次の結果が表示されます。
--running . . . {- Finished .. "fqdns": "", "id": "/subscriptions/. . . /resourceGroups/AccessGateway/providers/Microsoft.Compute/virtualMachines/Upload-OAG-VHD", "location": "eastus2", "macAddress": "00-0D-3A-E4-AB-31", "powerState": "VM running", "privateIpAddress": "10.0.0.4", "publicIpAddress": "40.79.32.220", "resourceGroup": "AccessGateway", "zones": "" } -
- 結果を調べ、外部IPアドレスを確認します。
次の手順