NETWORK ENGINEER BLOG

Tips and Reviews for Engineers

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

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

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

PS C:\> Set-ExecutionPolicy RemoteSigned

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

$vCenterIP = "192.168.1.10"
$User = "Administrator"
$Password = "Password"
$VM = "POCVM001"

#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
Get-Snapshot -VM $VM | Remove-Snapshot -RemoveChildren -Confirm:$False

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

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

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

参考書籍

以上

セカンダリアドレスで HSRP

セカンダリアドレスで 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

以上

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

VMware のスナップショットとは

スナップショットには、スナップショット作成時の仮想マシンの状態とデータが保存されます。仮想マシンのスナップショットを作成すると、特定の状態の仮想マシンのイメージがコピーおよび保存されます。スナップショットは、繰り返し同じ状態の仮想マシンに戻る必要があるが、複数の仮想マシンを作成したくないという場合に便利です。
…(中略)…
出典:VMware, Inc

スナップショットに含まれる情報
  • 仮想マシンの設定:ディスクを含む、仮想マシン ディレクトリ
  • 電源状態:パワーオン状態、パワーオフ状態、またはサスペンド状態
  • ディスク状態:仮想ディスクの状態。
  • メモリ状態(任意):仮想マシンのメモリの内容

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

スナップショットを削除した際、仮想マシンが数分間停止する事象があったので、メモ。
参考: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 が発生していると考えられます。

以上

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

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 received The 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 received If 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 の情報を、ルーティングテーブルに反映できない事象は、仕様なのか、不具合なのか、引き続き調査を進めたいと思います。

※2014/9/1 追記
上記動作については、ソフトウェアの仕様である事が判明しました。
なお、ドキュメント上で明確になっていない事から「ドキュメントのバグ」として、修正依頼をかけて頂く事になりました。

以上

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

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

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

#!/usr/bin/perl
use 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 ($nTime3 eq $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 );
}
#------------------------------

Windows Server Backup を使用した vCenter のバックアップ

Windows Server Backup を使用して、vCenter Server のバックアップが可能か、検証してみました。
結果は、問題なくリストア可能でしたが、簡易環境での結果なので、参考程度としてください。

検証環境
  • Windows Server 2008R2 に、vCenter Server5.0 をインストールし、ESXi5.0 を登録する。
  • ESXi 上にゲスト:Windows7 を、作成する。仮想ディスクは、データストア(NFS)に配置する。
  • 分散スイッチで、仮想マシンのポートグループ(dvPortGroup)を作成し、ゲストに適用する。
検証方法
  • Windows Server Backup を使用し、OS 全体のバックアップを作成する。
  • vCenter Server5.0 及び、SQL Server 2008R2 をアンインストールする。
  • Windows Server Backup で、リストアを行い、vCenter が復旧可能か確認する。
vCenter 及び SQL サービス停止

VMware VirtualCenter Server サービスを停止します。

> net stop "VMware VirtualCenter Server"
次のサービスは VMware VirtualCenter Server サービスに依存しています。
VMware VirtualCenter Server サービスを停止すると、これらのサービスも停止されます。

   VMware VirtualCenter Management Webservices

この操作を続行しますか? (Y/N) [N]: y

VMware VirtualCenter Server サービスが停止している事を確認します。

> net start | findstr -i VirtualCenter

VMwareVCMSDS サービスを停止します。

> net stop "VMwareVCMSDS"

VMwareVCMSDS サービスが停止している事を確認します。

> net start | findstr -i VMwareVCMSDS

SQL Server (VIM_SQLEXP)サービスを停止します。

> net stop "SQL Server (VIM_SQLEXP)"

SQL Server (VIM_SQLEXP)サービスが停止している事を確認します。

> net start | findstr -i (VIM_SQLEXP)
Inventory Service の DB バックアップ

万が一に備えて、以下の手順で、Inventory Service の DB のバックアップを取得します。*1

> cd C:\Program Files\VMware\Infrastructure\Inventory Service\scripts
> backup.bat -file backuptest

Inventory Service の DB のバックアップが作成された事を確認します。

> dir | findstr backuptest
2014/07/15  13:39         9,487,974 backuptest
SSL 証明書ファイルのバックアップ

万が一に備えて、SSL 証明書ファイルのバックアップを取得します。*2

"%ALLUSERSPROFILE%\VMWare\VMware VirtualCenter" 配下の全てのファイル
Windows Server Backup による全体バックアップ

Windows Server Backup は、「機能の追加」からインストールします。
f:id:FriendsNow:20140715171832p:plain

インストール完了後、「管理ツール」から起動します。
f:id:FriendsNow:20140715172039p:plain

「操作」タブから、「バックアップ(1回限り)」を実行します。
f:id:FriendsNow:20140715171902p:plain

「次へ」をクリックします。
f:id:FriendsNow:20140715172055p:plain

「サーバー全体」を選択し、「次へ」をクリックします。
f:id:FriendsNow:20140715172129p:plain

「ローカルドライブ」を選択し、「次へ」をクリックします。
f:id:FriendsNow:20140715172159p:plain

バックアップ先のボリュームを指定して、「次へ」をクリックします。*3
f:id:FriendsNow:20140715172224p:plain

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

「バックアップ」をクリックします。
f:id:FriendsNow:20140715172304p:plain

バックアップが完了後、「閉じる」をクリックします。
f:id:FriendsNow:20140715172318p:plain

バックアップをテストするため、vCenter と SQL サービスをアンインストールします。

Windows Server Backup による全体リストア

サーバーを、Windows Server 2008R2 のインストーラーから起動し、「次へ」をクリックします。
f:id:FriendsNow:20140715172350p:plain

「コンピュータを修復する」をクリックします。
f:id:FriendsNow:20140715172425p:plain

「以前に作成したシステムイメージを使用して・・」をチェックし、「次へ」をクリックします。
f:id:FriendsNow:20140715172459p:plain

「利用可能なシステムイメージのうち最新のものを使用する」をチェックし「次へ」をクリックします。
f:id:FriendsNow:20140715172527p:plain

「次へ」をクリックします。
f:id:FriendsNow:20140715172554p:plain

「完了」をクリックします。
f:id:FriendsNow:20140715172604p:plain

「はい」をクリックします。
f:id:FriendsNow:20140715172615p:plain

vCenter サーバーが正常に復旧する事を確認できました。
f:id:FriendsNow:20140715172717p:plain

また、検証中、ゲストへの影響がない事を確認できました。
f:id:FriendsNow:20140715172735p:plain

*1:今回の復旧手順では、使用しません。

*2:今回の復旧手順では、使用しません。

*3:バックアップ専用のストレージが必要です。本例では、ローカルドライブ「E:」を使用します。

Data Protection SnapMirror について

Data Protection SnapMirror とは

従来のデータ保護を目的とした、クラスタ内/クラスタ間のミラーリング機能になります。

クラスタ内 SnapMirror
  • Cluster Network を使用して、ローカルクラスタ上で、SnapMirror を行う。
  • ターゲットボリュームは、Source と同じ SVM でも、異なる SVM でも良い。
クラスタ間 SnapMirror
  • 異なるクラスタに存在するボリューム間で、SnapMirror を行う。
  • クラスタ間の Intercluster LIF を使用する。

設定例

Source 側の設定

Cluster 間通信用の VLAN を定義します。

cluster1::> network port vlan create -node cluster1-01 -vlan-name a0a-99
cluster1::> network port vlan create -node cluster1-02 -vlan-name a0a-99

