例: Microsoft Windows イメージ

この例は、virt-install コマンドと KVM ハイパーバイザーを用いて、Windows Server 2012 qcow2 イメージを作成します。

  1. 以下の手順に沿って、インストールを準備します。

    1. Windows Server 2012 インストール ISO をダウンロードします。評価イメージが Microsoft の Web サイト にあります (要登録)。

    2. Download the signed VirtIO drivers ISO from the Fedora website.

    3. 15 GB qcow2 イメージを作成します。

      $ qemu-img create -f qcow2 ws2012.qcow2 15G
      
  2. virt-install コマンドを用いて Windows Server 2012 のインストールを開始します。

    # virt-install --connect qemu:///system \
      --name ws2012 --ram 2048 --vcpus 2 \
      --network network=default,model=virtio \
      --disk path=ws2012.qcow2,format=qcow2,device=disk,bus=virtio \
      --cdrom /path/to/en_windows_server_2012_x64_dvd.iso \
      --disk path=/path/to/virtio-win-0.1-XX.iso,device=cdrom \
      --vnc --os-type windows --os-variant win2k12 \
      --os-distro windows --os-version 2012
    

    virt-manager または virt-viewer を使用して、仮想マシンに接続し、Windows のインストールを

  3. Enable the VirtIO drivers. By default, the Windows installer does not detect the disk.

  4. Load VirtIO SCSI drivers and network drivers by choosing an installation target when prompted. Click Load driver and browse the file system.

  5. Select the E:\virtio-win-0.1XX\viostor\2k12\amd64 folder. The Windows installer displays a list of drivers to install.

  6. Select the VirtIO SCSI drivers.

  7. Click Load driver and browse the file system, and select the E:\NETKVM\2k12\amd64 folder.

  8. Select the network drivers, and continue the installation. Once the installation is completed, the VM restarts.

  9. Define a password for the administrator when prompted.

  10. 管理者としてログインし、コマンドウィンドウを起動します。

  11. 以下のコマンドを実行して、VirtIO ドライバーのインストールを完了します。

    C:\pnputil -i -a E:\virtio-win-0.1XX\viostor\2k12\amd64\*.INF
    
  12. インスタンスの起動時に、 Cloudbase-Init がスクリプトを実行できるようにするために、PowerShell の実行ポリシーを無制限に設定します。

    C:\powershell
    C:\Set-ExecutionPolicy Unrestricted
    
  13. Cloudbase-Init をダウンロードして、インストールします。

    C:\Invoke-WebRequest -UseBasicParsing https://cloudbase.it/downloads/CloudbaseInitSetup_Stable_x64.msi -OutFile cloudbaseinit.msi
    C:\.\cloudbaseinit.msi
    

    設定オプション ウィンドウで、以下の設定を変更します。

    • ユーザー名: Administrator

    • 設定するネットワークアダプター: Red Hat VirtIO Ethernet Adapter

    • ロギングするシリアルポート: COM1

    インストール完了後、Complete the Cloudbase-Init Setup Wizard ウィンドウで、Run SysprepShutdown のチェックボックスを選択し、Finish をクリックします。

    マシンがシャットダウンされるのを待ちます。

お使いのイメージを Image にアップロードする準備ができました。

$ openstack image create --disk-format qcow2 --file ws2012.qcow2 WS2012