Quantcast
Channel: NETWORK ENGINEER BLOG
Viewing all 266 articles
Browse latest View live

コマンドを任意の時間に実行するスクリプト

$
0
0

基本的な考え方として、ビジーウェイトによる非効率性に対処するため、スクリプト実行時間(TARGET_TIME)まで、sleep するようになっています。下記は、12:00 に SnapMirror の状態を確認する場合の例になります。

#!/usr/bin/perluse Time::Local;
use POSIX 'strftime';
use IO::Handle;
$TARGET_TIME  = "12:00";
#------------------------------if ( $#ARGV != 0) {
  print"usage : perl test.pl [SystemName]\n";
  exit;
}
$sHostname = $ARGV[0];
shift( @ARGV );
while(1) {
          $nTime  = strftime( "%Y/%m/%d %H:%M:%S" , localtime );
          $nTime2 = strftime( "%H:%M:%S %Y/%m/%d" , localtime );
          $nSec = strftime( "%S" , localtime );
          $nTime3 = strftime( "%H:%M" , localtime );
          $nDate = strftime( "%Y%m%d_%H%M%S" , localtime );
          print"$nTime  : target = $sHostname\n";
          if ($nTime3eq$TARGET_TIME) {
                $str = "sshpass -p PASSWORD ssh -l root $sHostname snapmirror status > /tmp/${nDate}_$sHostname.log";
                print"command : $str\n";
                system( $str );
                last;
          }
          $n = 60 - $nSec;
          sleep( $n );
}
#------------------------------

Multi-VRF 環境での OSPF について

$
0
0

Multi-VRF 環境での OSPF について、標準エリア上で受信した LSA Type-3 の情報を(データベース上には存在するが)ルーティングテーブル上に反映できない事象を確認しました。通常、DN Bit が付与された LSA を受信した場合は、ルーティングループを防止するため、このような事象が発生します。
しかし、今回検証した環境では、MP-BGP を使用しておらず、DN Bit は付与されていません。

f:id:FriendsNow:20140809171725p:plain:w400

DN Bit が付与された場合は、Options: の一番右が Downwardとなります。

R1#show ip ospf database summary
            OSPF Router with ID (192.168.1.101) (Process ID 1)
                Summary Net Link States (Area 1)
  LS age: 751
  Options: (No TOS-capability, DC, Upward) 
  LS Type: Summary Links(Network)
  Link State ID: 10.2.2.1 (summary Network Number)
  Advertising Router: 192.168.1.102
  LS Seq Number: 8000000C
  Checksum: 0x4908
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 1

LSA Type-1 及び Type-5 はルーティングテーブルに反映できています。

R1#show ip route vrf poc ospf | begin Gateway
Gateway of last resort is not set
      10.0.0.0/32 is subnetted, 1 subnets
O        10.2.2.2 [110/2] via 192.168.1.102, 00:08:33, GigabitEthernet2
      172.16.0.0/32 is subnetted, 1 subnets
O E2     172.16.2.1 [110/1] via 192.168.1.102, 00:08:33, GigabitEthernet2

OSPF プロセスで capability vrf-lite*1を有効にすると、Type-3 の情報も反映します。

R1(config-router)#router ospf 1 vrf poc
R1(config-router)#capability vrf-lite
R1(config-router)#end

R1#show ip route vrf poc ospf | begin Gateway
Gateway of last resort is not set
      10.0.0.0/32 is subnetted, 2 subnets
O IA     10.2.2.1 [110/2] via 192.168.1.102, 00:04:37, GigabitEthernet2
O        10.2.2.2 [110/2] via 192.168.1.102, 00:04:37, GigabitEthernet2
      172.16.0.0/32 is subnetted, 1 subnets
O E2     172.16.2.1 [110/1] via 192.168.1.102, 00:04:37, GigabitEthernet2

OSPF Command Referenceにおける capability vrf-lite の説明は以下のとおりです。
The table below describes the PE checks performed when Type-3, Type-5, and Type-7 LSAs are received.