Cluster 間通信用の VLAN が定義された事を確認します。

cluster1::> network port vlan show
                 Network Network
Node   VLAN Name Port    VLAN ID  MAC Address
------ --------- ------- -------- -----------------
cluster1-01
       a0a-10    a0a     10       02:0c:29:c4:aa:e4
       a0a-20    a0a     20       02:0c:29:c4:aa:e4
       a0a-30    a0a     30       02:0c:29:c4:aa:e4
       a0a-99    a0a     99       02:0c:29:c4:aa:e4
cluster1-02
       a0a-10    a0a     10       02:0c:29:c0:8c:8a
       a0a-20    a0a     20       02:0c:29:c0:8c:8a
       a0a-30    a0a     30       02:0c:29:c0:8c:8a
       a0a-99    a0a     99       02:0c:29:c0:8c:8a
8 entries were displayed.

Cluster 間通信用の FailoverGroup を定義します。

cluster1::> network interface failover-groups create -failover-group failovergroup -node cluster1-01 -port a0a-99
cluster1::> network interface failover-groups create -failover-group failovergroup -node cluster1-02 -port a0a-99

Cluster 間通信用の FailoverGroup を定義された事を確認します。

cluster1::> network interface failover-groups show
Failover
Group               Node              Port
------------------- ----------------- ----------
clusterwide
                    cluster1-01       a0a
                    cluster1-01       e0c
                    cluster1-02       a0a
                    cluster1-02       e0c
failovergroup
                    cluster1-01       a0a-10
                    cluster1-01       a0a-99
                    cluster1-02       a0a-10
                    cluster1-02       a0a-99
8 entries were displayed.

Cluster 間通信用の LIF を作成します。

cluster1::> network interface create -vserver cluster1-01 -lif lif-cluster01 -role intercluster -home-node cluster1-01 -home-port a0a-99 -address 172.16.99.11 -netmask 255.255.255.0
cluster1::> network interface create -vserver cluster1-02 -lif lif-cluster02 -role intercluster -home-node cluster1-02 -home-port a0a-99 -address 172.16.99.12 -netmask 255.255.255.0

Cluster 間通信用の LIF が作成されている事を確認します。

cluster1::> network interface show lif-cluster01,lif-cluster02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
cluster1-01
            lif-cluster01
                         up/up    172.16.99.11/24    cluster1-01   a0a-99  true
cluster1-02
            lif-cluster02
                         up/up    172.16.99.12/24    cluster1-02   a0a-99  true
2 entries were displayed.
Destination 側の設定

インターフェースグループを作成します。

cluster2::>  network port ifgrp create -node cluster2-01 -ifgrp a0a -distr-func ip -mode multimode
cluster2::>  network port ifgrp create -node cluster2-02 -ifgrp a0a -distr-func ip -mode multimode

インターフェースグループが作成された事を確認します。

cluster2::> network port ifgrp show
         Port       Distribution                   Active
Node     IfGrp      Function     MAC Address       Ports   Ports
-------- ---------- ------------ ----------------- ------- -------------------
cluster2-01
         a0a        ip           02:0c:29:af:99:db none    -
cluster2-02
         a0a        ip           02:0c:29:96:f8:e7 none    -
2 entries were displayed.

インターフェースグループにポートを追加します。

cluster2::> network port ifgrp add-port -node cluster2-01 -ifgrp a0a -port e0d
cluster2::> network port ifgrp add-port -node cluster2-02 -ifgrp a0a -port e0d

インターフェースグループにポートが追加された事を確認します。

cluster2::> network port ifgrp show
         Port       Distribution                   Active
Node     IfGrp      Function     MAC Address       Ports   Ports
-------- ---------- ------------ ----------------- ------- -------------------
cluster2-01
         a0a        ip           02:0c:29:af:99:db full    e0d
cluster2-02
         a0a        ip           02:0c:29:96:f8:e7 full    e0d
2 entries were displayed.

Cluster 間通信用の VLAN を定義します。

cluster2::> network port vlan create -node cluster2-01 -vlan-name a0a-99
cluster2::> network port vlan create -node cluster2-02 -vlan-name a0a-99

Cluster 間通信用の VLAN が定義された事を確認します。

cluster2::> network port vlan show
                 Network Network
Node   VLAN Name Port    VLAN ID  MAC Address
------ --------- ------- -------- -----------------
cluster2-01
       a0a-99    a0a     99       02:0c:29:af:99:db
cluster2-02
       a0a-99    a0a     99       02:0c:29:96:f8:e7
2 entries were displayed.

Cluster 間通信用の FailoverGroup を定義します。

cluster2::> network interface failover-groups create -failover-group failovergroup -node cluster2-01 -port a0a-99
cluster2::> network interface failover-groups create -failover-group failovergroup -node cluster2-02 -port a0a-99

Cluster 間通信用の FailoverGroup を定義された事を確認します。

cluster2::> network interface failover-groups show
Failover
Group               Node              Port
------------------- ----------------- ----------
clusterwide
                    cluster2-02       a0a
                    cluster2-02       e0c
                    cluster2-01       a0a
                    cluster2-01       e0c
failovergroup
                    cluster2-02       a0a-99
                    cluster2-01       a0a-99
6 entries were displayed.

vserver setup コマンドで SVM を作成します。

cluster2::> vserver setup
Welcome to the Vserver Setup Wizard, which will lead you through
the steps to create a virtual storage server that serves data to clients.

You can enter the following commands at any time:
"help" or "?" if you want to have a question clarified,
"back" if you want to change your answers to previous questions, and
"exit" if you want to quit the Vserver Setup Wizard. Any changes
you made before typing "exit" will be applied.

You can restart the Vserver Setup Wizard by typing "vserver setup". To accept a default
or omit a question, do not enter a value.

Vserver Setup wizard creates and configures only data Vservers.
If you want to create a Vserver with Infinite Volume use the vserver create command.

Step 1. Create a Vserver.
You can type "back", "exit", or "help" at any question.

Enter the Vserver name: bsvm-01
Choose the Vserver data protocols to be configured {nfs, cifs, fcp, iscsi, ndmp}:  nfs, cifs, fcp, iscsi, ndmp
Choose the Vserver client services to be configured {ldap, nis, dns}: dns
Enter the Vserver's root volume aggregate [aggr1]: aggr1
Enter the Vserver language setting, or "help" to see all languages [C.UTF-8]: C
Enter the Vserver root volume's security style {mixed, ntfs, unix} [unix]: unix
Vserver creation might take some time to finish....

Vserver bsvm-01 with language set to C created.  The permitted protocols are nfs,cifs,fcp,iscsi,ndmp.

Step 2: Create a data volume
You can type "back", "exit", or "help" at any question.

Do you want to create a data volume? {yes, no} [yes]: no

Step 3: Create a logical interface.
You can type "back", "exit", or "help" at any question.

Do you want to create a logical interface? {yes, no} [yes]: no

Step 4: Configure DNS (Domain Name Service).
You can type "back", "exit", or "help" at any question.

Do you want to configure DNS? {yes, no} [yes]: no
Error: Failed to create NFS. Reason: You do not have a valid license for "NFS". Reason: Package "NFS" is not licensed in the cluster.

Step 5: Configure NFS.
You can type "back", "exit", or "help" at any question.

Step 6: Configure CIFS.
You can type "back", "exit", or "help" at any question.

Do you want to configure CIFS? {yes, no} [yes]: no

