NETWORK ENGINEER BLOG

Tips and Reviews for Engineers

ESXi の証明書入れ替え

こちらを参考にさせて頂きました。

ESXi の証明書は以下のフォルダに配置されています。

~ # cd /etc/vmware/ssl
/etc/vmware/ssl # ls -l
total 8
-rw-r--r--    1 root     root          1428 Jan 13 06:55 rui.crt
-r--------    1 root     root          1708 Jan 13 06:55 rui.key

既存証明書のファイル名を変更します。

/etc/vmware/ssl # mv rui.crt rui.crt.old
/etc/vmware/ssl # mv rui.key rui.key.old
/etc/vmware/ssl # ls -l
total 8
-rw-r--r--    1 root     root          1428 Jan 13 06:55 rui.crt.old
-r--------    1 root     root          1708 Jan 13 06:55 rui.key.old

新しい証明書を同フォルダに配置します。

/etc/vmware/ssl # ls -l
total 16
-rw-r--r--    1 root     root          1428 Jan 13 06:55 rui.crt
-rw-r--r--    1 root     root          1428 Jan 13 06:55 rui.crt.old
-r--------    1 root     root          1708 Jan 13 06:55 rui.key
-r--------    1 root     root          1708 Jan 13 06:55 rui.key.old

Manegement Agents を再起動します。

/etc/vmware/ssl # /etc/init.d/hostd restart
/etc/vmware/ssl # /etc/init.d/vpxa restart

証明書が更新されると、vCenterからホストが切断されますので、再接続が必要です。

CentOS で FTP サーバ構築

検証用に FTP サーバが必要になったので、CentOS で構築した際のメモ。
こちらのサイトがとても分かりやすかったので、参考にさせて頂きました。

vsftpd インストール

[root@hostname ~]# yum -y install vsftpd 

vsftpd.conf 設定

[root@hostname ~]# vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO			 <- 匿名ログイン禁止
ascii_upload_enable=YES			 <- コメントアウト:アスキーモードでの転送を許可
ascii_download_enable=YES		 <- コメントアウト:アスキーモードでの転送を許可
chroot_local_user=YES			 <- コメントアウト:chroot有効
chroot_list_enable=YES 			 <- コメントアウト:chroot有効
chroot_list_file=/etc/vsftpd/chroot_list <- コメントアウト:chroot リストファイル指定
ls_recurse_enable=YES			 <- コメントアウト:ディレクトリごと一括での転送有効
local_root=public_html			 <- 最終行へ追記:ルートディレクトリ指定
use_localtime=YES			 <- 最終行へ追記:ローカルタイムを使う

chroot_list 設定

[root@hostname ~]# vi /etc/vsftpd/chroot_list
ftpuser					 <- chroot を適用しないユーザーを追加

ユーザアカウント作成

[root@hostname ~]# useradd ftpuser
[root@hostname ~]# passwd ftpuser

ルートディレクトリ作成

[root@hostname ~]# mkdir /home/ftpuser/public_html

SELinux 無効化

[root@hostname ~]# setenforce 0
[root@hostname ~]# getenforce
※Enforcing:SELinux が有効の場合、クライアントからの接続時に下記エラーが出力される場合があります。
500 OOPS: cannot change directory:/home/user1
500 OOPS: priv_sock_get_cmd
接続がリモート ホストによって閉じられました。

vsftpd 再起動

[root@hostname ~]# /etc/rc.d/init.d/vsftpd start 

vsftpd 起動設定

[root@hostname ~]# chkconfig vsftpd on

以上

VMware のマルチパス機構について

VMware のマルチパスについて

VMware のデフォルトのマルチパスプラグインは、NMP(Native Multi-Pathing Plugin)と呼ばれる汎用のマルチパスモジュールです。NMP は SATP(Storage Array Type Plugin)と PSP(Path Selection Plugin)で構成されます。

SATP
  • 物理パスに関連付けられ、パスのフェイルオーバを制御します。
PSP
  • どの物理パスを使用して I/O 要求を送信するかを処理します。

通常、VMware 社の互換性ガイドに記載のある PSP が自動で選択されますが、任意の PSP が適用されるようデフォルトを変更する事が可能です。

マルチパスの確認方法

SATP のリストは下記のコマンドで表示します。