Type-3 LSA receivedThe DN bit is checked. If the DN bit is set, the Type-3 LSA is not considered during the shortest path first (SPF) calculation.
Type-5 or -7 LSA receivedIf the Tag in the LSA is equal to the VPN-tag, the Type-5 or-7 LSA is not considered during the SPF calculation.

With the capabilityvrf-lite command, the checks can be turned off to allow correct population of the VRF routing table with routes to IP prefixes.

この説明からは、DN Bit が付与されていない LSA Type-3 は SPF 計算の対象となると読み取れます。
DN Bit が付与されていない LSA Type-3 の情報を、ルーティングテーブルに反映できない事象は、仕様なのか、不具合なのか、引き続き調査を進めたいと思います。

*1:このコマンドを実行すると、有効な Neighbor がダウンするため、注意が必要です

VMware スナップショットの注意点

$
0
0

スナップショットを削除した際、仮想マシンが数分間停止する事象があったので、メモしておきます。
出典:A snapshot removal can stop a virtual machine for long time (1002836)

スナップショット作成時の動作

スナップショットを作成すると、delta.vmdk が作成されます。
例えば、1つの仮想マシンとスナップショットのファイル構成は、下記のとおりです。

  • disk.vmdk with extent disk-flat.vmdk
  • disk-000001.vmdk with extent disk-000001-delta.vmdk

スナップショット作成後、この delta.vmdk で差分情報を収容していきます。

スナップショット削除時の動作

スナップショットを削除、または結合した場合、Consolidate Helper Snapshot と呼ばれるスナップショットが、ディスク I/O に比例して複数作成されます。

  • disk.vmdk with extent disk-flat.vmdk
  • disk-000001.vmdk with extent disk-000001-delta.vmdk
  • disk-000002.vmdk with extent disk-000002-delta.vmdk

delta.vmdk と親ディスクである flat.vmdk は整合性保全のため、Read-only となり、データは、この Consolidate Helper Snapshot へ書き込まれます。しかし、最終的には、この Consolidate Helper Snapshot も flat.vmdk へマージしなければいけないため、この間仮想マシンが停止します。この事から、スナップショットを削除する際は、十分に注意して、ディスク I/O が極力少ない状況下で、実施する事を推奨します。
また、VMware 社は、スナップショットの保持について、72時間(3日)以上、保持しない事を推奨しています。
Best practices for virtual machine snapshots in the VMware environment (1025279)
Use no single snapshot for more than 24-72 hours.

スナップショットによる副作用

データストアに、NetApp ストレージを利用している場合は、次の点にも注意が必要です。
仮想マシンのスナップショットは、512Byte で差分を管理しているため、Partial Write が発生します。
Partial Write とは、4KBbyte 以下のデータに対して書き込みが発生した際(NetApp の仕様上)直接書き込みする事はできないため、対象のブロックを一度読み出し、部分的更新を行ってから、ディスク書き込む処理の事です。このため、スナップショットが存在している場合、無駄な Read が発生していると考えられます。

セカンダリアドレスで HSRP

$
0
0

セカンダリアドレスで HSRP が可能か試してみました。環境は下記のとおりです。
ルータは、CSR1000V IOS XE Version: 03.09.02.S を使用しました。

f:id:FriendsNow:20140907173138p:plain:w500

結論から言えば、上記の環境では、セカンダリアドレスで HSRP は可能でした。
アドレス不足により、同一のブロードキャストドメインに、複数の異なるサブネットを共存させたい際等に活用できそうです。ただし、運用管理上の観点から、多用は避けた方が良いかもしれません。

Router01 はプライマリアドレスを Active、セカンダリアドレスを Standby として認識。

Router01#show standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Gi1         1    110 P Active  local           192.168.1.66    192.168.1.60
Gi1         2    90  P Standby 192.168.2.66    local           192.168.2.60

Router02 はプライマリアドレスを Standby、セカンダリアドレスを Active として認識。

Router02#show standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Gi1         1    90  P Standby 192.168.1.65    local           192.168.1.60
Gi1         2    110 P Active  local           192.168.2.65    192.168.2.

Router01 設定例