Step 7: Configure iSCSI.
You can type "back", "exit", or "help" at any question.

Do you want to configure iSCSI? {yes, no} [yes]: no

Step 8: Configure FCP.
You can type "back", "exit", or "help" at any question.

Do you want to configure FCP? {yes, no} [yes]: no

Vserver bsvm-01 has been configured successfully.

Cluster 間通信用の LIF を作成します。

cluster2::> network interface create -vserver cluster2-01 -lif lif-cluster01 -role intercluster -home-node cluster2-01 -home-port a0a-99 -address 172.16.99.21 -netmask 255.255.255.0
cluster2::> network interface create -vserver cluster2-02 -lif lif-cluster02 -role intercluster -home-node cluster2-02 -home-port a0a-99 -address 172.16.99.22 -netmask 255.255.255.0

Cluster 間通信用の LIF が作成されている事を確認します。

cluster2::> network interface show lif-cluster01,lif-cluster02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
cluster2-01
            lif-cluster01
                         up/up    172.16.99.21/24    cluster2-01   a0a-99  true
cluster2-02
            lif-cluster02
                         up/up    172.16.99.22/24    cluster2-02   a0a-99  true
2 entries were displayed.

Cluster Peer を作成します。

cluster2::> cluster peer create -peer-addrs 172.16.99.11,172.16.99.12 -username admin
Remote Password:

Cluster Peer が作成されている事を確認します。

cluster2::> cluster peer show -instance

            Peer Cluster Name: cluster1
Remote Intercluster Addresses: 172.16.99.11, 172.16.99.12
                 Availability: Available
          Remote Cluster Name: cluster1
          Active IP Addresses: 172.16.99.11, 172.16.99.12
        Cluster Serial Number: 1-80-000008

Vserver Peer を作成します。

cluster2::> vserver peer create -vserver bsvm-01 -peer-vserver svm-01 -applications snapmirror -peer-cluster cluster1

Vserver Peer が作成されている事を確認します。※この時点では、まだ承認されていません。

cluster2::> vserver peer show
            Peer        Peer
Vserver     Vserver     State
----------- ----------- ------------
bsvm-01     svm-01      initiated

Source 側で、destination 側の Vserver Peer を承認します。

cluster1::> vserver peer accept -vserver svm-01 -peer-vserver bsvm-01

Vserver Peer が承認されている事を確認します

cluster2::> vserver peer show
            Peer        Peer
Vserver     Vserver     State
----------- ----------- ------------
bsvm-01     svm-01      peered

SnapMirror 送信先の Volume を作成します。

cluster2::> volume create -vserver bsvm-01 -volume rootvol_is -aggregate aggr1 -type DP

送信先の Volume が作成された事を確認します。

cluster2::> volume show -volume rootvol_is
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
bsvm-01   rootvol_is   aggr1        online     DP         20MB    19.89MB    0%

InterCluster SnapMirror を作成します。

cluster2::> snapmirror create -source-path cluster1://svm-01/rootvol bsvm-01:rootvol_is -type DP

InterCluster SnapMirror が作成された事を確認します。

cluster2::> snapmirror show
                                                                       Progress
Source            Destination  Mirror  Relationship  Total             Last
Path        Type  Path         State   Status        Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
svm-01:rootvol
            DP   bsvm-01:rootvol_is
                              Uninitialized
                                      Idle           -         true    -

InterCluste SnapMirror の Initialize を行います。

cluster2::> snapmirror initialize -source-path cluster1://svm-01/rootvol bsvm-01:rootvol_is

Initialize が完了した事を確認します。

cluster1::> snapmirror show
                                                                       Progress
Source            Destination  Mirror  Relationship  Total             Last
Path        Type  Path         State   Status        Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
svm-01:rootvol
            DP   bsvm-01:rootvol_is
                              Snapmirrored
                                      Idle           -         true    -

以上

Load Sharing SnapMirror について

Load Sharing SnapMirror とは

クアライアントからの Read(読み取り)要求を分散して、スループットを向上させる機能になります。
具体的には、Root を含む任意の Volume のコピー(読み取り専用)を、マスターとは別の Aggregate に作成し、クライアントからの Read 要求を分散します。*1書き込みについては、マスターにのみ行われ、分散されません。

注意点

マスターからコピーに対し、リアルタイムミラーリングが行われないため、マスターで更新されたデータを、読み取れるようにするには、LS ミラーをアップデートする必要があります。これに関連して、Root volume をコピーした際、Root 配下に新たな Volume を作成しても、(LS ミラーをアップデートするまで、コピー先の、Junction Path が更新されないため)当該 Volume にアクセスできない事に注意してください。

設定例

SnapMirror 送信先の Volume を作成します。

cluster1::> volume create -vserver svm-01 -volume rootvol_ls -aggregate aggr2 -type DP

送信先の Volume が作成された事を確認します。

cluster1::> volume show -volume rootvol_ls
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
svm-01    rootvol_ls   aggr2        online     DP         20MB    19.89MB    0%

LS SnapMirror を作成します。

cluster1::> snapmirror create -source-path svm-01:rootvol -destination-path svm-01:rootvol_ls -type LS

LS SnapMirror が作成された事を確認します。

cluster1::> snapmirror show
                                                                       Progress
Source            Destination  Mirror  Relationship  Total             Last
Path        Type  Path         State   Status        Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
cluster1://svm-01/rootvol
            LS   cluster1://svm-01/rootvol_ls
                              Uninitialized
                                      Idle           -         -       -

LS SnapMirror の Initialize を行います。

cluster1::> snapmirror initialize-ls-set -source-path svm-01:rootvol

Initialize が完了した事を確認します。

cluster1::> snapmirror show
                                                                       Progress
Source            Destination  Mirror  Relationship  Total             Last
Path        Type  Path         State   Status        Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
cluster1://svm-01/rootvol
            LS   cluster1://svm-01/rootvol_ls
                              Snapmirrored
                                      Idle           -         true    -

Volume サイズが、マスターと同様となっている事を確認します。

cluster1::> volume show -volume rootvol,rootvol_ls
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
svm-01    rootvol      aggr1        online     RW          2GB     1.90GB    5%
svm-01    rootvol_ls   aggr2        online     LS          2GB     1.90GB    5%
2 entries were displayed.

新規の Volume を作成すると、下記のとおり、留意事項が通知されます。

cluster1::> volume create -vserver svm-01 -volume vol_nfs02 -aggregate aggr1 -size 1g -security-style unix -space-guarantee none -junction-path /vol_nfs02
[Job 82] Job succeeded: Successful

Notice: Volume vol_nfs02 now has a mount point from volume rootvol.  The load sharing (LS) mirrors of volume
        rootvol have no replication schedule.  Volume vol_nfs02 will not be visible in the global namespace until
        the LS mirrors of volume rootvol have been updated.
        現状、LS SnapMirror スケジュールが設定されていないため、アップデートされるまで、クライントからアクセスできません。

LS SnapMirror をアップデートします。

cluster1::> snapmirror update-ls-set -source-path svm-01:rootvol

LS SnapMirror がアップデートされた事を確認します。

cluster1::> snapmirror show
                                                                       Progress
Source            Destination  Mirror  Relationship  Total             Last
Path        Type  Path         State   Status        Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
cluster1://svm-01/rootvol
            LS   cluster1://svm-01/rootvol_ls
                              Snapmirrored
                                      Idle           -         true    -

LS SnapMirror のスケジュールを作成します。