~ # esxcli storage nmp satp list
Name                 Default PSP    Description
-------------------  -------------  ------------------------------------------
VMW_SATP_MSA         VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_ALUA        VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_DEFAULT_AP  VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_SVC         VMW_PSP_FIXED  Placeholder (plugin not loaded)
VMW_SATP_EQL         VMW_PSP_FIXED  Placeholder (plugin not loaded)
VMW_SATP_INV         VMW_PSP_FIXED  Placeholder (plugin not loaded)
VMW_SATP_EVA         VMW_PSP_FIXED  Placeholder (plugin not loaded)
VMW_SATP_ALUA_CX     VMW_PSP_RR     Placeholder (plugin not loaded)
VMW_SATP_SYMM        VMW_PSP_RR     Placeholder (plugin not loaded)
VMW_SATP_CX          VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_LSI         VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_DEFAULT_AA  VMW_PSP_FIXED  Supports non-specific active/active arrays
VMW_SATP_LOCAL       VMW_PSP_FIXED  Supports direct attached devices

PSP のリストは下記のコマンドで表示します。

~ # esxcli storage nmp psp list
Name           Description
-------------  ---------------------------------
VMW_PSP_MRU    Most Recently Used Path Selection
VMW_PSP_RR     Round Robin Path Selection
VMW_PSP_FIXED  Fixed Path Selection

デフォルトの PSP を Round Robin に変更したい場合は下記を実行します。

~ # esxcli storage nmp satp set -s VMW_SATP_DEFAULT_AA -P VMW_PSP_RR
Default PSP for VMW_SATP_DEFAULT_AA is now VMW_PSP_RR

~ # esxcli storage nmp satp list
Name                 Default PSP    Description
-------------------  -------------  ------------------------------------------
VMW_SATP_MSA         VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_ALUA        VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_DEFAULT_AP  VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_SVC         VMW_PSP_FIXED  Placeholder (plugin not loaded)
VMW_SATP_EQL         VMW_PSP_FIXED  Placeholder (plugin not loaded)
VMW_SATP_INV         VMW_PSP_FIXED  Placeholder (plugin not loaded)
VMW_SATP_EVA         VMW_PSP_FIXED  Placeholder (plugin not loaded)
VMW_SATP_ALUA_CX     VMW_PSP_RR     Placeholder (plugin not loaded)
VMW_SATP_SYMM        VMW_PSP_RR     Placeholder (plugin not loaded)
VMW_SATP_CX          VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_LSI         VMW_PSP_MRU    Placeholder (plugin not loaded)
VMW_SATP_DEFAULT_AA  VMW_PSP_RR     Supports non-specific active/active arrays
VMW_SATP_LOCAL       VMW_PSP_FIXED  Supports direct attached devices

なお、マルチパスのルールを確認するには下記を実行します。

~ # esxcli storage nmp satp rule list
Name                 Device  Vendor   Model             Driver  Transport  Options                     Rule Group  Claim Options                        Default PSP  PSP Options  Description
-------------------  ------  -------  ----------------  ------  ---------  --------------------------  ----------  -----------------------------------  -----------  -----------  --------------------------------------------------------------------------
VMW_SATP_MSA                          MSA1000 VOLUME                                                   system                                                                     MSA 1000/1500 [Legacy product, Not supported in this release]
VMW_SATP_ALUA                NETAPP                                        reset_on_attempted_reserve  system      tpgs_on                              VMW_PSP_RR                NetApp arrays with ALUA support
VMW_SATP_ALUA                IBM      2810XIV                                                          system      tpgs_on                              VMW_PSP_RR                IBM 2810XIV arrays with ALUA support
VMW_SATP_ALUA                IBM      2107900                              reset_on_attempted_reserve  system                                           VMW_PSP_RR     
VMW_SATP_ALUA                IBM      2145                                                             system                                           VMW_PSP_RR
<...snip...>

マルチパスのルールを追加する場合は下記を実行します。

esxcli storage nmp satp rule add -V "Vendor" -M "Model" -e "Description"

以上

vSwitch でミラーリングを設定する

標準スイッチでは、分散スイッチと異なり、ポートをミラーリング機能をサポートしていませんが、任意の仮想マシンにパケットをミラーする事が可能です。

標準スイッチの作成

「Networking」タブで「Virtual switches」を選択し「Add host Networking」をクリックします。
f:id:FriendsNow:20150131201523p:plain

「Virtual Machine Port Group for a Standard Switch」を選択し「Next」をクリックします。
f:id:FriendsNow:20150131201547p:plain