Router01#show running-config interface gigabitEthernet 1
interface GigabitEthernet1
 ip address 192.168.2.65 255.255.255.0 secondary
 ip address 192.168.1.65 255.255.255.0
 standby 1 ip 192.168.1.60
 standby 1 priority 110
 standby 1 preempt
 standby 2 ip 192.168.2.60
 standby 2 priority 90
 standby 2 preempt

Router02 設定例

Router02#show running-config interface gigabitEthernet 1
interface GigabitEthernet1
 ip address 192.168.2.66 255.255.255.0 secondary
 ip address 192.168.1.66 255.255.255.0
 standby 1 ip 192.168.1.60
 standby 1 priority 90
 standby 1 preempt
 standby 2 ip 192.168.2.60
 standby 2 priority 110
 standby 2 preempt

スナップショットを削除するスクリプト

$
0
0

セキュリティポリシーの変更(スクリプトの実行を許可)

PS C:\> Set-ExecutionPolicy RemoteSigned

対象の仮想マシンのスナップショットを削除するスクリプト例になります。
※-RemoveChildren は「すべて削除」と同義です。指定しない場合は、1つずつ削除します。

タスクスケジューラを使用する場合は、プログラム/スクリプトと引数を下記のとおり指定します。

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
-psc "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -file "C:\Scripts\test.ps1"

メモリのバルニーングについて

$
0
0
バルーンニングの概要

仮想マシンで、アイドル状態のメモリ量が多いサーバから、メモリを解放して、別の仮想マシンに割り当てる機能です。具体的には、VMware Tools をインストールした際、仮想マシンに実装されるバルーンドライバが、以下のような処理順序で機能します。

  1. ホストのメモリに余裕がある場合、VMkernel は、バルーンを発動させません。
  2. ホストのメモリに余裕がなくなってくると、VMkernel はバルーンを発動させ、未使用乃至、アイドル状態の仮想マシンメモリを優先的に選択し、メモリを負荷を発生させます。発生させた負荷分は、ホストに返却され、ホストは別の仮想マシンにこのメモリを割り当てます。
  3. バルーンが発動した仮想マシンは、最適なページをスワップアウトし、メモリの負荷に対応します。
  4. メモリの負荷が解消されると、バルーンニングは無効となり、ページをメモリにスワップインします。
resxtop を使用した状態監視

resxtop を使用して、メモリの統計上を確認する事が可能です。
resxtop を実行後、「m」を入力します。仮想マシンのみ表示するには、「V」と入力します。

10:35:05am up 1 day  9:04, 417 worlds, 1 VMs, 1 vCPUs; MEM overcommit avg: 0.00, 0.00, 0.00
PMEM  /MB:  4095   total:  1068     vmk,   732 other,   2294 free
VMKMEM/MB:  4077 managed:   244 minfree,  2794 rsvd,   1282 ursvd,  high state
PSHARE/MB:    52  shared,    43  common:     9 saving
SWAP  /MB:     0    curr,     0 rclmtgt:                 0.00 r/s,   0.00 w/s
ZIP   /MB:     0  zipped,     0   saved
MEMCTL/MB:     0    curr,     0  target,   374 max

     GID NAME               MEMSZ    GRANT    SZTGT     TCHD   TCHD_W MCTL?   MCTLSZ  MCTLTGT  MCTLMAX    SWCUR    SWTGT   SWR/s   SWW/s  LLSWR/s  LLSWW/s
  522350 vMA               600.00   586.10   610.10   186.00    78.00     Y     0.00     0.00   374.01     0.00     0.00    0.00    0.00     0.00     0.00

主なメトリックの概要は、以下のとおりです。

  • 「PMEM」:ホストの物理メモリの総容量(MB)
  • 「VMKMEM」: VMkernel の管理対象メモリ(MB)
  • 「state」: high、soft、hard、low のいずれかになります。*1
  • 「MEMCTL/MB(curr)」:バルーンにより、再利用されている物理メモリの総容量(MB)
  • 「MEMCTL/MB(target)」:バルーンドライバを使用して、再利用しようとしている物理メモリの総容量(MB)
  • 「MEMCTL/MB(max)」:バルーンドライバを使用して、再利用可能な物理メモリの最大総容量(MB)
  • 「MCTL?」:バルーンドライバが仮想マシンにインストールされているかどうか。
  • 「MCTLSZ」:バルーンドライバにより、他の仮想マシン用に保持されている物理メモリの容量(MB)
