LoginSignup
1
0

More than 5 years have passed since last update.

NetApp Data ONTAP device moduleを使ってNetAppの初期設定作業をPuppet化してみた

Last updated at Posted at 2019-02-27

Puppet社が公開しているNetApp Data ONTAP device moduleの検証メモです。この記事ではData ONTAP SimulatorをVirtualBox上にディプロイして検証しています。

環境

  • Puppet MasterのOS : CentOS7
  • Puppet AgentのOS : CentOS7
  • Puppet : 6.0.5
  • Data ONTAP Simulator : 8.3
  • NetApp Manageability SDK : 5.7
  • Vagrant : 2.2.3
  • VirtualBox : 6.0.4

準備

ダウンロード

NetApp社のサイトからNetApp Manageability SDKをダウンロードします。事前にアカウント登録が必要です。

同じサイトからSimulate ONTAP 8.3 for VMware Workstation, VMware Player, and VMware FusionとCMode_licenses_8.3.txt をダウンロードします。ESXi版のovaと間違えないように注意が必要です。

Puppet社のサイトからPuppet Enterpriseをダウンロードします。

Puppetのセットアップ

Master側でダウンロード済みのPuppet Enterpriseのインストールバイナリを解いてインストールスクリプトを実行します。

$ sudo ./puppet-enterprise-installer
どのように続行しますか? [1]: 1
省略
## Puppet Enterpriseの設定が完了しました!

puppetを実行してインストールは完了です。

$ sudo /opt/puppetlabs/bin/puppet agent -t

Agent側でAgentのインストールスクリプトを実行します。

$ curl -k https:<Puppet Masterのホスト名>:8140/packages/current/install.bash | sudo bash

Agent側でpuppetを実行してMasterに証明書のサインを要求します。

 sudo /opt/puppetlabs/bin/puppet agent -t

Master側で証明書にサインします。

$ sudo /opt/puppetlabs/bin/puppetserver ca sign --all
Successfully signed certificate request for device-proxy.puppet.com

再度Agent側でpuppetを実行します。エラーが出なければ成功です。

$ sudo /opt/puppetlabs/bin/puppet agent -t

NetApp Data ONTAP device moduleをMaster/Agent側両方にインストールします。

$ sudo puppet module install puppetlabs-netapp --version 1.3.0 --modulepath /etc/puppetlabs/code/environments/production/modules/
Notice: /etc/puppetlabs/code/environments/production/modulesへのインストールを準備をしています ...
Notice: https://forgeapi.puppet.comからダウンロードしています ...
Notice: インストール中 -- 中断しないでください ...
/etc/puppetlabs/code/environments/production/modules
└── puppetlabs-netapp (v1.3.0)

ダウンロード済みのNetApp Manageability SDKをほどいてnetapp-manageability-sdk-5.7/lib/ruby/NetApp配下にある4つのファイルをAgent側の/etc/puppetlabs/code/environments/production/modules/netapp/lib/puppet/netapp_sdkにコピーします。