「New Standard Switch」を選択し「Next」をクリックします。
f:id:FriendsNow:20150131201604p:plain

試験のため NIC はアサインせず、「Next」をクリックします。
f:id:FriendsNow:20150131201611p:plain

VLAN ID を「ALL(4095)」に指定し「Next」をクリックします。
f:id:FriendsNow:20150131201619p:plain

内容を確認し「Finish」をクリックします。
f:id:FriendsNow:20150131201626p:plain

標準スイッチが作成されている事を確認します。
f:id:FriendsNow:20150131201648p:plain

仮想マシンへのポートグループ設定

現在、仮想マシンは分散スイッチのポートグループをアサインしているので、作成したスイッチへ移行します。

「Networking」タブで「DSwitch」を右クリックし「Migrate VM to Another Network」をクリックします。
f:id:FriendsNow:20150131201654p:plain

Source Network の「Specific Network」で「Browse」をクリックします。
f:id:FriendsNow:20150131201700p:plain

移行元(分散スイッチ)のポートグループを選択して「OK」をクリックします。
f:id:FriendsNow:20150131201706p:plain

Destination Network の「Specific Network」で「Browse」をクリックします。
f:id:FriendsNow:20150131201714p:plain

移行先(標準スイッチ)のポートグループを選択して「OK」をクリックします。
f:id:FriendsNow:20150131201725p:plain

内容を確認し「Next」をクリックします。
f:id:FriendsNow:20150131201733p:plain

移行対象の仮想マシンを選択して「Next」をクリックします。
f:id:FriendsNow:20150131201741p:plain

内容を確認し「Finish」をクリックします。
f:id:FriendsNow:20150131201750p:plain

対象の仮想マシンが標準スイッチに移行している事を確認します。
f:id:FriendsNow:20150131201759p:plain

ミラーリングの設定

テストのため、MyVM1 から MyVM3へ Ping し、MyVM2 で tcpdump を実行します。
現時点では、MyVM2 にパケットが転送されていません。
f:id:FriendsNow:20150131201805p:plain

作成した仮想スイッチを選択し「Edit Settings」をクリックします。
f:id:FriendsNow:20150131201818p:plain

「Security」の Promiscuous mode を「Accept」に変更し「OK」をクリックします。
f:id:FriendsNow:20150131201828p:plain

MyVM2 にパケットが転送され、確認できるようになります。
f:id:FriendsNow:20150131202112p:plain

Ontap シミュレーターで Flash Pool を試す

Flash Pool とは

HDD と SSD が混在したアグリゲートを構成し、使用頻度の高いデータを SSD のキャッシュへ集めることで、HDD へのアクセスを低減する機能になります。データを移動させるわけではなく、アクセス頻度の高いデータを ONTAP が自動で判別し、キャッシュされる事から、運用稼動は発生しません。
下記は、ユーザ数の増加に伴うスループットの傾向です。

f:id:FriendsNow:20150311205706p:plain
出典:Tech OnTap

HDD のみで構成した場合、100ユーザの時点で HDD がボトルネックになり、スループットが頭打ちになっています。これに対して、Flash Pool を使用した場合は、ユーザの増加に伴い、スループットが向上しています。

Flash Pool の設定方法

ONTAP シミュレータで SSD Disk を擬似的に作成し、Flash Pool をを設定する際の手順になります。

SSD Disk の作成

Unlock the Diag user(7-Mode)

> priv set diag
*> useradmin diaguser unlock
*> useradmin diaguser password

Unlock the Diag user(Clustered Mode)

> set diag
*> security login unlock -username diag -vserver cluster1
*> security login password -username diag -vserver cluster1

Enter system shell(7-Mode)

*> systemshell
login: diag
Password:
%

Enter system shell(Clustered Mode)

*> systemshell -node cluster1-01
login: diag
Password:
%

Create SSD Disks(7-Mode/Clustered Mode)

% setenv PATH /sim/bin:$PATH
% cd /sim/dev
% sudo vsim_makedisks -t 35 -a 2 -n 14
% exit

Vefify the Disks(7-Mode)

*> disk show -n
*> sysconfig -r

Vefify the Disks(Clustered Mode)

*> disk show -container-type unassigned
*> system node run -node cluster1-01 sysconfig -r

Assign the Disks(7-Mode)

> disk assign  v6.16