cluster1::> job schedule cron create -name sched01 -hour 1 -minute 0

LS SnapMirror にスケジュールを適用します。

cluster1::> snapmirror modify -destination-path svm-01:rootvol_ls -schedule sched01

LS SnapMirror にスケジュールが設定されている事を確認します。

cluster1::> snapmirror show -fields schedule
source-path               destination-path             schedule
------------------------- ---------------------------- --------
cluster1://svm-01/rootvol cluster1://svm-01/rootvol_ls sched01

以上

*1:クライアントからの Read 要求は、全てコピーされた Volume に向けられます。

Clustered ONTAP の基本操作について

ライセンスの有効化

必要に応じてライセンスを追加します。*1

cluster1::> license add -license-code "License Code"

Aggregate の操作

Raid サイズ、Disk 数を指定して Aggregate を作成します。

cluster1::> storage aggregate create -aggregate aggr1 -raidtype raid_dp -diskcount 5 -nodes cluster1-01 -maxraidsize 22

aggr1 が作成されている事を確認します。

cluster1::> storage aggregate show
Aggregate     Size Available Used% State   #Vols  Nodes            RAID Status
--------- -------- --------- ----- ------- ------ ---------------- ------------
aggr0       5.27GB    4.44GB   16% online       1 cluster1-01      raid_dp,
                                                                   normal
aggr0_cluster1_02_0
             900MB   43.54MB   95% online       1 cluster1-02      raid_dp,
                                                                   normal
aggr1       2.64GB    2.64GB    0% online       0 cluster1-01      raid_dp,
                                                                   normal
3 entries were displayed.

disk が aggr1 にアサインされている事を確認します。

cluster1::> disk show -aggregate aggr1
                     Usable           Container
Disk                   Size Shelf Bay Type        Position   Aggregate Owner
---------------- ---------- ----- --- ----------- ---------- --------- --------
cluster1-01:v4.21    1020MB     -   - aggregate   dparity    aggr1     cluster1-01
cluster1-01:v4.22    1020MB     -   - aggregate   data       aggr1     cluster1-01
cluster1-01:v4.24    1020MB     -   - aggregate   data       aggr1     cluster1-01
cluster1-01:v5.19    1020MB     -   - aggregate   parity     aggr1     cluster1-01
cluster1-01:v5.20    1020MB     -   - aggregate   data       aggr1     cluster1-01
5 entries were displayed.

aggr1 に disk を1本追加します。

cluster1::> storage aggregate add-disks -aggregate aggr1 -disklist cluster1-01:v4.25

disk が追加され、aggr1 の容量が増加している事を確認する。

cluster1::> storage aggregate show
Aggregate     Size Available Used% State   #Vols  Nodes            RAID Status
--------- -------- --------- ----- ------- ------ ---------------- ------------
aggr0       5.27GB    4.44GB   16% online       1 cluster1-01      raid_dp,
                                                                   normal
aggr0_cluster1_02_0
             900MB   43.54MB   95% online       1 cluster1-02      raid_dp,
                                                                   normal
aggr1       3.52GB    3.51GB    0% online       0 cluster1-01      raid_dp,
                                                                   normal
3 entries were displayed.

disk(cluster1-01:v4.25)が aggr1 にアサインされている事を確認します。

cluster1::> disk show -aggregate aggr1
                     Usable           Container
Disk                   Size Shelf Bay Type        Position   Aggregate Owner
---------------- ---------- ----- --- ----------- ---------- --------- --------
cluster1-01:v4.21    1020MB     -   - aggregate   dparity    aggr1     cluster1-01
cluster1-01:v4.22    1020MB     -   - aggregate   data       aggr1     cluster1-01
cluster1-01:v4.24    1020MB     -   - aggregate   data       aggr1     cluster1-01
cluster1-01:v4.25    1020MB     -   - aggregate   data       aggr1     cluster1-01
cluster1-01:v5.19    1020MB     -   - aggregate   parity     aggr1     cluster1-01
cluster1-01:v5.20    1020MB     -   - aggregate   data       aggr1     cluster1-01
6 entries were displayed.

インターフェースグループの作成

インターフェースグループを作成します。

cluster1::> network port ifgrp create -node cluster1-01 -ifgrp a0a -distr-func ip -mode multimode
cluster1::> network port ifgrp create -node cluster1-02 -ifgrp a0a -distr-func ip -mode multimode

インターフェースグループが作成された事を確認します。

cluster1::> network port ifgrp show
         Port       Distribution                   Active
Node     IfGrp      Function     MAC Address       Ports   Ports
-------- ---------- ------------ ----------------- ------- -------------------
cluster1-01
         a0a        ip           02:0c:29:c4:aa:e4 none    -
cluster1-02
         a0a        ip           02:0c:29:c0:8c:8a none    -

インターフェースグループにポートを追加します。

cluster1::> network port ifgrp add-port -node cluster1-01 -ifgrp a0a -port e0d
cluster1::> network port ifgrp add-port -node cluster1-02 -ifgrp a0a -port e0d

インターフェースグループにポートが追加された事を確認します。

cluster1::> network port ifgrp show
         Port       Distribution                   Active
Node     IfGrp      Function     MAC Address       Ports   Ports
-------- ---------- ------------ ----------------- ------- -------------------
cluster1-01
         a0a        ip           02:0c:29:c4:aa:e4 full    e0d
cluster1-02
         a0a        ip           02:0c:29:c0:8c:8a full    e0d
2 entries were displayed.

VLAN 作成

VLAN を作成します。

cluster1::> network port vlan create -node cluster1-01 -vlan-name a0a-10
cluster1::> network port vlan create -node cluster1-02 -vlan-name a0a-10

VLAN が作成された事を確認します。

cluster1::> network port vlan show
                 Network Network
Node   VLAN Name Port    VLAN ID  MAC Address
------ --------- ------- -------- -----------------
cluster1-01
       a0a-10    a0a     10       02:0c:29:c4:aa:e4
cluster1-02
       a0a-10    a0a     10       02:0c:29:c0:8c:8a
2 entries were displayed.

フェイルオーバーグループ作成

フェイルオーバーグループを作成します。

cluster1::> network interface failover-groups create -failover-group failovergroup -node cluster1-01 -port a0a-10
cluster1::> network interface failover-groups create -failover-group failovergroup -node cluster1-02 -port a0a-10

フェイルオーバーグループが作成された事を確認します。

cluster1::> network interface failover-groups show
Failover
Group               Node              Port
------------------- ----------------- ----------
clusterwide
                    cluster1-01       a0a
                    cluster1-01       e0c
                    cluster1-02       a0a
                    cluster1-02       e0c
failovergroup
                    cluster1-01       a0a-10
                    cluster1-02       a0a-10
6 entries were displayed.

SVM(Server Virtual Machine)作成

vserver setup コマンドで SVM を作成します。

cluster1::> vserver setup
Welcome to the Vserver Setup Wizard, which will lead you through
the steps to create a virtual storage server that serves data to clients.

You can enter the following commands at any time:
"help" or "?" if you want to have a question clarified,
"back" if you want to change your answers to previous questions, and
"exit" if you want to quit the Vserver Setup Wizard. Any changes
you made before typing "exit" will be applied.

You can restart the Vserver Setup Wizard by typing "vserver setup". To accept a default
or omit a question, do not enter a value.

Vserver Setup wizard creates and configures only data Vservers.
If you want to create a Vserver with Infinite Volume use the vserver create command.