パフォーマンスモニタを使用した状態監視

チャートオプションのカウンタの選択から、「バルーン」を選択します。
f:id:FriendsNow:20141221231104p:plain

バルーンの状況をグラフで確認できます。
f:id:FriendsNow:20141221231158p:plain

*1:high 以外は、十分な未使用メモリを維持できていない状態です。

vSphere Management Assistant(vMA)について

$
0
0
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

Wireshark のフィルタリング

$
0
0

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

送信元 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 Web Client でゲストへ接続できない問題について

$
0
0

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

sdw_cl_vol について

$
0
0

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}

busy,LUNs 状態の Snapshot について

$
0
0

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

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

$
0
0

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

vSphere Replication について

$
0
0

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

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:リカバリ時に何時時分の状態に戻せることを保障する目標

VMware Workstation で vFRC を試す

$
0
0
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

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

VMware PowerCLI サンプルスクリプト

$
0
0

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

C:\scripts\vms.csv

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

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

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

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

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


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

$
0
0

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

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

$
0
0

Flash Pool とは

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

f:id:FriendsNow:20150311205706p:plain
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

HA の詳細構成オプションについて

$
0
0

HA 構成のクラスタに所属する各ホストで、以下のようなエラーが表示される場合があります。
その際、一部のエラーについては、HA の詳細オプションで非表示にする事ができます。
HA の詳細オプションは、クラスタを右クリック→「設定の編集」→「vSphere HA」→「詳細オプション」から設定します。設定後、各ホストを右クリック→「vSphere HA 用に再構成」を実行すると、エラーが非表示になります。

  • エラー内容
    • このホストには現在管理ネットワークの冗長性がありません
  • 詳細オプション値(非表示)
    • das.ignoreRedundantNetWarning: true

f:id:FriendsNow:20150323213717p:plain

  • エラー内容
    • このホストの vSPhere HA ハートビートデータストア数は0で、必要数の2未満です
  • 詳細オプション値(非表示)
    • das.ignoreinsufficienthbdatastore: tue

f:id:FriendsNow:20150323213723p:plain

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

$
0
0

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

標準スイッチの作成

「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

STP PVID/Type 不一致による予期せぬポートブロックについて

$
0
0

Cisco 社製のスイッチで予期せぬポートブロックが発生した際、下記のエラーが出力されている場合は、STP PVID/Type の不一致が考えられます。

%SPANTREE-7-RECV_1Q_NON_TRUNK: Received 802.1Q BPDU on non trunk GigabitEthernet0/1 VLAN100.
%SPANTREE-7-BLOCK_PORT_TYPE: Blocking GigabitEthernet0/1 on VLAN100. Inconsistent port type.

STP の PVID/Type 不一致の要因としては、アクセスポートに設定したインターフェースで「タグ付き BPDU」を受信している可能性が考えられます。また、「タグ付き BPDU」を受信する原因としては、対向のスイッチが「タグ付き BPDU」を正確に認識できず、アクセスポートに転送するといった可能性が考えられます。
この問題の暫定対処として、「BPDU フィルタの有効化」があります。*1
BPDU フィルタは、スイッチ全体で設定する方法と、インターフェース単位で設定する方法があります。

  • スイッチ全体で設定
Switch(config)#spanning-tree portfast bpdufilter default
  • インターフェース単位で設定
Switch(config)#interface GigabitEthernet0/1
Switch(config-if)#spanning-tree bpdufilter enable

上記設定を行うと、ポートブロックが解消され、下記のメッセージが出力されます。

%SPANTREE-SP-2-UNBLOCK_CONSIST_PORT: Unblocking GigabitEthernet0/1 on VLAN100. Port consistency restored.

*1:STP 無効化と同義なので、設定には十分な注意が必要です。

Viewing all 266 articles
Browse latest View live




Latest Images