Assign the Disks(Clustered Mode)

> disk assign -disk v6.16 -owner cluster1-01
Flash Pool の有効化

Enable the Flash Pool(7-Mode)

> aggr options aggr1 hybrid_enabled on
> aggr add aggr1 -T SSD 14

Enable the Flash Pool(Clustered Mode)

> storage aggregate modify -aggregate aggr1 -hybrid-enabled true
> aggregate add-disks -aggregate aggr1 -disktype SSD -diskcount 14

Use the Flash Pool(7-Mode)

> vol create myvol aggr1 1g

Use the Flash Pool(Clustered Mode)

> volume create -vserver svm-01 -aggregate aggr1 -volume myvol -size 1g

以上

分散スイッチで Netflow を有効化する

Netflow は Cisco 社が開発した、ネットワークのトラフィックを収集・分析するための技術です。VMware 社の分散スイッチでは、NetFlow をサポートしており、ポートグループに流れるトラフィックを、コレクターに出力する事が可能です。

分散スイッチの設定

対象の分散スイッチを右クリックし「Manage Distributed Port Groups」をクリックします。
f:id:FriendsNow:20150202131608p:plain

「Monitoring」を選択し「Next」をクリックします。
f:id:FriendsNow:20150202131618p:plain

対象のポートグループを選択し「Next」をクリックします。
f:id:FriendsNow:20150202131625p:plain

Netflow を「Enabled」に設定し「Next」をクリックします。
f:id:FriendsNow:20150202131633p:plain

内容を確認し「Finish」をクリックします。
f:id:FriendsNow:20150202131642p:plain

分散スイッチを選択し「Manage」タブの NetFlow で、コレクターの設定等を行います。
f:id:FriendsNow:20150202131649p:plain

Netflow コレクタ(PRTG)の設定

「Sensors」タブから「Add Sensor」をクリックします。
f:id:FriendsNow:20150202131658p:plain

「Create a new Device」を選択し「Continue」をクリックします。
f:id:FriendsNow:20150202131705p:plain

Group を選択し「Continue」をクリックします。
f:id:FriendsNow:20150202131711p:plain

「Device Name」「IP Address」を設定し「Continue」をクリックします。
f:id:FriendsNow:20150202131723p:plain

「UDP port」「Active Flow Timeout」を設定し「Continue」をクリックします。
f:id:FriendsNow:20150202131734p:plain

ポートグループ間のトラフィック状況をモニターする事が可能となります。
f:id:FriendsNow:20150202131746p:plain

VMware PowerCLI サンプルスクリプト

CSV ファイルを読み込んで、仮想マシンを制御するスクリプトの例です。
本例では、仮想マシン名を記述した CSV ファイル(vms.csv)を以下のパスに配置しています。

C:\scripts\vms.csv

CSV ファイルの内容は、以下のとおりです。
f:id:FriendsNow:20150219215344p:plain

仮想マシンを起動するスクリプト

$vCenterIP = "192.168.1.10"
$User = "Administrator"
$Password = "Password"
$VMs = Import-CSV C:\scripts\vms.csv
 
#Import the PowerCLI module
Add-PSSnapin VMware.VimAutomation.Core
 
#Connect to the server
$vi = Connect-VIServer -Server $vCenterIP -User $User -Password $Password

#Power on the VMs
foreach ($vm in $VMs){
      Get-VM $vm.VMName | where{$_.PowerState -eq "PoweredOff"} | Start-VM -Runasync -Confirm:$false | Out-Null
}

#Disconnect to the server
Disconnect-VIServer -Server $vCenterIP -Confirm:$False 

仮想マシンを停止するスクリプト

$vCenterIP = "192.168.1.10"
$User = "Administrator"
$Password = "Password"
$VMs = Import-CSV C:\scripts\vms.csv
 
#Import the PowerCLI module
Add-PSSnapin VMware.VimAutomation.Core
 
#Connect to the server
$vi = Connect-VIServer -Server $vCenterIP -User $User -Password $Password

#Power off the VMs
foreach ($vm in $VMs){
      Get-VM $vm.VMName | where{$_.PowerState -eq "PoweredOn"} | Shutdown-VMguest -Confirm:$false | Out-Null
}

#Disconnect to the server
Disconnect-VIServer -Server $vCenterIP -Confirm:$False 

仮想マシンのスナップショットを取得するスクリプト

