XenServerへの仮想マシンのインストール

はじめに

CentOS6 64bitをインストール。
以下URLを参照
→上記URLにxeコマンドの意味が書いている!!!

Xenの以下用語を抑えるべし。
4.3.1. Network Objects
This chapter uses three types of server-side software objects to represent networking entities. These objects are:

• A PIF, which represents a physical NIC on a XenServer host. PIF objects have a name and description, a globally
unique UUID, the parameters of the NIC that they represent, and the network and server they are connected to.

• A VIF, which represents a virtual NIC on a virtual machine. VIF objects have a name and description, a globally
unique UUID, and the network and VM they are connected to.

• A network, which is a virtual Ethernet switch on a XenServer host. Network objects have a name and
description, a globally unique UUID, and the collection of VIFs and PIFs connected to them.

→PIFはXenホストの物理NICの意味
→VIFは仮想マシンのNICの意味
→networkは仮想スイッチの意味

どんな情報を指定する必要があるかを確認する為、CLIより行う。
作成する仮想マシンの名前はnfs

手順

①template uuidの確認
xe template-list

上記コマンドの出力から、CentOS6 64bitのUUIDは以下であることが分かる。
1eab1afd-b495-9bb2-1b2a-836ce0ff0b4f

→作成する仮想マシンのOSの指定

②インストール先のストレージのuuidの確認
xe-sr-list

上記コマンドの出力結果より以下がローカルストレージである事が判明
0f121c1b-fab8-0e42-d903-15f3cd45b549

③仮想マシンの作成
xe vm-install template=1eab1afd-b495-9bb2-1b2a-836ce0ff0b4f new-name-label=nfs sr-uuid=0f121c1b-fab8-0e42-d903-15f3cd45b549

→以下の仮想マシンのUUIDが出力される。
4347b47c-3794-5036-f1a4-0c0db6f65a98

④仮想マシンの接続先ネットワークの確認
xe network-list

上記コマンドの出力結果より、以下UUIDがxenbr0である事が判明
1c003a82-605d-4f62-71a6-617aa41323f7

※xsenbr0はeth0がアップリンクとなる仮想スイッチ。

⑤仮想マシンを接続するvifの作成
xe vif-create vm-uuid=4347b47c-3794-5036-f1a4-0c0db6f65a98 network-uuid=1c003a82-605d-4f62-71a6-617aa41323f7 mac=random device=0

→仮想マシン搭載するNICを定義!

※macは仮想マシンを接続する仮想スイッチのMACアドレス。
※deviceは仮想マシンのNICを特定する為のID。例)NICが複数存在する場合、区別するのに使う情報でしょう。作成したばかりの仮想マシンにはNICがない為、0でOK。

以下のVIFのUUIDが出力される。
1bef1100-65eb-3a21-4a42-218f2eb36256

⑥仮想マシンのインストールレポジトリを指定。

xe vm-param-set uuid=4347b47c-3794-5036-f1a4-0c0db6f65a98 other-config:install-repository=http://ftp.riken.jp/Linux/centos/6.6/os/x86_64/

→インストール時の利用レポジトリ専用のパラメタってことか。指定のパス配下のisolinux/vmlinusファイルにアクセスする動きだった。

⑦仮想マシンの起動
xe vm-start uuid=4347b47c-3794-5036-f1a4-0c0db6f65a98

⑧XenCenterから仮想マシンのコンソールにアクセスしてインストールをする。

テキストインストールモードでDHCPを指定する。固定だと上手くいかなかった。。。。
原因が分からなかったので、DHCPでやった。。。


  • 最終更新:2015-04-01 14:11:21

このWIKIを編集するにはパスワード入力が必要です

認証パスワード