Step 1. Create a Vserver.
You can type "back", "exit", or "help" at any question.

Enter the Vserver name: svm-01
Choose the Vserver data protocols to be configured {nfs, cifs, fcp, iscsi, ndmp}: nfs, cifs, fcp, iscsi, ndmp
Choose the Vserver client services to be configured {ldap, nis, dns}: dns
Enter the Vserver's root volume aggregate [aggr1]: aggr1
Enter the Vserver language setting, or "help" to see all languages [C]:
Enter the Vserver root volume's security style {mixed, ntfs, unix} [unix]:
Vserver creation might take some time to finish....

Vserver svm-01 with language set to C created.  The permitted protocols are nfs,cifs,fcp,iscsi,ndmp.

Step 2: Create a data volume
You can type "back", "exit", or "help" at any question.

Do you want to create a data volume? {yes, no} [yes]: no

Step 3: Create a logical interface.
You can type "back", "exit", or "help" at any question.

Do you want to create a logical interface? {yes, no} [yes]: no

Step 4: Configure DNS (Domain Name Service).
You can type "back", "exit", or "help" at any question.

Do you want to configure DNS? {yes, no} [yes]: no
Error: Failed to create NFS. Reason: You do not have a valid license for "NFS". Reason: Package "NFS" is not licensed in the cluster.

Step 5: Configure NFS.
You can type "back", "exit", or "help" at any question.

Step 6: Configure CIFS.
You can type "back", "exit", or "help" at any question.

Do you want to configure CIFS? {yes, no} [yes]: no

Step 7: Configure iSCSI.
You can type "back", "exit", or "help" at any question.

Do you want to configure iSCSI? {yes, no} [yes]: no

Step 8: Configure FCP.
You can type "back", "exit", or "help" at any question.

Do you want to configure FCP? {yes, no} [yes]: no

Vserver svm-01 has been configured successfully.

SVM が作成されている事を確認します。

cluster1::> vserver show
                    Admin     Root                  Name    Name
Vserver     Type    State     Volume     Aggregate  Service Mapping
----------- ------- --------- ---------- ---------- ------- -------
cluster1    admin   -         -          -          -       -
cluster1-01 node    -         -          -          -       -
cluster1-02 node    -         -          -          -       -
svm-01      data    running   rootvol    aggr1      file    file
4 entries were displayed.

LIF(Logical Interface) 作成

  • role について
    • クラスタネットワークで使用する LIF は、cluster を定義します。
    • データ通信で使用する LIF は、data を定義します。通常、SVM 上に作成する LIF です。
    • ノード管理で使用する LIF は、node-mgmt を定義します。
    • Intercluster SnapMirror で使用する LIF は、intercluster を定義します。
    • クラスタ管理に使用する LIF は、cluster-mgmt を定義します。

iSCSI 用の LIF を作成します。

cluster1::> network interface create -vserver svm-01 -lif lif-iscsi01 -role data -data-protocol iscsi -home-node cluster1-01 -home-port a0a-10 -address 172.16.10.11 -netmask 255.255.255.0
cluster1::> network interface create -vserver svm-01 -lif lif-iscsi02 -role data -data-protocol iscsi -home-node cluster1-02 -home-port a0a-10 -address 172.16.10.12 -netmask 255.255.255.0

iSCSI 用の LIF が作成されている事を確認します。

cluster1::> network interface show lif-iscsi01,lif-iscsi02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
svm-01
            lif-iscsi01  up/up    172.16.10.11/24    cluster1-01   a0a-10  true
            lif-iscsi02  up/up    172.16.10.12/24    cluster1-02   a0a-10  true
2 entries were displayed.

NFS 用の LIF を作成します。NFS の LIF はマイグレートが可能です。

cluster1::> network interface create -vserver svm-01 -lif lif-nfs01 -role data -data-protocol nfs -home-node cluster1-01 -home-port a0a-10 -address 172.16.20.11 -netmask 255.255.255.0 -failover-group failovergroup
cluster1::> network interface create -vserver svm-01 -lif lif-nfs02 -role data -data-protocol nfs -home-node cluster1-02 -home-port a0a-10 -address 172.16.20.12 -netmask 255.255.255.0 -failover-group failovergroup

NFS 用の LIF が作成されている事を確認します。

cluster1::> network interface show lif-nfs01,lif-nfs02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
svm-01
            lif-nfs01    up/up    172.16.20.11/24    cluster1-01   a0a-10  true
            lif-nfs02    up/up    172.16.20.12/24    cluster1-02   a0a-10  true
2 entries were displayed.

LIF の詳細情報を確認する際は、-instance オプションを使用します。

cluster1::> network interface show -lif lif-iscsi01 -instance

                    Vserver Name: svm-01
          Logical Interface Name: lif-iscsi01
                            Role: data
                   Data Protocol: iscsi
                       Home Node: cluster1-01
                       Home Port: a0a-10
                    Current Node: cluster1-01
                    Current Port: a0a-10
              Operational Status: up
                 Extended Status: -
                         Is Home: true
                 Network Address: 172.16.10.11
                         Netmask: 255.255.255.0
             Bits in the Netmask: 24
                 IPv4 Link Local: -
              Routing Group Name: d172.16.99.0/24
           Administrative Status: up
                 Failover Policy: disabled
                 Firewall Policy: data
                     Auto Revert: false
   Fully Qualified DNS Zone Name: none
         DNS Query Listen Enable: false
             Failover Group Name:
                        FCP WWPN: -
                  Address family: ipv4
                         Comment: -

LIF の設定を変更する際は、modefy コマンドを使用します。

cluster1::> network interface modify -vserver svm-01 -lif lif-iscsi01 -address 172.16.100.11

CIFS 用の LIF を作成します。

cluster1::> network interface create -vserver svm-01 -lif lif-cifs01 -role data -data-protocol cifs -home-node cluster1-01 -home-port a0a-10 -address 172.16.30.11 -netmask 255.255.255.0
cluster1::> network interface create -vserver svm-01 -lif lif-cifs02 -role data -data-protocol cifs -home-node cluster1-02 -home-port a0a-10 -address 172.16.30.12 -netmask 255.255.255.0

CIFS 用の LIF が作成されている事を確認します。

cluster1::> network interface show lif-cifs01,lif-cifs02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
svm-01
            lif-cifs01   up/up    172.16.30.11/24    cluster1-01   a0a-10  true
            lif-cifs02   up/up    172.16.30.12/24    cluster1-02   a0a-10  true
2 entries were displayed.

LIF をマイグレート*2します。
※iSCSI の LIF では、マイグレートをサポートしていません。

cluster1::> network interface migrate -vserver svm-01 -lif lif-nfs01 -dest-node cluster1-02 -dest-port a0a-10

lif-nfs01 の Home Node が cluster1-01 から cluster1-02 へ移行した事を確認します。

cluster1::> network interface show lif-nfs01,lif-nfs02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
svm-01
            lif-nfs01    up/up    172.16.20.11/24    cluster1-02   a0a-10  false
            lif-nfs02    up/up    172.16.20.12/24    cluster1-02   a0a-10  true
2 entries were displayed.

LIF をリバート*3します。

cluster1::> network interface revert -vserver svm-01 -lif lif-nfs01

lif-nfs01 の Home Node が cluster1-02 から cluster1-01 へ戻った事を確認します。