$vCenterIP = "192.168.1.10"
$User = "Administrator"
$Password = "Password"
$Date = Get-Date -format yyyyMMddHHmm
$VMs = Import-CSV C:\scripts\vms.csv

#Import the PowerCLI module
Add-PSSnapin VMware.VimAutomation.Core
 
#Connect to the server
$vi = Connect-VIServer -Server $vCenterIP -User $User -

#Create the Snapshot
foreach ($vm in $VMs){
	  New-Snapshot -Name $Date -VM $vm.VMName -Descript
}

#Disconnect to the server
Disconnect-VIServer -Server $vCenterIP -Confirm:$False 

仮想マシンのスナップショットを削除するスクリプト

$vCenterIP = "192.168.1.10"
$User = "Administrator"
$Password = "Password"
$Date = Get-Date -format yyyyMMddHHmm
$VMs = Import-CSV C:\scripts\vms.csv

#Import the PowerCLI module
Add-PSSnapin VMware.VimAutomation.Core
 
#Connect to the server
$vi = Connect-VIServer -Server $vCenterIP -User $User -Password $Password

#Remove the Snapshot
foreach ($vm in $VMs){
      Get-Snapshot -VM $vm.VMName | Remove-Snapshot -RemoveChildren -Confirm:$False
}

#Disconnect to the server
Disconnect-VIServer -Server $vCenterIP -Confirm:$False 

参考書籍

以上

VMware Workstation で vFRC を試す

vFRC とは

仮想ディスクの Read Cache として、ローカルサーバの SSD を利用する仕組みを提供します。この機能により、仮想ディスクの読み込み速度が向上し、ストレージの負荷を軽減することが可能です。
詳細については、こちらをご参照ください。

事前準備

VMware Workstation では、SSD デバイスをシミュレートすることが可能です。対応する仮想マシンの vmx ファイルを編集し、SSD をシミュレートしたい SCSI デバイスを対象に下記を追記します。

scsiX:Y.virtualSSD = 1

対象の SCSI デバイスが SSD として、認識されます。

ESXi 側の vFRC の設定

Manage > Settings > Virtual Flash Resource Management > Add Capacity をクリックします。
f:id:FriendsNow:20150210152805p:plain

有効な SSD デバイスが表示されるので、選択し「OK」をクリックします。
f:id:FriendsNow:20150210152922p:plain

Device Backing のリストに SSD デバイスが追加されます。
f:id:FriendsNow:20150210153134p:plain

ESXi ホストの vmkernel swap 領域として使用する場合は、下記の手順で行います。
Manage > Settings > Virtual Flash Host Swap Cache Configuration > Edit をクリックします。
f:id:FriendsNow:20150210155604p:plain

キャッシュ容量を指定し「OK」をクリックします。
f:id:FriendsNow:20150210155641p:plain

ホストキャッシュが設定されていることを確認します。
f:id:FriendsNow:20150210155805p:plain

仮想マシン側の vFRC の設定

対象の仮想マシンの編集から、仮想ディスクを展開し vFRC の「Advanced」をクリックします。
f:id:FriendsNow:20150210153401p:plain

キャッシュ容量とブロックサイズを指定し「OK」をクリックします。
f:id:FriendsNow:20150210153505p:plain

「OK」をクリックします。
f:id:FriendsNow:20150210153607p:plain

なお、この手順は、仮想マシンがパワーオン状態でも実施可能です。

vSphere Replication について

任意の仮想マシンについて、ハイパーバイザレベルでレプリケーションを実施する機能になります。
仮想マシンのコピーをハイパーバイザレベルで実施するため、データストアに依存しない点が特徴になります。

f:id:FriendsNow:20150203191144p:plain

vSphere Replication の要件
  • vCenter5.1 及び ESXi5.0以上
  • vSphere Web Client*1
  • vSphere Replication アプライアンス*2
初期設定

vSphere Replication をインストール後、必要に応じて基本設定を行います。
仮想アプライアンスへの下記のアドレス・ポートでアクセス可能です。
https://IP_of_your_VR_appliance:5480
f:id:FriendsNow:20150208235341p:plain

仮想アプライアンスを起動後、vCenter に VR のアイコンが追加されます。
f:id:FriendsNow:20150208235433p:plain

Replication の構成例

対象の仮想マシンを選択し、右クリックから「Configure Replication」をクリックします。
f:id:FriendsNow:20150208235546p:plain