$ cp ./netapp-manageability-sdk-5.7/lib/ruby/NetApp/* /etc/puppetlabs/code/environments/production/modules/netapp/lib/puppet/netapp_sdk

Master側でpuppet.confの最終行に autosign = true を追記して、autosign.confに対象のホスト名を追記します。

$ sudo vi /etc/puppetlabs/puppet/puppet.conf
--省略--
[master]
autosign = true
$ sudo vi ~/.puppetlabs/etc/puppet/autosign.conf
ontap
puppetsvm

Data ONTAP Simulatorのセットアップ

GitHubのリポジトリをクローンします。

$ git clone git@github.com:tlichten/vagrant-vsim.git

ダウンロード済みのNetApp Manageability SDKをほどかずにzipファイルのままコピーします。

$ cp netapp-manageability-sdk-5.7.zip ./vagrant-vsim

ダウンロード済みのSimulate ONTAP 8.3 for VMware Workstation, VMware Player, and VMware Fusionをコピーします。

$ cp vsim-netapp-DOT8.3-cm.ova ./vagrant-vsim

vsim.confを編集してライセンスキーを貼り付けます。ライセンスキーはダウンロード済みのCMode_licenses_8.3.txt:21行目に書いてあります。

$ vi vsim.conf
--省略--
CLUSTER_BASE_LICENSE="xxx"

$ 起動します。エラーが出なければ成功です。

$ vagrant up

$ Cluster ONTAPのノード管理コンソールにログインしてみます。VSIM::>というプロンプトが出れば成功です。

$ vagrant ssh vsim
VSIM::>

動作確認

Agent側でdevice.confを編集してData ONTAPの接続情報を記載します。

$ sudo vi /etc/puppetlabs/puppet/device.conf
[ontap]
type netapp
url https://admin:netapp123@VSIM-01

Master側でData ONTAPのノードからStorage Virtual Machineを作成するマニフェストを作成します。

$ sudo vi /etc/puppetlabs/code/environments/production/manifests/site.pp
node 'ontap' {
  netapp_aggregate { 'puppetaggr1':
    ensure    => present,
    diskcount => '8',
    raidtype => 'raid_dp',
    nodes => ['VSIM-01']
  }

  netapp_vserver { 'puppetsvm':
    ensure          => present,
    rootvol         => 'puppetsvm_root',
    rootvolaggr     => 'puppetaggr1',
    rootvolsecstyle => 'unix',
    allowedprotos   => 'nfs',
    state           => 'running'
  }

  netapp_security_login {'ssh:password:vsadmin:puppetsvm':
    ensure    => present,
    password  => 'netapp123',
    role_name => 'vsadmin',
    is_locked => false
  }

  netapp_lif { 'puppet_lif':
    ensure        => present,
    role          => 'data',
    homeport      => 'e0c',
    homenode      => 'VSIM-01',
    address       => '10.0.207.5',
    vserver       => 'puppetsvm',
    netmask       => '255.255.255.0',
    dataprotocols => ['nfs']
  }
}

Agent側でPuppetを実行してマニフェストを適用します。

$ sudo RUBYLIB=/etc/puppetlabs/code/environments/production/modules/netapp/lib/puppet/netapp_sdk puppet device --verbose
--省略--
Info: Node[ontap]: Unscheduling all events on Node[ontap]
Notice: Applied catalog in 0.93 seconds

Data ONTAPの管理コンソールにログインしてマニフェストの通りにリソースが作成されたか確認します。

VSIM::> aggr show

Aggregate     Size Available Used% State   #Vols  Nodes            RAID Status
--------- -------- --------- ----- ------- ------ ---------------- ------------
aggr0        855MB   35.97MB   96% online       1 VSIM-01          raid_dp,
                                                                   normal
puppetaggr1 5.27GB    3.24GB   39% online       2 VSIM-01          raid_dp,
                                                                   normal
2 entries were displayed.

VSIM::> vserver show
                               Admin      Operational Root
Vserver     Type    Subtype    State      State       Volume     Aggregate
----------- ------- ---------- ---------- ----------- ---------- ----------
VSIM        admin   -          -          -           -          -
VSIM-01     node    -          -          -           -          -
puppetsvm   data    default    running    running     puppetsvm_ puppetaggr
                                                      root       1
3 entries were displayed.

VSIM::> security login show

Vserver: VSIM
                             Authentication                  Acct
User/Group Name  Application Method         Role Name        Locked
---------------- ----------- -------------- ---------------- ------
admin            console     password       admin            no
admin            http        password       admin            no
admin            ontapi      password       admin            no
admin            service-processor
                             password       admin            no
autosupport      console     password       autosupport      no
vagrant          ontapi      password       admin            no
vagrant          ssh         password       admin            no
vagrant          ssh         publickey      admin            -

Vserver: puppetsvm
                             Authentication                  Acct
User/Group Name  Application Method         Role Name        Locked
---------------- ----------- -------------- ---------------- ------
vsadmin          ontapi      password       vsadmin          yes
vsadmin          ssh         password       vsadmin          yes
10 entries were displayed.

VSIM::> network interface show
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
VSIM
            VSIM-01_mgmt_auto
                         up/up    10.0.207.3/24      VSIM-01       e0c     true
puppetsvm
            puppet_lif   up/up    10.0.207.5/24      VSIM-01       e0c     true
2 entries were displayed.
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0