cluster1::> network interface show lif-nfs01,lif-nfs02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
svm-01
            lif-nfs01    up/up    172.16.20.11/24    cluster1-01   a0a-10  true
            lif-nfs02    up/up    172.16.20.12/24    cluster1-02   a0a-10  true
2 entries were displayed.

SVM 上の全ての LIF を Home Port に戻す際は、lif_name を指定せず * を入力します。

cluster1::> network interface revert -vserver svm-01 *

LIF に適用している VLAN の変更

VLAN-id 20 を定義します。

cluster1::> network port vlan create -node cluster1-01 -vlan-name a0a-20
cluster1::> network port vlan create -node cluster1-02 -vlan-name a0a-20

VLAN が作成された事を確認します。

cluster1::> network port vlan show
                 Network Network
Node   VLAN Name Port    VLAN ID  MAC Address
------ --------- ------- -------- -----------------
cluster1-01
       a0a-10    a0a     10       02:0c:29:c4:aa:e4
       a0a-20    a0a     20       02:0c:29:c4:aa:e4
cluster1-02
       a0a-10    a0a     10       02:0c:29:c0:8c:8a
       a0a-20    a0a     20       02:0c:29:c0:8c:8a
4 entries were displayed.

LIF(lif-nfs)の home-port を VLAN 20 に指定します。

cluster1::> network interface modify -vserver svm-01 -lif lif-nfs01 -home-node cluster1-01 -home-port a0a-20
cluster1::> network interface modify -vserver svm-01 -lif lif-nfs02 -home-node cluster1-02 -home-port a0a-20

現状は、home-port が VLAN 10 となっている事を確認します。

cluster1::> network interface show -lif lif-nfs01,lif-nfs02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
svm-01
            lif-nfs01    up/up    172.16.20.11/24    cluster1-01   a0a-10  false
            lif-nfs02    up/up    172.16.20.12/24    cluster1-02   a0a-10  false
2 entries were displayed.

home-port を VLAN20 へ移行します。

cluster1::> network interface migrate -vserver svm-01 -lif lif-nfs01 -dest-node cluster1-01 -dest-port a0a-20
cluster1::> network interface migrate -vserver svm-01 -lif lif-nfs02 -dest-node cluster1-02 -dest-port a0a-20

home-port が VLAN20 へ移行した事を確認します。

cluster1::> network interface show lif-nfs01,lif-nfs02
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
svm-01
            lif-nfs01    up/up    172.16.20.11/24    cluster1-01   a0a-20  true
            lif-nfs02    up/up    172.16.20.12/24    cluster1-02   a0a-20  true
2 entries were displayed.

ルーティング設定*4

SVM-01 にデフォルトルートを設定します。

cluster1::> network routing-groups route create -vserver svm-01 -routing-group d172.16.10.0/24 -destination 0.0.0.0/0 -gateway 172.16.10.254

SVM-01 のルーティングテーブルを確認します。

cluster1::> network routing-groups route show
          Routing
Vserver   Group     Destination     Gateway         Metric
--------- --------- --------------- --------------- ------
cluster1
          c192.168.1.0/24
                    0.0.0.0/0       192.168.1.2     20
cluster1-01
          n192.168.1.0/24
                    0.0.0.0/0       192.168.1.2     10
cluster1-02
          n192.168.1.0/24
                    0.0.0.0/0       192.168.1.2     10
svm-01
          d172.16.10.0/24
                    0.0.0.0/0       172.16.10.254   20
4 entries were displayed.

ルーティングテーブルから、ルートを削除する場合は、route delete コマンドを使用します。

cluster1::> network routing-groups route delete -vserver svm-01 -routing-group d172.16.99.0/24 -destination 0.0.0.0/0

Volume の操作

volume を作成します。*5

cluster1::> volume create -vserver svm-01 -volume vol_nfs01 -aggregate aggr1 -size 2g -security-style unix -space-guarantee none -junction-path /vol_nfs01

volume が作成された事を確認します。

cluster1::> volume show
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
cluster1-01
          vol0         aggr0        online     RW      851.5MB    486.3MB   42%
cluster1-02
          vol0         aggr0_cluster1_02_0
                                    online     RW      851.5MB    519.5MB   38%
svm-01    rootvol      aggr1        online     RW          2GB     1.90GB    5%
svm-01    vol_nfs01    aggr1        online     RW          2GB     1.50GB   24%
4 entries were displayed.

volume サイズを変更する場合は、volume size コマンドを使用します。

cluster1::> volume size -vserver svm-01 -volume vol_nfs01 -new-size 3g

volume サイズが変更された事を確認します。

cluster1::> volume show vol_nfs01
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
svm-01    vol_nfs01    aggr1        online     RW          3GB     1.50GB   49%

volume 作成時に junction-path を指定しなかった場合は、個別にマウントします。

cluster1::> volume mount -vserver svm-01 -volume vol_nfs01 -junction-path /vol_nfs01

LUN の操作

iSCSI ターゲットを作成します。

cluster1::cluster> vserver iscsi create -vserver svm-01

iSCSI ターゲットが作成された事を確認します。

cluster1::cluster> vserver iscsi show
           Target                           Target                       Status
Vserver    Name                             Alias                        Admin
---------- -------------------------------- ---------------------------- ------
svm-01     iqn.1992-08.com.netapp:sn.a74d0e3b00ef11e4918d123478563412:vs.3
                                            svm-01                       up

igroup を作成します。

clluster1::cluster> lun igroup create -vserver svm-01 -igroup igroup01 -protocol iscsi -ostype vmware

igroup が作成された事を確認します。

cluster1::cluster> lun igroup show
Vserver   Igroup       Protocol OS Type  Initiators
--------- ------------ -------- -------- ------------------------------------
svm-01    igroup01     iscsi    vmware   -

igroup にサーバの initiator を追加します。

cluster1::cluster> lun igroup add -vserver svm-01 -igroup igroup01 -initiator iqn.1998-01.com.vmware:localhost-0a162bb4

igroup に initiator が追加された事を確認します。

cluster1::cluster> igroup show
Vserver   Igroup       Protocol OS Type  Initiators
--------- ------------ -------- -------- ------------------------------------
svm-01    igroup01     iscsi    vmware   iqn.1998-01.com.vmware:localhost-0a162bb4

LUN を作成します。

cluster1::cluster> lun create -vserver svm-01 -path /vol/vol_iscsi01/lun_iscsi01 -size 2g -ostype vmware -space-reserve disabled

LUN が作成された事を確認します。

cluster1::cluster> lun show
Vserver   Path                            State   Mapped   Type        Size
--------- ------------------------------- ------- -------- -------- --------
svm-01    /vol/vol_iscsi01/lun_iscsi01    online  unmapped vmware        2GB


LUN に igroup をマッピングします。

cluster1::cluster> lun map -vserver svm-01 -path /vol/vol_iscsi01/lun_iscsi01 -igroup igroup01

LUN に igroup がマッピングされた事を確認します。

cluster1::cluster> lun mapped show
Vserver    Path                                      Igroup   LUN ID  Protocol
---------- ----------------------------------------  -------  ------  --------
svm-01     /vol/vol_iscsi01/lun_iscsi01              igroup01      0  iscsi

lun サイズを変更する場合は、lun resize コマンドを使用します。

cluster1::> lun resize -vserver svm-01 -path /vol/vol_iscsi01/lun_iscsi01 -size  2.5g

lun サイズが変更された事を確認します。

cluster1::> lun show
Vserver   Path                            State   Mapped   Type        Size
--------- ------------------------------- ------- -------- -------- --------
svm-01    /vol/vol_iscsi01/lun_iscsi01    online  mapped   vmware     2.50GB