vSphere Replication Server を選択し「Next」をクリックします。
f:id:FriendsNow:20150208235607p:plain

Replication 先のデータストアを選択し「Next」をクリックします。
f:id:FriendsNow:20150208235615p:plain

HDD をコピーする場合は「Enable disk replication」を選択し「Next」をクリックします。
f:id:FriendsNow:20150208235630p:plain

「Next」をクリックします。
f:id:FriendsNow:20150208235638p:plain

RPO(Recovery Point Objective)を設定し「Next」をクリックします。*3
f:id:FriendsNow:20150208235650p:plain

内容を確認し「Finish」をクリックします。
f:id:FriendsNow:20150208235659p:plain

Monitor > vSphere Replication > Outgoing Replication から、状態を確認できます。
f:id:FriendsNow:20150208235714p:plain

仮想マシンのリカバリ

対象の仮想マシンを選択し、右クリックから「Recover」をクリックします。
f:id:FriendsNow:20150208235726p:plain

Recovery options を選択し「Next」をクリックします。
f:id:FriendsNow:20150209000005p:plain

仮想マシンの配置先 Folder を選択し「Next」をクリックします。
f:id:FriendsNow:20150209000015p:plain

仮想マシンの配置先 Cluster を選択し「Next」をクリックします。
f:id:FriendsNow:20150209000307p:plain

内容を確認し「Finish」をクリックします。
f:id:FriendsNow:20150209000316p:plain

*1:vSphere Client ではサポートしていません。

*2:レプリケーションの構成情報を管理するサーバ

*3:リカバリ時に何時時分の状態に戻せることを保障する目標

分散スイッチの作成とマイグレート

vSphere Web Client を使用した分散スイッチの作成と、標準スイッチからの移行を試してみました。

分散スイッチの作成

「Networking」タブで「Datacenter」を右クリックし「New Distributed Switch」をクリックします。
f:id:FriendsNow:20150131203248p:plain

「Name」を設定し「Next」をクリックします。
f:id:FriendsNow:20150131203256p:plain

「Version」を指定し「Next」をクリックします。
f:id:FriendsNow:20150131203307p:plain

「Port group name」等を設定し「Next」をクリックします。
f:id:FriendsNow:20150131203317p:plain

内容を確認し「Finish」をクリックします。
f:id:FriendsNow:20150131203325p:plain

分散スイッチへのホスト登録

「Networking」タブで「DSwitch」を右クリックし「Add and Manage Hosts」をクリックします。
f:id:FriendsNow:20150131203400p:plain

「Add hosts」を指定し「Next」をクリックします。
f:id:FriendsNow:20150131203410p:plain

「New hosts」をクリックします。
f:id:FriendsNow:20150131203419p:plain

「Host」を選択し「OK」をクリックします。
f:id:FriendsNow:20150131203427p:plain

内容を確認し「Next」をクリックします。
f:id:FriendsNow:20150131203435p:plain

「Next」をクリックします。
f:id:FriendsNow:20150131203442p:plain

分散スイッチに追加する仮想 NIC を選択し「Assign uplink」をクリックします。
f:id:FriendsNow:20150131203451p:plain

仮想 NIC を紐づける Uplink を選択し「OK」をクリックします。
f:id:FriendsNow:20150131203503p:plain

内容を確認し「Next」をクリックします。
f:id:FriendsNow:20150131203510p:plain

既存の vmkernel は移行対象外なので「Next」をクリックします。
f:id:FriendsNow:20150131203522p:plain

「Next」をクリックします。
f:id:FriendsNow:20150131203532p:plain

内容を確認し「Finish」をクリックします。
f:id:FriendsNow:20150131203544p:plain

分散スイッチにホストが追加されている事を確認します。
f:id:FriendsNow:20150131203552p:plain

標準スイッチから分散スイッチへの移行

「Networking」タブで「DSwitch」を右クリックし「Migrate VM to Another Network」をクリックします。
f:id:FriendsNow:20150131203642p:plain

Source Network の「Specific Network」で「Browse」をクリックします。
f:id:FriendsNow:20150131203651p:plain

移行元(標準スイッチ)のポートグループを選択して「OK」をクリックします。
f:id:FriendsNow:20150131203659p:plain

Destination Network の「Specific Network」で「Browse」をクリックします。
f:id:FriendsNow:20150131203707p:plain