NFS 設定

NFS を有効化します。

cluster1::> nfs on -vserver svm-01

NFS が有効になっている事を確認します。

cluster1::> nfs status -vserver svm-01
The NFS server is running.

export-policy を作成します。

cluster1::> vserver export-policy create -vserver svm-01 -policyname export01

export-policy が作成された事を確認します。

cluster1::> vserver export-policy show
Vserver          Policy Name
---------------  -------------------
svm-01           default
svm-01           export01
2 entries were displayed.

export-policy に rule を設定します。

cluster1::> vserver export-policy rule create -vserver svm-01 -policyname export01 -clientmatch 0.0.0.0/0 -anon 0 -rorule any -rwrule any

export-policy に rule が設定された事を確認します。

cluster1::> vserver export-policy rule show
             Policy          Rule    Access   Client                RO
Vserver      Name            Index   Protocol Match                 Rule
------------ --------------- ------  -------- --------------------- ---------
svm-01       export01        1       any      0.0.0.0/0             any

export する volume に export-policy を適用します。

cluster1::> volume modify -vserver svm-01 -volume vol_nfs01 -policy export01

volume に export-policy が適用された事を確認します。

cluster1::> volume show -fields policy
vserver     volume policy
----------- ------ ------
cluster1-01 vol0   -
cluster1-02 vol0   -
svm-01      rootvol
                   default
svm-01      vol_iscsi01
                   default
svm-01      vol_nfs01
                   export01
5 entries were displayed.

CIFS 設定

DNS サーバを設定します。

cluster1::> vserver services dns create -vserver svm-01 -domains example.com -name-servers 192.168.1.99

DNS サーバが設定された事を確認します。

cluster1::> vserver services dns show
                                                              Name
Vserver         State     Domains                             Servers
--------------- --------- ----------------------------------- ----------------
svm-01          enabled   example.com                         192.168.1.99

CIFS サーバを作成し、ドメインに参加します。

cluster1::> cifs create -cifs-server svm-01_cifs -domain example.com -vserver svm-01

In order to create an Active Directory machine account for the CIFS server, you must supply the name and password of a
Windows account with sufficient privileges to add computers to the "CN=Computers" container within the "example.com"
domain.

Enter the user name: Administrator

Enter the password:

CIFS が作成された事を確認します。

cluster1::> vserver cifs show
            Server          Status    Domain/Workgroup Authentication
Vserver     Name            Admin     Name             Style
----------- --------------- --------- ---------------- --------------
svm-01      SVM-01_CIFS     up        EXAMPLE          domain

volume を CIFS 共有します。
※volume の -security-style は ntfs である事が必須です。

cluster1::> vserver cifs share create -vserver svm-01 -share-name vol_cifs01 -path /vol_cifs01

volume が CIFS 共有された事を確認します。

cluster1::> vserver cifs share show
Vserver        Share         Path              Properties Comment  ACL
-------------- ------------- ----------------- ---------- -------- -----------
svm-01         admin$        /                 browsable  -        -
svm-01         ipc$          /                 browsable  -        -
svm-01         vol_cifs01    /vol_cifs01       oplocks    -        Everyone / Full Control
                                               browsable
                                               changenotify
3 entries were displayed.

CIFS サーバのローカルユーザを作成します。

cluster1::> vserver cifs users-and-groups local-user create -user-name testuser -vserver svm-01

Enter the password:
Confirm the password:

ローカルユーザが作成された事を確認します。

cluster1::> vserver cifs users-and-groups local-user show
Vserver      User Name                   Full Name            Description
------------ --------------------------- -------------------- -------------
svm-01       SVM-01_CIFS\Administrator                        Built-in administrator account
svm-01       SVM-01_CIFS\testuser        -                    -
2 entries were displayed.

CIFS ACL を設定します。

cluster1::> vserver cifs share access-control create -vserver svm-01 -share vol_cifs01 -user-or-group testuser -permission read

CIFS ACL が設定された事を確認します。

cluster1::> vserver cifs share access-control show
               Share       User/Group                  Access
Vserver        Name        Name                        Permission
-------------- ----------- --------------------------- -----------
svm-01         vol_cifs01  Everyone                    Full_Control
svm-01         vol_cifs01  testuser                    Read
2 entries were displayed.

CIFS ACL が対象のユーザに適用された事を確認します。

cluster1::> vserver cifs share show
Vserver        Share         Path              Properties Comment  ACL
-------------- ------------- ----------------- ---------- -------- -----------
svm-01         admin$        /                 browsable  -        -
svm-01         ipc$          /                 browsable  -        -
svm-01         vol_cifs01    /vol_cifs01       oplocks    -        Everyone / Full Control
                                               browsable           testuser / Read
                                               changenotify
3 entries were displayed.

Snapshot の操作

Snapshot を手動で取得します。

cluster1::> volume snapshot create -vserver svm-01 -volume vol_nfs01 -snapshot ss01

Snapshot が取得された事を確認します。

cluster1::> volume snapshot show -vserver svm-01 -volume vol_nfs01
                                                                   ---Blocks---
Vserver  Volume  Snapshot                        State        Size Total% Used%
-------- ------- ------------------------------- -------- -------- ------ -----
svm-01   vol_nfs01
                 ss01                            valid        80KB     0%   31%

Snapshot を削除します。

cluster1::> volume snapshot delete -vserver svm-01 -volume vol_nfs01 -snapshot *

Warning: Deleting a Snapshot copy permanently removes any data that is stored only in that Snapshot copy. Are
         you sure you want to delete Snapshot copy "ss01" for volume "vol_nfs01" in Vserver "svm-01" ?
          {y|n}: y
1 entry was acted on.

Snapshot を取得するジョブスケジュールを作成します。

cluster1::> job schedule cron create -name job01 -hour 1 -minute 0

Snapshot のジョブが作成された事を確認します。

cluster1::> job schedule show -name job01

Schedule Name: job01
Schedule Type: cron
  Description: @1:00

Snapshot ポリシー*6を作成します。

cluster1::> volume snapshot policy create -policy sspolicy01 -enabled true -vserver svm-01 -schedule1 job01 -count1 2 -prefix1 job01

Snapshot ポリシーが作成された事を確認します。

cluster1::> volume snapshot policy show -policy sspolicy01
Vserver: svm-01
                         Number of Is
Policy Name              Schedules Enabled Comment
------------------------ --------- ------- ----------------------------------
sspolicy01                       1 true    -
    Schedule               Count     Prefix                 SnapMirror Label
    ---------------------- -----     ---------------------- -------------------
    job01                      2     job01                  -

Snapshot ポリシーを volume に適用します。

cluster1::> volume modify -vserver svm-01 -volume vol_nfs01 -snapshot-policy sspolicy01

Snapshot ポリシーが volume に適用された事を確認します。

cluster1::> volume show -fields snapshot-policy -volume vol_nfs01
vserver volume    snapshot-policy
------- --------- ---------------
svm-01  vol_nfs01 sspolicy01

以上

*1:シミュレーターのライセンスはNowからダウンロード可能です。

*2:LIF を Home Node の Home Port から、異なる Node・Port に移行します。

*3:LIF を Home Node の Home Port へ戻します。

*4:ルーティングは、SVM 単位で設定します。

*5:CIFS で共有する volume については、-security-style を ntfs にします。

*6:スケジュールの紐づけ及び、保持世代数を定義します。