移行先(分散スイッチ)のポートグループを選択して「OK」をクリックします。
f:id:FriendsNow:20150131203716p:plain

内容を確認し「Next」をクリックします。
f:id:FriendsNow:20150131203725p:plain

移行対象の仮想マシンを選択して「Next」をクリックします。
f:id:FriendsNow:20150131203738p:plain

内容を確認し「Finish」をクリックします。
f:id:FriendsNow:20150131203750p:plain

対象の仮想マシンが分散スイッチに移行している事を確認します。
f:id:FriendsNow:20150131203758p:plain

busy,LUNs 状態の Snapshot について

SnapManager for Exchange (SME) 等のベリファイ処理失敗時に、残存する Snapshot になります。
以下の手順で削除する事が可能です。

snap list コマンドで busy 状態の Snapshot を確認します。

> snap list testvol
Volume testvol
working...

  %/used       %/total  date          name
----------  ----------  ------------  --------
<...snip...>
 56% (12%)   26% ( 3%)  Dec 18 05:01  exchsnap__exchange_02-23-2009_05.00.40 (busy,LUNs)

Snapmirror の送信元/送信先で Clone LUN が存在する事を確認します。

> lun show
<...snip...>
/vol/testvol/{3fd1acat-346c-216d-b6e4-bdf90a52801f}.rws

Snapmirror 送信先で snapmirror break を実行します。

> snapmirror break testvol

Snapmirror 送信先で lun offline/lun destroy を実行します。

> lun offline /vol/testvol/{3fd1acat-346c-216d-b6e4-bdf90a52801f}.rws
> lun destroy /vol/testvol/{3fd1acat-346c-216d-b6e4-bdf90a52801f}.rws

SnapDrive にて、Clone LUN をマウントしている場合は、Disconnect Disk を実行します。

Snapmirror 送信元で不要な Snapshot を削除します。

> snap delete testvol exchsnap__exchange_02-23-2009_05.00.40

Snapmirror resync を実行します。

> snapmirror resync -S [Sorce]:testvol testvol

以上

sdw_cl_vol について

sdw_cl_vol について

SnapManager for Exchange (SME) 等のベリファイ時に、ミラー先で生成されるボリュームです。
ベリファイ成功時は自動で削除されますが、失敗時は残留する場合があります。
これが残留していると、対象の Snapshot が busy 状態となり、次回のベリファイも失敗する可能性があります。

ボリューム名は、sdw_cl_[volname]_0 で生成されます。

> df -h
Filesystem               total       used      avail capacity  Mounted on
/vol/sdw_cl_testvol_0/      100GB       50GB      50GB      50%  /vol/sdw_cl_testvol_0/
/vol/sdw_cl_testvol_0/.snapshot        0KB    1000KB        0KB     ---%  /vol/sdw_cl_testvol_0/.snapshot

対象ボリュームの Snapshot 状況を確認すると、busy 状態の Snapshot が存在します。

> snap list testvol
Volume testvol
working...

  %/used       %/total  date          name
----------  ----------  ------------  --------
  0% ( 0%)    0% ( 0%)  Jan 16 06:12  netapp(0151729559)_testvol.1747
  0% ( 0%)    0% ( 0%)  Jan 16 06:12  @snapmir@{93F9293E-17BB-4AF5-91D6-FBEFBDCFCCFE}
  0% ( 0%)    0% ( 0%)  Jan 16 06:01  exchsnap__exchange_01-01-2015_06.00.46 (busy,snapmirror,vclone)

以下のコマンドで、sdw_cl_vol を削除します。

> vol offline sdw_cl_testvol_0
> vol destroy sdw_cl_testvol_0

対象ボリュームの Snapshot 状況を確認すると、busy 状態の Snapshot が削除されています。

> snap list testvol
Volume testvol
working...

  %/used       %/total  date          name
----------  ----------  ------------  --------
  0% ( 0%)    0% ( 0%)  Jan 16 06:12  netapp(0151729559)_testvol.1747
  0% ( 0%)    0% ( 0%)  Jan 16 06:12  @snapmir@{93F9293E-17BB-4AF5-91D6-FBEFBDCFCCFE}

以上

vSphere Web Client でゲストへ接続できない問題について

vSphere Web Client で仮想マシンのコンソールを開く際、下記のように「サーバ名を解決できませんでした」というエラーが表示される場合があります。
f:id:FriendsNow:20150109162916p:plain

考えられる原因の1つとして、クライアントから vCenter 及び、ESXi サーバの名前解決ができていない可能性があります。この場合、DNS を使用するか、下記のように hosts に登録する事で収束します。

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
	192.168.1.10    vcenter55.example.com
	192.168.1.11	esxi01.example.com
	192.168.1.12	esxi02.example.com

Wireshark のフィルタリング

良く使うフィルタリング設定のメモ

送信元 IP アドレスが「192.168.1.1」のパケットのみを表示

ip.src == 192.168.1.1

送信先 IP アドレスが「192.168.2.1」のパケットのみを表示

ip.dst == 192.168.1.1

送信元 IP アドレスが「192.168.1.1」かつ、ポートが「80」のパケットのみを表示

ip.src == 192.168.1.1 and tcp.port == 80

TCP の SYN フラグが設定されたパケットを表示

tcp.flags.syn==1

TCP の ACK フラグが設定されたパケットを表示

tcp.flags.ack==1

TCP の SYN か ACK フラグが設定されたパケットを表示

tcp.flags.syn==1 or tcp.flags.ack==1

HTTP のステータスコードが400以上のパケットを表示

http.response.code >= 400

vSphere Management Assistant(vMA)について

vMAとは

vSphere Command Line Interface(vCLI)等のコンポーネントを含む無償の仮想アプライアンスです。
こちらからダウンロード可能です。

vMA の使い方(例)

ドメインへの参加

> sudo domainjoin-cli join example.com Administrator

vMA ドメイン参加状況確認

> sudo domainjoin-cli query

VMA をドメインから削除

> sudo domainjoin-cli leave

ファストパスの設定

> vifp addserver esxi01.example.com --authpolicy fpauth --username root

ファストパスの確認

> vifp listservers

ターゲットへのアクセス

> vifptarget -s esxi01.example.com

ホストの日時を確認

[esxi01.example.com]> esxcli hardware clock get
2014-12-22T11:23:29Z

ホストの CPU を確認

[esxi01.example.com]> esxcli hardware cpu list
CPU:0
   Id: 0
   Package Id: 0
<...snip...>

ホストのメモリを確認

[esxi01.example.com]> esxcli hardware memory get
   Physical Memory: 4294430720 Bytes
   Reliable Memory: 0 Bytes
   NUMA Node Count: 1

ホスト上の仮想マシンを確認

[esxi01.example.com]> vmware-cmd -l
/vmfs/volumes/36b7b309-58b356ee/vMA/vMA.vmx
/vmfs/volumes/36b7b309-58b356ee/MyVM2_1/MyVM2.vmx
/vmfs/volumes/36b7b309-58b356ee/MyVM1/MyVM1.vmx

仮想マシンのスナップショット確認

[esxi01.example.com]> vmware-cmd /vmfs/volumes/36b7b309-58b356ee/vMA/vMA.vmx hassnapshot
hassnapshot () = 0

resxtop の実行

[esxi01.example.com]> resxtop
11:30:43am up 1 day  4:39, 433 worlds, 3 VMs, 3 vCPUs; CPU load average: 0.59, 0.57, 0.60
PCPU USED(%): 0.0 0.0 AVG: 0.0
PCPU UTIL(%): 0.0 0.0 AVG: 0.0

      ID      GID NAME             NWLD   %USED    %RUN    %SYS   %WAIT %VMWAIT    %RDY   %IDLE  %OVRLP   %CSTP  %MLMTD  %SWPWT
       1        1 idle                2    0.00    0.00    0.00    0.00       -    0.00    0.00    0.00    0.00    0.00    0.00
       2        2 system             63    0.00    0.00    0.00    0.00       -    0.00    0.00    0.00    0.00    0.00    0.00
       8        8 helper            134    0.00    0.00    0.00    0.00       -    0.00    0.00    0.00    0.00    0.00    0.00
       9        9 drivers            14    0.00    0.00    0.00    0.00       -    0.00    0.00    0.00    0.00    0.00    0.00
      10       10 ft                  5    0.00    0.00    0.00    0.00       -    0.00    0.00    0.00    0.00    0.00    0.00
      11       11 vmotion             1    0.00    0.00    0.00    0.00       -    0.00    0.00    0.00    0.00    0.00    0.00
    8612     8612 MyVM2               7    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00
    8660     8660 MyVM1               7    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00
  531100   531100 vMA                 7    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00