Cisco ASR で再起動を繰り返すスクリプト

使い道があるかわかりませんが、任意の間隔で再起動を繰り返すスクリプトを作成しました。

使用方法
  1. event timer countdown time に任意の時間(秒)を設定する。
  2. スクリプトを開始する際は、特権モードで[start]と入力し実行する。
  3. 次に特権モードで[restart]と入力し実行する。※再起動します。
  4. スクリプトを停止する際は、特権モードで[stop]と入力し実行する。
設定方法

監視用 Loopback インターフェースの作成

interface Loopback0
 ip address 1.1.1.1 255.255.255.0

監視用 SLA と Track の定義

ip sla 1
 icmp-echo 1.1.1.1 source-interface Loopback0
ip sla schedule 1 life forever start-time now
track 1 ip sla 1
 delay up 10

実行コマンドの定義

alias exec restart event manager run restart
alias exec stop event manager run stop
alias exec start event manager run start

再起動用 EEM の作成

event manager applet restart
 event none
 action 1.0 syslog msg "Router will restart by itself."
 action 2.0 reload

タイマー用 EEM の作成

event manager applet timer
 event track 1 state up
 action 1.0 cli command "enable"
 action 1.1 cli command "conf t"
 action 1.2 cli command "event manager applet restart"
 action 1.3 cli command "event timer countdown time 180"
 action 1.4 cli command "end"

スクリプト開始用 EEM の作成

event manager applet start
 event none
 action 1.0 cli command "enable"
 action 1.1 cli command "conf t"
 action 1.2 cli command "interface loopback0"
 action 1.3 cli command "no shutdown"
 action 1.4 cli command "end"
 action 1.5 cli command "wr"

スクリプト停止用 EEM の作成

event manager applet stop
 event none
 action 1.0 cli command "enable"
 action 1.1 cli command "conf t"
 action 1.2 cli command "interface loopback0"
 action 1.3 cli command "shutdown"
 action 1.4 cli command "event manager applet restart"
 action 1.5 cli command "event none"
 action 1.6 cli command "end"
 action 1.7 cli command "wr"

以上

BIG-IP のヘルスチェックで User-Agent を定義する

User-Agent ヘッダについて

Web サーバと HTTP/HTTPS で通信する Web ブラウザやアプリ、クローラーといったクライアントプログラムは、Web サーバにリクエストを送る際、自身の「素性」を表す情報も同時に送信する。そのために使われるヘッダを「User-Agent ヘッダ」と呼ぶ。また「素性」を表した文字列のことを、「ユーザーエージェント文字列」と呼ぶ。
f:id:FriendsNow:20210224214428p:plain:w600
出典:@IT

ヘルスチェックで User-Agent を設定

BIG-IP では HTTP のヘルスチェックに User-Agent を定義する事が可能です。

Monitor の作成

User-Agent が定義された monitor1 を作成

(tmos)# create ltm monitor http monitor1
(tmos)# modify ltm monitor http monitor1 destination *:* interval 5 recv "200 OK" send "GET / HTTP/1.0\\r\\nUser-agent: User-Agent-Test\\r\\n\\r\\n" time-until-up 0 timeout 16

Monitor の確認

(tmos)# show running-config ltm monitor
ltm monitor http monitor1 {
    defaults-from http
    destination *:*
    interval 5
    recv "200 OK"
    send "GET / HTTP/1.0\\r\\nUser-agent: User-Agent-Test\\r\\n\\r\\n"
    time-until-up 0
    timeout 16
}

GUI で設定する場合は下記のとおり
f:id:FriendsNow:20140515113347p:plain

Pool の作成

Pool 作成と monitor1 の関連付け

(tmos)# create ltm pool pool1
(tmos)# modify ltm pool pool1 members add { 192.168.100.1:http { address 192.168.100.1 } } monitor monitor1

Pool の確認

(tmos)# show running-config ltm pool pool1
ltm pool pool1 {
    members {
        192.168.100.1:http {
            address 192.168.100.1
            session monitor-enabled
            state up
        }
    }
    monitor monitor1
}

サーバで User-Agent が定義された HTTP リクエストを受信している事を確認

> tcpdump -i eth1 -s 1024 -A dst 192.168.100.1 and port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 1024 bytes
08:17:12.102234 IP 192.168.100.254.56048 > 192.168.100.1.http: S 3813966378:3813966378(0) win 14600 <mss 1460,sackOK,timestamp 4216260931 0,nop,wscale 7>
E..<.4@.@.j7..d...d....P.T.*......9..T.........
.O      C........
08:17:12.145874 IP 192.168.100.254.56048 > 192.168.100.1.http: . ack 3041341077 win 115 <nop,nop,timestamp 4216260950 2122782>
E..4.5@.@.j>..d...d....P.T.+.G.....s.w.....
.O      V. d.
08:17:12.145882 IP 192.168.100.254.56048 > 192.168.100.1.http: P 0:47(47) ack 1 win 115 <nop,nop,timestamp 4216260950 2122782>
E..c.6@.@.j...d...d....P.T.+.G.....s.......
.O      V. d.GET / HTTP/1.0
User-agent: User-Agent-Test  <--- BIG-IP で定義した文字列を確認

以上

便利なスクリプト(CentOS)

Ping を実行した際、Windows のように"Request Timed out"を表示させる。

[root@hostname ~]# host=***.***.***.***; max_cnt=10; cnt=0; while [ $cnt -le $max_cnt ]; do rslt=`ping -w 1 -c 1 $host | grep 'bytes from '`; if [ $? -gt 0 ]; then echo -e "`date +'%H:%M:%S'` $host Request timed out."; else echo "`date +'%H:%M:%S'` $host`echo $rslt | cut -d  ':' -f 2`"; sleep 1; fi; cnt=$(expr $cnt + 1); done;

任意のコマンド(例:df -h)を 5秒間隔で繰り返し実行する。

[username@hostname]$ while true; do date; df -h; sleep 5; clear; done;

参考:http://sonic64.com/2004-05-28.html

以上

Junos Shaping 設定

Junos の Shaping 機能についてテストした際の備忘録です。スループット測定は iperf を使用しました。

iperf の準備

epel リポジトリインストール

# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
# rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

iperf インストール

# yum install -y iperf

iperf 起動(サーバ側:192.168.100.1)

# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
スループット測定

Shaping 設定前

# iperf -c 192.168.100.1
------------------------------------------------------------
Client connecting to 192.168.100.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 100.64.1.1 port 38985 connected with 192.168.100.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   845 MBytes   708 Mbits/sec

Shaping(200Mbps)設定後

# iperf -c 192.168.100.1
------------------------------------------------------------
Client connecting to 192.168.100.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 100.64.1.1 port 36607 connected with 192.168.100.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   221 MBytes   185 Mbits/sec
Junos Shaping 設定例
# set class-of-service interfaces ge-0/0/1 scheduler-map Smap_Shaping
# set class-of-service scheduler-maps Smap_Shaping forwarding-class best-effort scheduler Shaping
# set class-of-service scheduler-maps Smap_Shaping forwarding-class expedited-forwarding scheduler Shaping
# set class-of-service scheduler-maps Smap_Shaping forwarding-class assured-forwarding scheduler Shaping
# set class-of-service scheduler-maps Smap_Shaping forwarding-class network-control scheduler Shaping
# set class-of-service schedulers Shaping shaping-rate 300m
# set class-of-service schedulers Shaping priority low