Quantcast
Channel: VMware Communities : Blog List - All Communities
Viewing all 3135 articles
Browse latest View live

HCIBench の OVA を PowerCLI でデプロイする。

$
0
0

HCIBench は vSAN などのテスト自動化をするためには便利です。

 

HCIBench

https://labs.vmware.com/flings/hcibench

 

しかし、複数のテストを並行させたり、複数の環境設定を保持したりといった使い方には

あまり向かないように感じます。実際にベンチマーク テストを実行する場合には、

テストの目的や利用者ごとに HCIBench 仮想アプライアンス(OVA)を

デプロイするケースがあると思います。

 

そこで、少しでもデプロイ作業を簡略化すべく、

PowerCLI で HCIBench の OVA をデプロイしてみました。

ちょうど HCIBench v1.6.6 が公開されたのでデプロイしてみます。

 

OVA ファイルは、HCIBench_1.6.6.ova を利用します。

 

今回使用するコマンドの PowerCLI モジュールはバージョン 10.0 のものです。

PowerCLI> Get-Command Get-OvfConfiguration,Import-VApp | select Name,Module,Version

 

Name                 Module                    Version

----                 ------                    -------

Get-OvfConfiguration VMware.VimAutomation.Core 10.0.0.7893909

Import-VApp          VMware.VimAutomation.Core 10.0.0.7893909

 

 

コマンドライン実行での PowerCLI デプロイ。

Get-OvfConfiguration の実行のためには、まず vCenter に接続します。
「vc-sv01.go-lab.jp」は今回のデプロイ先 vCenter です。

PowerCLI> Connect-VIServer vc-sv01.go-lab.jp -Force

 

OVF を設定するための準備をします。

PowerCLI> $ovf_config = Get-OvfConfiguration -Ovf D:\VMware\HCIBench_1.6.6.ova

PowerCLI> $ovf_config

 

====================================

OvfConfiguration: HCIBench_1.6.6.ova

 

   Properties:

   -----------

   Common

   NetworkMapping

 

 

下記のようなパラメータが必要だとわかります。

PowerCLI> $ovf_config.Common

 

Public_Network_Gateway :

Public_Network_IP      :

DNS                    :

Public_Network_Netmask :

Public_Network_Type    :

System_Password        :

 

PowerCLI> $ovf_config.NetworkMapping | fl

 

Public_Network  :

Private_Network :

 

 

今回のデプロイで指定するオブジェクトが存在しているか、事前に確認しておきます。

対象のオブジェクトがあれば Ture、なければ False です。

必要に応じて、ESXi はメンテナンスモードが解除されているか、

他にも必要なオブジェクト(クラスタ、リソースプール、フォルダなど)が作成されているか

といった確認を追加するとさらに確実になります。

PowerCLI> Get-VMHost hv-d02.go-lab.jp -ErrorAction:SilentlyContinue | Out-Null; echo $?

True

PowerCLI> Get-VMHost hv-d02.go-lab.jp | Get-VirtualPortGroup -Name "VM Network" -ErrorAction:SilentlyContinue | Out-Null; echo $?

True

PowerCLI> Get-VMHost hv-d02.go-lab.jp | Get-VirtualPortGroup -Name "pg-vlan-1012" -ErrorAction:SilentlyContinue | Out-Null; echo $?

True

PowerCLI> Get-VMHost hv-d02.go-lab.jp | Get-Datastore ds_hv-d02_01 -ErrorAction:SilentlyContinue | Out-Null; echo $?

True

 

ここから、vSphere Web Client からのデプロイでは下記のように指定していたパラメータを

PowerCLI で指定していきます。

hci-bench-powercli-deploy-00.png

 

OVF のパラメータを設定します。

PowerCLI> $ovf_config.NetworkMapping.Public_Network.Value = "VM Network"

PowerCLI> $ovf_config.NetworkMapping.Private_Network.Value = "pg-vlan-1012"

PowerCLI> $ovf_config.Common.DNS.Value = "192.168.1.254"

PowerCLI> $ovf_config.Common.Public_Network_Gateway.Value = "192.168.1.1"

PowerCLI> $ovf_config.Common.Public_Network_IP.Value = "192.168.1.119"

PowerCLI> $ovf_config.Common.Public_Network_Netmask.Value = "255.255.255.0"

PowerCLI> $ovf_config.Common.Public_Network_Type.Value = "Static"

PowerCLI> $ovf_config.Common.System_Password.Value = "VMware1!"

 

パラメータがひととおり設定されたことを確認できます。

PowerCLI> $ovf_config.Common

 

Public_Network_Gateway : 192.168.1.1

Public_Network_IP      : 192.168.1.119

DNS                    : 192.168.1.254

Public_Network_Netmask : 255.255.255.0

Public_Network_Type    : Static

System_Password        : VMware1!

 

PowerCLI> $ovf_config.NetworkMapping | fl

 

Public_Network  : VM Network

Private_Network : pg-vlan-1012

 

 

OVA をデプロイします。

hci-bench02 という名前で、ESXi「hv-d02.go-lab.jp」のデータストア「ds_hv-d02_01」にデプロイします。

PowerCLI> Import-VApp -Name hci-bench02 -OvfConfiguration $ovf_config -Source $ovf_config.Source -VMHost hv-d02.go-lab.jp -Datastore ds_hv-d02_01 -StorageFormat Thin

 

デプロイが完了したら HCIBench を起動します。

PowerCLI> Get-VM hci-bench02 | Start-VM

 

Name                 PowerState Num CPUs MemoryGB

----                 ---------- -------- --------

hci-bench02          PoweredOn  8        8.000

 

 

このあと、Web ブラウザでアクセスして・・・

hci-bench-powercli-deploy-01.png

 

HCIBench の Web UI での設定にすすみます。

hci-bench-powercli-deploy-02.png

 

Web UI からの設定は、vExpert の kawaman さんの投稿がとても参考になります。

https://community.emc.com/people/kawaman/blog/2017/12/17/hcibench-vsan-performancetest

 

デプロイ スクリプトのサンプル。

ここまでのコマンドラインをスクリプトにまとめておくと、

同環境や、類似した環境での 2度目以降のデプロイを簡略化できるようになります。

 

今回は、下記のようなスクリプトを作成してみました。

※自宅ラボむけに目的を絞って簡易的に作成しています。

deploy_hci-bench-ova.ps1 · GitHub

# HCIBench OVA Deploy Script.

#

# Public_Network_Type は "Static" で固定。

# vCenter に接続するが、デプロイ先は ESXi を指定する。

# Usage:

#   PowerCLI> .\deploy_hci-bench-ova.ps1

 

# ------------------------------

# Setting

$ova_file_path           = "D:\VMware\HCIBench_1.6.6.ova"

$vm_name                 = "hci-bench02"

$target_vc               = "vc-sv01.go-lab.jp"

$target_esxi             = "hv-d02.go-lab.jp"

$target_pg_public        = "VM Network"

$target_pg_private       = "pg-vlan-1012"

$target_datastore        = "ds_hv-d02_01"

 

$public_network_ip       = "192.168.1.119"

$public_network_netmask  = "255.255.255.0"

$public_network_gateway  = "192.168.1.1"

$dns                     = "192.168.1.254"

 

$ova_root_password       = "VMware1!"

 

# ------------------------------

# connect VC & get OVF config.

Connect-VIServer $target_vc -Force

$ovf_config = Get-OvfConfiguration -Ovf $ova_file_path

 

# ------------------------------

# Pre Check

$pre_check = "ok"

$hv = Get-VMHost $target_esxi -ErrorAction:SilentlyContinue

$hv | Out-Null; echo $?

if($? -ne $true){"デプロイ先 ESXi を確認して下さい。"; $pre_check = "NG"}

$hv | Get-VirtualPortGroup -Name $target_pg_public -ErrorAction:SilentlyContinue | Out-Null; echo $?

if($? -ne $true){"デプロイ先 Public PG を確認して下さい。"; $pre_check = "NG"}

$hv | Get-VirtualPortGroup -Name $target_pg_private -ErrorAction:SilentlyContinue | Out-Null; echo $?

if($? -ne $true){"デプロイ先 Private PG を確認して下さい。"; $pre_check = "NG"}

$hv | Get-Datastore $target_datastore -ErrorAction:SilentlyContinue | Out-Null; echo $?

if($? -ne $true){"デプロイ先 Datastore を確認して下さい。"; $pre_check = "NG"}

 

if($pre_check -ne "ok"){"デプロイを実行せず終了します。"; exit 1}

 

# ------------------------------

# Configure & Deploy

$ovf_config.Common.Public_Network_Type.Value = "Static"

$ovf_config.NetworkMapping.Public_Network.Value = $target_pg_public

$ovf_config.NetworkMapping.Private_Network.Value = $target_pg_private

$ovf_config.Common.Public_Network_IP.Value = $public_network_ip

$ovf_config.Common.Public_Network_Netmask.Value = $public_network_netmask

$ovf_config.Common.Public_Network_Gateway.Value = $public_network_gateway

$ovf_config.Common.DNS.Value = $dns

$ovf_config.Common.System_Password.Value = $ova_root_password

 

Import-VApp -OvfConfiguration $ovf_config -Source $ovf_config.Source `

    -Name $vm_name `

    -VMHost $target_esxi `

    -Datastore $target_datastore -StorageFormat Thin |

    select Name,PowerState

 

Get-VM $vm_name | Start-VM | select Name,PowerState

 

Disconnect-VIServer $target_vc -Confirm:$false

 

そして、下記のように実行すると、以前のコマンドラインと同じデプロイが実施できます。

PowerCLI> .\deploy_hci-bench-ova.ps1

 

OVA のデプロイ作業の記録をテキスト形式で残せるようになるので、

作業内容の確認もしやすくなるかもしれません。

 

以上、HCIBench を PowerCLI でデプロイしてみる話でした。


Everything Is Not The Same Application Data Value Characteristics

$
0
0

Everything Is Not The Same Application Data Value Characteristics

 

This is part one of a five-part mini-series looking at Application Data Value Characteristics Everything Is Not The Same as a companion excerpt from  chapter 2 of my new book Software Defined Data Infrastructure  Essentials – Cloud, Converged and Virtual Fundamental Server Storage I/O  Tradecraft (CRC Press 2017). available at Amazon.com and other global venues. In  this post, we start things off by looking at general application server storage I/O characteristics that have an impact on data value as well as access.

 

Application Data Value Software Defined Data Infrastructure Essentials Book SDDC

 

Everything is not the same across different organizations including Information Technology  (IT) data centers, data infrastructures along with the applications as well as data they support. For example, there is so-called big data that can be many small files, objects, blobs or data and bit streams representing telemetry,  click stream analytics, logs among other information.

Keep in mind that applications impact how data is accessed, used, processed, moved and stored. What this means is that a focus on data value, access patterns, along with other related topics need to also consider application performance, availability, capacity, economic (PACE) attributes.

 

If everything is not the same, why is so much data along with many applications treated the same from a PACE perspective?

 

Data Infrastructure resources including servers, storage, networks might be cheap or inexpensive, however, there is a cost to managing them along with data.

 

Managing includes data protection (backup, restore, BC, DR, HA, security) along with other activities. Likewise, there is a cost to the software along with cloud services among others. By understanding how applications use and interact with data, smarter, more informed data management decisions can be made.

 

IT Applications and Data Infrastructure Layers
IT Applications and Data Infrastructure Layers

 

Keep in mind that everything is not the same across various  organizations, data centers, data  infrastructures, data and the applications that use them. Also keep in mind  that programs (e.g. applications) = algorithms (code) + data structures (how  data defined and organized, structured or unstructured).

 

There  are traditional applications, along with those tied to Internet of Things  (IoT), Artificial Intelligence (AI) and Machine Learning (ML), Big Data and  other analytics including real-time click stream, media and entertainment,  security and surveillance, log and telemetry processing among many others.

 

What  this means is that there are many different application with various character  attributes along with resource (server compute, I/O network and memory, storage  requirements) along with service requirements.

 

Common Applications Characteristics

Different  applications will have various attributes,  in general, as well as how they are used,  for example, database transaction  activity vs. reporting or analytics, logs and journals vs. redo logs, indices, tables, indices, import/export, scratch and temp space. Performance,  availability, capacity, and economics (PACE) describes the applications and  data characters and needs shown in the  following figure.

 

Application and data PACE attributes
Application PACE attributes (via Software Defined Data Infrastructure  Essentials)

 

All applications have PACE attributes, however:

  • PACE attributes vary by  application and usage
  • Some applications and their data  are more active than others
  • PACE characteristics may vary within different parts of an application

 

Think of applications along with associated data PACE as its  personality or how it behaves, what it does, how it does it, and when, along  with value, benefit, or cost as well as quality-of-service (QoS) attributes.

 

Understanding applications in different environments, including  data values and associated PACE attributes, is essential for making informed  server, storage, I/O decisions and data infrastructure decisions. Data  infrastructures decisions range from configuration to acquisitions or upgrades,  when, where, why, and how to protect, and how to optimize performance including  capacity planning, reporting, and troubleshooting, not to mention addressing  budget concerns.

 

Primary PACE attributes for active and inactive applications and data are:

P - Performance  and activity (how things get used)
A - Availability and durability (resiliency and data protection)
C - Capacity and space (what things use or occupy)
E - Economics  and Energy (people, budgets, and other  barriers)

 

Some applications need more performance (server computer,  or storage and network I/O), while others need space capacity (storage, memory,  network, or I/O connectivity). Likewise,  some applications have different availability needs (data protection,  durability, security, resiliency, backup,  business continuity, disaster recovery) that determine the tools, technologies, and techniques to use.

 

Budgets are also nearly always a concern, which for some applications means enabling more performance per cost while others are focused on maximizing space capacity and protection level per cost. PACE attributes also  define or influence policies for QoS (performance, availability, capacity), as well as thresholds, limits, quotas,  retention, and disposition, among others.

 

Performance and Activity (How Resources Get Used)

Some applications or components that comprise a larger solution will have more performance demands than others. Likewise,  the performance characteristics of applications along with their associated data will also vary. Performance applies to the server,  storage, and I/O networking hardware along with associated software and applications.

 

For servers, performance is focused on how much CPU  or processor time is used, along with memory and I/O operations. I/O operations to create, read, update, or delete  (CRUD) data include activity rate (frequency or data velocity) of I/O operations  (IOPS). Other considerations include the volume or amount of data being moved (bandwidth, throughput,  transfer), response time or latency, along with queue depths.

 

Activity is the amount of work to do or being done in a given amount of time (seconds, minutes, hours, days, weeks), which can be transactions, rates, IOPs. Additional performance considerations include latency, bandwidth, throughput, response time,  queues, reads or writes, gets or puts, updates, lists, directories, searches,  pages views, files opened, videos viewed, or downloads.
  
  Server,  storage, and I/O network performance include:

  • Processor CPU usage time and  queues (user and system overhead)
  • Memory usage effectiveness  including page and swap
  • I/O activity including between  servers and storage
  • Errors, retransmission, retries, and rebuilds

 

the  following figure shows a generic performance example of data being accessed  (mixed reads, writes, random, sequential, big, small, low and high-latency) on a local and a remote basis. The example  shows how for a given time interval (see lower right), applications are  accessing and working with data via different data streams in the larger image  left center. Also shown are queues and I/O handling along with end-to-end (E2E)  response time.

 

fundamental server storage I/O
Server I/O performance  fundamentals (via Software Defined  Data Infrastructure Essentials)

 

Click here to view a larger version of the above figure.

 

Also shown on the left in the above figure is an example of  E2E response time from the application through the various data infrastructure  layers, as well as, lower center, the response time from the server to the memory  or storage devices.

 

Various queues are shown in the middle of  the above figure which are indicators of how much work is occurring, if the processing is keeping up with  the work or causing backlogs. Context is  needed for queues, as they exist in the  server, I/O networking devices, and software drivers, as well as in storage  among other locations.

 

Some  basic server, storage, I/O metrics that matter include:

  • Queue depth of I/Os waiting to be processed and concurrency
  • CPU and memory usage to process  I/Os
  • I/O size, or how much data can be moved in a given operation
  • I/O activity rate or IOPs =  amount of data moved/I/O size per unit of time
  • Bandwidth = data moved per unit  of time = I/O size × I/O rate
  • Latency usually increases with  larger I/O sizes, decreases with smaller requests
  • I/O rates usually increase with  smaller I/O sizes and vice versa
  • Bandwidth increases with larger  I/O sizes and vice versa
  • Sequential stream access data  may have better performance than some random access data
  • Not all data is conducive to  being sequential stream, or random
  • Lower response  time is better, higher activity rates and bandwidth are better

 

Queues  with high latency and small I/O size or small I/O rates could indicate a  performance bottleneck. Queues with low latency and high I/O rates with good bandwidth  or data being moved could be a good  thing. An important note is to look at several metrics, not just IOPs or  activity, or bandwidth, queues, or response time. Also, keep in mind that metrics that matter for your environment  may be different from those for somebody else.

 

Something to keep in perspective is that there can be a large amount  of data with low performance, or a small  amount of data with high-performance, not to mention many other variations. The  important concept is that as space capacity scales, that does not mean  performance also improves or vice versa, after all, everything is not the same.

Where to learn more

Learn more about Application Data Value, application characteristics, PACE along with data protection, software defined data center (SDDC), software defined data infrastructures (SDDI)  and related topics via the following links:

https://storageioblog.com/data-infrastructure-primer-overview/

 

SDDC Data Infrastructure

 

Additional learning experiences along with common questions (and answers), as well as tips can be found in Software Defined Data Infrastructure Essentials book.

 

Software Defined Data Infrastructure Essentials Book SDDC

What this all means and wrap-up

Keep in mind that with Application Data Value Characteristics Everything Is Not The Same across various  organizations, data centers, data infrastructures spanning legacy, cloud and other software defined data center (SDDC) environments. However all applications have some element (high or low) of performance, availability, capacity, economic (PACE) along with various similarities. Likewise data has different value at various times. Continue reading the next post (Part II Application Data Availability  Everything Is Not The Same) in this five-part mini-series here.

 

Ok, nuff said, for now.

Gs

4 3 2 1 Application Data Protection Availability

$
0
0

This is part two of a five-part mini-series looking at Application Data Value Characteristics everything is not the same as a companion excerpt from  chapter 2 of my new book Software Defined Data Infrastructure  Essentials – Cloud, Converged and Virtual Fundamental Server Storage I/O  Tradecraft (CRC Press 2017). available at Amazon.com and other global venues. In  this post, we continue looking at application performance, availability, capacity, economic (PACE) attributes that have an impact on data value as well as availability.

 

4 3 2 1 data protection  Book SDDC

Availability (Accessibility, Durability, Consistency)

Just as  there are many different aspects and focus areas for performance, there are also several facets to availability. Note that applications  performance requires availability and availability relies  on some level of performance.

 

Availability is a broad and encompassing area that includes data protection to  protect, preserve, and serve (backup/restore, archive, BC, BR, DR, HA) data and  applications. There are logical and physical aspects of availability including  data protection as well as security including key management (manage your keys  or authentication and certificates) and permissions, among other things.

 

Availability  = accessibility (can you get to your application and data) + durability (is the  data intact and consistent). This includes  basic Reliability, Availability, Serviceability (RAS), as well as high  availability, accessibility, and durability. “Durable”  has multiple meanings, so context is  important. Durable means how data infrastructure resources hold up to, survive,  and tolerate wear and tear from use (i.e., endurance), for example, Flash SSD or mechanical devices such as Hard Disk  Drives (HDDs). Another context for durable refers to data, meaning how many  copies in various places.

 

Server,  storage, and I/O network availability topics include:

  • Resiliency and self-healing to tolerate  failure or disruption
  • Hardware, software, and services  configured for resiliency
  • Accessibility to reach or be reached for handling work
  • Durability and consistency of  data to be available for access
  • Protection of data, applications, and assets including security

 

Additional server  I/O and data infrastructure along with storage topics include:

  • Backup/restore, replication,  snapshots, sync, and copies
  • Basic Reliability, Availability, Serviceability, HA, fail over, BC,  BR, and DR
  • Alternative paths, redundant components, and associated software
  • Applications that are fault-tolerant,  resilient, and self-healing
  • Non disruptive upgrades, code (application  or software) loads, and activation
  • Immediate data consistency and  integrity vs. eventual consistency
  • Virus, malware, and other data corruption or loss prevention

 

From a data protection standpoint, the fundamental rule or guideline is 4 3 2 1, which means  having at least four copies consisting of at least three versions (different  points in time), at least two of which are on different systems or storage  devices and at least one of those is off-site (on-line, off-line, cloud, or  other). There are  many variations of the 4 3 2 1 rule shown  in the following figure along with approaches on how to manage technology to  use. We will go into deeper this subject in later chapters. For now, remember the following.

 

large version application server storage I/O
4 3 2 1 data protection (via Software Defined Data Infrastructure  Essentials)

 

1    At  least four copies of data (or more), Enables durability in case a copy goes  bad, deleted, corrupted, failed device, or site.
2    The  number (or more) versions of the data to retain, Enables various recovery  points in time to restore, resume, restart from.
3    Data  located on two or more systems (devices or media/mediums), Enables protection  against device, system, server, file  system, or other fault/failure.

4    With  at least one of those copies being off-premise and not live (isolated from  active primary copy), Enables resiliency across sites, as well as space, time,  distance gap for protection.

Capacity and Space (What Gets Consumed and Occupied)

In  addition to being available and accessible in a timely manner (performance),  data (and applications) occupy space. That space is memory in servers, as well as using available consumable processor  CPU time along with I/O (performance) including over networks.

 

Data  and applications also consume storage space where they are stored. In addition to basic data space, there is also space  consumed for metadata as well as protection copies (and overhead), application  settings, logs, and other items. Another aspect of capacity includes network IP  ports and addresses, software licenses, server, storage, and network bandwidth  or service time.

 

Server,  storage, and I/O network capacity topics include:

  • Consumable time-expiring  resources (processor time, I/O, network bandwidth)
  • Network IP and other addresses
  • Physical resources of servers,  storage, and I/O networking devices
  • Software licenses based on  consumption or number of users
  • Primary and protection copies of  data and applications
  • Active and standby data infrastructure  resources and sites
  • Data  footprint reduction (DFR) tools and techniques for space optimization
  • Policies, quotas, thresholds,  limits, and capacity QoS
  • Application and database  optimization

 

DFR includes various techniques,  technologies, and tools to reduce the impact or overhead of protecting, preserving,  and serving more data for longer periods of time. There are many different  approaches to implementing a DFR strategy,  since there are various applications and data.

 

Common DFR  techniques and technologies include archiving, backup modernization, copy data management  (CDM), clean up, compress, and consolidate, data  management, deletion and dedupe, storage tiering, RAID (including parity-based, erasure codes , local reconstruction codes [LRC] , and Reed-Solomon , Ceph Shingled Erasure Code (SHEC ), among  others), along with protection configurations along with thin-provisioning,  among others.

 

DFR can be implemented in various  complementary locations from row-level compression in database or email to  normalized databases, to file systems, operating systems, appliances, and  storage systems using various techniques.

 

Also, keep in mind that not all data is the same; some is sparse, some is dense, some can be compressed  or deduped while others cannot. Likewise,  some data may not be compressible or dedupable.  However, identical copies can be  identified with links created to a common copy.

Economics (People, Budgets, Energy and other Constraints)

If one thing in life and  technology that is constant is change, then  the other constant is concern about economics  or costs. There is a cost to enable and maintain a data infrastructure on  premise or in the cloud, which exists to protect, preserve, and serve data and  information applications.

 

However, there should also be a benefit to having the data infrastructure  to house data and support applications that provide information to users of the  services. A common economic focus is what something costs, either as up-front  capital expenditure (CapEx) or as an operating expenditure (OpEx) expense,  along with recurring fees.

 

In general, economic considerations  include:

  • Budgets (CapEx and  OpEx), both up front and in recurring fees
  • Whether you buy,  lease, rent, subscribe, or use free and open sources
  • People time needed to integrate  and support even free open-source software
  • Costs including hardware,  software, services, power, cooling, facilities, tools
  • People time includes  base salary, benefits, training and education

Where to learn more

Learn more about Application Data Value, application characteristics, PACE along with data protection, software defined data center (SDDC), software defined data infrastructures (SDDI)  and related topics via the following links:

 

https://storageioblog.com/data-infrastructure-primer-overview/

https://storageioblog.com/data-infrastructure-primer-overview/

https://storageioblog.com/data-infrastructure-primer-overview/

SDDC Data Infrastructure

 

Additional learning experiences along with common questions (and answers), as well as tips can be found in Software Defined Data Infrastructure Essentials book.

 

https://storageio.com/book4.html

Software Defined Data Infrastructure Essentials Book SDDC

What this all means and wrap-up

Keep in mind that with Application Data Value Characteristics Everything Is Not The Same across various  organizations, data centers, data infrastructures spanning legacy, cloud and other software defined data center (SDDC) environments. All applications have some element of performance, availability, capacity, economic (PACE) needs as well as resource demands. There is often a focus around data storage about storage efficiency and utilization which is where data footprint reduction (DFR) techniques, tools, trends and as well as technologies address capacity requirements. However with data storage there is also an expanding focus around storage effectiveness also known as productivity tied to performance, along with availability including 4 3 2 1 data protection. Continue reading the next post (Part III Application Data Characteristics Types Everything Is Not The Same) in this series here.

 

Ok, nuff said, for now.

 

Gs

HCIBench の設定を Ansible で自動化してみる。

$
0
0

HCIBench の利用方法を模索しているなかで Ansible による設定自動化をこころみたので

アイデアを残しておこうと思います。

 

HCIBenchは、仮想アプライアンスをデプロイしたあとに、Web UI からテスト対象の設定をしたり

内部で利用している vdbench のパラメータファイルを用意したりする必要があります。

 

HCIBench のデプロイについては

以前に PowerCLI で OVA をデプロイするアイデアを投稿したのでこちらもどうぞ。

HCIBench の OVA を PowerCLI でデプロイする。

 

デプロイ後の設定は、設定ファイルを直接編集することができます。

HCIBench の仮想アプライアンスの Photon OS にログインすると、

下記のようなファイルが配置されています。

  • 設定内容は適当なので、ここでは雰囲気をお伝えできればと・・・
  • 一度 Web UI で設定を完了すると、よい perf-conf.yaml のテンプレートが取得できると思います。

root@photon-HCIBench [ ~ ]# cat /opt/automation/conf/perf-conf.yaml

vc: 'vc-sv01.go-lab.jp'

vc_username: 'hci-bench-connect'

vc_password: 'パスワード'

datacenter_name: 'dc01'

cluster_name: 'vsan-cluster-01'

network_name: 'dvpg-vds01-vlan-1012'

static_enabled: true

reuse_vm: false

datastore_name:

- 'vsanDatastore-01'

deploy_on_hosts: false

hosts:

host_username:

host_password:

easy_run: false

clear_cache: false

number_vm: 2

number_data_disk: 2

size_data_disk: 10

self_defined_param_file_path: '/opt/tmp/tmp20180210190537'

output_path: 'Test_vsanDatastore-01_take01'

warm_up_disk_before_testing: 'NONE'

testing_duration:

cleanup_vm: false

 

このファイルの設定などを、Ansible に置き換えてみます。

 

Ansible 実行環境の準備。

私の自宅ラボでは、Linux に Ansible の環境を用意しています。

[gowatana@client01 ~]$ cat /etc/oracle-release

Oracle Linux Server release 7.4

[gowatana@client01 ~]$ ansible --version

ansible 2.3.1.0

  config file = /home/gowatana/.ansible.cfg

  configured module search path = Default w/o overrides

  python version = 2.7.5 (default, May 29 2017, 20:42:36) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]

 

Ansible の Playbook の管理には、Git(GitHub の)を利用しています。

実際に利用しているものは荒れているので非公開にしていますが、下記のような感じのものです。

GitHub - gowatana/hci-bench-config-sample

 

ある程度の環境設定(vCenter の接続情報など)をもったブランチ(ここでは master を利用)

を用意して、テストごとにそこからさらにブランチを作成して利用しています。

[gowatana@client01 hci-bench-config]$ git branch

  ha-cluster-03-nvme

  ha-cluster-03-ssd

  ha-cluster-04-ssd-02

* master

  vsan-cluster-01

  vsan-cluster-02

  vsan-cluster-03_case-002

 

Ansaible で利用する Playbook やソフトウェアは、下記のように配置しています。

  • files/vdbench-param-files ディレクトリ配下に、vdbench のパラメータファイルを作成して配置します。
  • files/conf/perf-conf.yaml.j2 が、HCIBench の perf-conf.yaml のテンプレートになります。
  • oracle/ ディレクトリ配下には、vdbench のバイナリ(vdbench~.zip)を ORACLE のサイトからダウンロードして配置します。
    ORACLE の vdbench のバイナリも Playbook で配布しますが、Git のリポジトリからは除外しています。
    (ライセンスの都合上)
  • vars/vsphere.yml には、vCenter への接続情報などを記載しています。
    今回は HCIBench むけに hci-bench-connect というユーザを用意しています。
  • vCenter 接続用のパスワードは別に、vars/vault/pass_hci-bench-connect.yml に記載しています。
  • これらの変更したら、ディレクトリ直下にある setup.yml を編集します。
    この YAML ファイルを ansible-playbook コマンドで指定します。

[gowatana@client01 hci-bench-config-sample]$ LANG=C tree

.

|-- README.md

|-- files

|   |-- conf

|   |   `-- perf-conf.yaml.j2

|   `-- vdbench-param-files

|       |-- vdb-case-101

|       `-- vdb-case-102

|-- hosts

|-- oracle

|   |-- README

|   `-- vdbench50406.zip

|-- setup.yml

`-- vars

    |-- vault

    |   |-- README.md

    |   `-- pass_hci-bench-connect.yml

    `-- vsphere.yml

 

6 directories, 11 files

 

vars/vsphere.yml の内容は下記だけです。

[gowatana@client01 hci-bench-config-sample]$ cat vars/vsphere.yml

---

 

vc_address:    vc-sv01.go-lab.jp

vc_user:       hci-bench-connect

 

 

vCenter 接続用のパスワードの管理には、下記のように Ansible Vault を使用しています。

ふぃあるを編集する場合は、view ではなく「ansible-vault edit ~」といったコマンドラインになります。

[gowatana@client01 hci-bench-config-sample]$ ansible-vault view vars/vault/pass_hci-bench-connect.yml

Vault password: ★このYAMLファイルを作成した時のパスワードを入力

 

---

password: (パスワードを記載しておく)

 

 

vdbench のパラメータファイル のサンプル(vdb-case-101 など)も、

とりあえず HCIBench が動作するか確認するためだけに配置してあるので

一瞬で終了する適当なテスト パラメータになっています。

 

HCIBench 設定の実行イメージ。

Ansible での接続のために、HCIBench に SSH 公開鍵をコピーしておきます。

[gowatana@client01 ~]$ ssh-copy-id root@hci-bench02.go-lab.jp

 

接続確認です。

[gowatana@client01 ~]$ ansible -i hosts -u root -m ping hci-bench02.go-lab.jp

hci-bench02.go-lab.jp | SUCCESS => {

    "changed": false,

    "ping": "pong"

}

[gowatana@client01 ~]$

 

Anaible 実行にかかわるファイルを配置します。

今回は、サンプルを GitHub をダウンロード(git clone)しています。

[gowatana@client01 ~]$ git clone https://github.com/gowatana/hci-bench-config-sample.git

[gowatana@client01 ~]$ cd hci-bench-config-sample/

 

新しいテスト実施の準備としてブランチを作成します。

[gowatana@client01 hci-bench-config-sample]$ git checkout -b vsan-cluster-01_case-101

Switched to a new branch 'vsan-cluster-01_case-101'

 

設定編集、パラメータファイルの追加、編集などを実施します。

vCenter のログインパスワードを指定するファイルも追加します。

vdbench ソフトウェアの zip ファイル、パラメータファイルなども配置します。

(ここでは、これらの手順記載は省略しています)

 

Ansible のインベントリ ファイルに HCIBench 仮想アプライアンスのホストを記載しておきます。

[gowatana@client01 hci-bench-config-sample]$ cat hosts

hci-bench02.go-lab.jp

 

HCIBench の設定ファイルなどを編集します。

最初のうちは Web UI で生成された perf-conf.yaml を scp などで取得して

それをもとに修正したほうがうまくいきます。

そして 適宜、git でファイル管理しておきます。

[gowatana@client01 hci-bench-config-sample]$ vi files/conf/perf-conf.yaml.j2

[gowatana@client01 hci-bench-config-sample]$ git add files/conf/perf-conf.yaml.j2

[gowatana@client01 hci-bench-config-sample]$ git commit -m "set test parameters."

[gowatana@client01 hci-bench-config-sample]$ git push origin vsan-cluster-01_case-101

 

下記のように、パラメータを変更していきます。

他にも VM 数、ディスク数、時間などを変更したり、 vdbench のパラメータ ファイルを追加、編集したりします。

https://github.com/gowatana/hci-bench-config-sample/commit/635d691963b02417a53d07b288c85d99afc0b023

 

それでは、HCIBench を設定します。

ここでは「--ask-vault-pass」をつけて、Ansible Vault のパスワードを入力します。

[gowatana@client01 hci-bench-config-sample]$ ansible-playbook -i hosts --ask-vault-pass setup.yml

 

実行の様子は下記のような感じです。

hci-bench-ansible-setting-01.png

 

HCIBench の Web UI にログインすると、すでに設定されている状態になります。

ただし、vdbench のパラメータ ファイルを複数指定していると、Web UI でも選択が必要です。

また、設定ファイルがうまく記載できていないと、デフォルト値や空欄の箇所があったりします。

テストを実行する前に「Save Configuration」と「Validate」をクリックしておきます。

hci-bench-ansible-setting-02.png

 

ここで、何か不足があったら コンフィグを修正して、再び ansible-playbook で修正します。

(状況によっては、Web UI で直接変更して、あとで Playbook に反映でも・・・)

その都度、Web ブラウザは更新したほうがよさそうです。

 

「Test」でテストを開始します。

hci-bench-ansible-setting-03.png

 

ファイルの編集個所やファイル管理の手順を精査することで

ベンチマーク テストの効率や安定性を向上させられるのではないかと考えられます。

また vSAN 環境ではクラスタあたりのデータストアが 1つに限定されていたりと構成に特徴があるので、

変数の管理にも、さらに工夫ができそうな気がします。

まだ試行錯誤の途中なので、ひきつづき工夫していきたいと思います。

 

以上、HCIBench の設定に Ansible を取り入れてみる話でした。

Everything Is Not The Same With Application Data Type Characteristics

$
0
0

This is part three of a five-part mini-series looking at Application Data Value Characteristics everything is not the same as a companion excerpt from  chapter 2 of my new book Software Defined Data Infrastructure  Essentials – Cloud, Converged and Virtual Fundamental Server Storage I/O  Tradecraft (CRC Press 2017). available at Amazon.com and other global venues. In  this post, we continue looking at application and data characteristics with a focus on different types of data. There is more to data than simply being big data, fast data, big fast or unstructured, structured or semistructured, some of which has been touched on in this series, with more to follow. Note that there is also data in terms of the programs, applications, code, rules, policies as well as configuration settings, metadata along with other items stored.

 

Application Data Value Software Defined Data Infrastructure Essentials Book SDDC

 

Various Types of Data

Data types along with characteristics include big data, little data, fast data, and old as well as new data with a different value, life-cycle, volume and velocity.  There are data in files and objects that are big representing images, figures,  text, binary, structured or unstructured that are software defined by the applications that create, modify and use them.

 

There are many different types of data and applications to meet various business,  organization, or functional needs. Keep in mind that applications are based on programs which consist of algorithms and data structures that define the data, how to use it, as well as how and when to store it. Those data  structures define data that will get transformed into information by programs  while also being stored in memory and on data stored in various formats.

 

Just as various applications have different algorithms, they also have different types of data. Even though everything is not the same in all environments, or even how the same applications get used across various organizations, there are some similarities.  Even though there are different types of applications and data, there are also some similarities and general characteristics. Keep in mind that information  is the result of programs (applications and their algorithms) that process data  into something useful or of value.

 

Data  typically has a basic life cycle of:

  • Creation and some activity, including being protected
  • Dormant, followed by either  continued activity or going inactive
  • Disposition (delete or remove)

 

In general, data can be

  • Temporary, ephemeral or transient
  • Dynamic or changing (“hot data”)
  • Active static on-line, near-line,  or off-line (“warm-data”)
  • In-active static on-line or  off-line (“cold data”)

 

Data is organized

  • Structured
  • Semi-structured
  • Unstructured

 

General  data characteristics include:

  • Value = From no value to unknown  to some or high value
  • Volume = Amount of data, files,  objects of a given size
  • Variety = Various types of data (small, big, fast, structured, unstructured)
  • Velocity = Data streams, flows,  rates, load, process, access, active or static

 

The  following figure shows how different data has various values over time. Data  that has no value today or in the future can be  deleted, while data with unknown value can be retained.

Different  data with various values over time

Application Data Value across sddc
Data Value Known, Unknown and No Value

 

General  characteristics include the value of the data which in turn determines its  performance, availability, capacity, and economic  considerations. Also, data can be  ephemeral (temporary) or kept for longer periods of time on persistent,  non-volatile storage (you do not lose the data when power is turned off). Examples of temporary scratch  include work and scratch areas such as where data gets imported into, or  exported out of, an application or database.

 

Data  can also be little, big, or big and fast, terms which describe in part the size  as well as volume along with the speed or velocity of being created, accessed,  and processed. The importance of understanding characteristics of data and how  their associated applications use them is to enable effective decision-making about performance, availability, capacity, and economics of data infrastructure  resources.

Data Value

There  is more to data storage than how much space capacity per cost.

 

All data has one  of three basic values:

  • No value = ephemeral/temp/scratch  = Why keep it?
  • Some value = current or emerging  future value, which can be low or high =  Keep
  • Unknown value = protect until  value is unlocked, or no remaining value

 

In addition to the above basic three, data with some value can also be further subdivided into little value, some value, or high value. Of course, you can keep subdividing into as many more or different categories  as needed, after all, everything is not always  the same across environments.

 

Besides data having some value, that value can also change by increasing or decreasing in value over time or even going from unknown to a known value, known to unknown, or to no value. Data with no value can be discarded, if in doubt, make and keep a copy of that data somewhere safe until its value (or lack of value) is fully known and understood.

 

The importance of understanding the value of data is to enable effective decision-making on where and how to protect, preserve, and cost-effectively store the data. Note that cost-effective does not necessarily mean the cheapest or lowest-cost approach, rather it means the way that aligns with the value and importance of the data at a given point in time.

Where to learn more

Learn more about Application Data Value, application characteristics, PACE along with data protection, software-defined data center (SDDC), software-defined data infrastructures (SDDI)  and related topics via the following links:

 

https://storageioblog.com/data-infrastructure-primer-overview/

SDDC Data Infrastructure

 

Additional learning experiences along with common questions (and answers), as well as tips can be found in Software Defined Data Infrastructure Essentials book.

 

Software Defined Data Infrastructure Essentials Book SDDC

What this all means and wrap-up

Data has different value at various times, and that value is also evolving. Everything Is Not The Same across various  organizations, data centers, data infrastructures spanning legacy, cloud and other software defined data center (SDDC) environments. Continue reading the next post (Part IV Application Data Volume Velocity Variety Everything Not The Same) in this series here.

 

Ok, nuff said, for now.

Gs

PowerCLI 10.0 の Docker コンテナを macOS で起動してみる。(PowerNSX も含む)

$
0
0

最近 PowerCLI 10.0 が公開されましたが、とうとう vmware/powerclicore の

Docker コンテナもイメージもアップデートされました。

PowerCLI Docker Image Updated - VMware PowerCLI Blog - VMware Blogs

 

PowerCLI 10.0 は Linux / macOS もサポートされるようになり、

少し前に Linux で実行してみた投稿をしてみましたが・・・

Linux で PowerCLI 10.0 をためしてみる。

 

今回は macOS で PowerCLI 10.0 の Docker コンテナを起動してみます。

 

実行環境。

普段あまり使っていない MacBook なのでバージョンは若干古いかもしれません。

 

macOS です。

gomac:~ gowatana$ sw_vers

ProductName: Mac OS X

ProductVersion: 10.13.2

BuildVersion: 17C205

 

Docker です。

gomac:~ gowatana$ docker version

Client:

Version:      17.09.1-ce

API version:  1.32

Go version:   go1.8.3

Git commit:   19e2cf6

Built:        Thu Dec  7 22:22:25 2017

OS/Arch:      darwin/amd64

 

Server:

Version:      17.09.1-ce

API version:  1.32 (minimum version 1.12)

Go version:   go1.8.3

Git commit:   19e2cf6

Built:        Thu Dec  7 22:28:28 2017

OS/Arch:      linux/amd64

Experimental: false

 

コンテナの起動。

コンテナのイメージは、vmware/powerclicore です。

https://hub.docker.com/r/vmware/powerclicore/

 

イメージを pull します。タグは特に指定せず latest です。

gomac:~ gowatana$ docker image pull vmware/powerclicore

Using default tag: latest

latest: Pulling from vmware/powerclicore

e9b1ffebdf09: Pull complete

1ca0671214e4: Pull complete

e2054d0e7b6e: Pull complete

9e5896375981: Pull complete

4fda4ed0aa8e: Pull complete

ae595f021807: Pull complete

2223c2963494: Pull complete

c0625c88535b: Pull complete

Digest: sha256:4c19d7f6e5b460cdcea403977f1e8491f5c28c81a60e84dddf9d65921ba3ac51

Status: Downloaded newer image for vmware/powerclicore:latest

 

コンテナを起動します。

事情により --dns でコンテナが参照する DNS サーバのアドレスを指定しています。

( macOS で利用している DHCP と自宅ラボの DNS サーバのアドレスがあっていないので・・・)

gomac:~ gowatana$ docker container run -it --rm --dns=192.168.1.254 vmware/powerclicore

PowerShell v6.0.1

Copyright (c) Microsoft Corporation. All rights reserved.

 

https://aka.ms/pscore6-docs

Type 'help' to get help.

 

PS /root>

 

コンテナは、Photon OS 2.0 をベースにされています。

PS /root> cat /etc/photon-release

VMware Photon OS 2.0

PHOTON_BUILD_NUMBER=304b817

 

自宅ラボの vCenter は証明書を入れ替えていないので、

証明書エラーを無視してしまいます。

PS /root> Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore -Confirm:$false

 

PowerShell モジュールの様子です。

Cmds 列は、それぞれのモジュールに含まれるコマンド数のはずです。

PS /root> Get-Module -ListAvailable | select @{N="Cmds";E={$_.ExportedCommands.Count}},Version,Name | Sort-Object Name

 

Cmds Version        Name

---- -------        ----

   1 0.0            apply-hardening

   3 0.0            Backup-VCSA

   9 0.0            ContentLibrary

   6 0.0            DatastoreFunctions

   1 0.0            Get-NewAndRemovedVMs

   1 0.0            Get-NICDetails

   1 0.0            Get-VMmaxIOPS

   1 0.0            Konfig-ESXi

   2 3.0.0.0        Microsoft.PowerShell.Host

  43 3.1.0.0        Microsoft.PowerShell.Management

   6 3.0.0.0        Microsoft.PowerShell.Security

103 3.1.0.0        Microsoft.PowerShell.Utility

   8 1.0.0.0        NSXT

  13 1.1.7.0        PackageManagement

300 3.0.1091       PowerNSX

  29 1.6.0          PowerShellGet

119 3.1.1          PowervRA

   7 0.0            ProactiveHA

  71 0.0            PSDesiredStateConfiguration

   6 1.2            PSReadLine

   1 0.0            PSvLIMessage

   1 0.0            Recommend-Sizing

   1 0.0            Set-CBT

   1 0.0            Start-UNMAP

  16 0.0            VAMI

   5 0.0            vCenter.Alarms

  10 0.0            vCenterManualMigration

   5 0.0            VCHA

  11 1.0            Vi-Module

   2 0.0            VMCPFunctions

   3 1.0.0.0        VMFSIncrease

  11 0.0            VMToolsManagement

   5 1.0.0          VMware-vCD-Module

   3 1.0.2          VMware-vCD-TenantReport

  27 6.5.2.7812840  VMware.DeployAutomation

  15 1.0.0.0        VMware.Hosted

  12 6.5.2.7812840  VMware.ImageBuilder

   0 10.0.0.7895300 VMware.PowerCLI

   3 10.0.0.7893915 VMware.VimAutomation.Cis.Core

106 10.0.0.7893901 VMware.VimAutomation.Cloud

   0 10.0.0.7893906 VMware.VimAutomation.Common

302 10.0.0.7893909 VMware.VimAutomation.Core

   1 6.5.4.7567193  VMware.VimAutomation.HA

   2 7.1.0.7547311  VMware.VimAutomation.HorizonView

   1 10.0.0.7893904 VMware.VimAutomation.License

   3 10.0.0.7893913 VMware.VimAutomation.Nsxt

   4 10.0.0.7893924 VMware.VimAutomation.PCloud

   2 10.0.0.7893910 VMware.VimAutomation.Sdk

   2 10.0.0.7893900 VMware.VimAutomation.Srm

  92 10.0.0.7894167 VMware.VimAutomation.Storage

   1 1.2.0.0        VMware.VimAutomation.StorageUtility

  32 10.0.0.7893903 VMware.VimAutomation.Vds

   5 10.0.0.7893902 VMware.VimAutomation.Vmc

  12 10.0.0.7893921 VMware.VimAutomation.vROps

  16 1.2.0          VMware.VMC

  19 1.0            VMware.VMEncryption

  19 6.5.1.7862888  VMware.VumAutomation

   3 0.0            vSphere_Hardening_Assess_VM_v1a

 

PS /root>

 

Dockerfile を見ると、PowerNSX と PowervRA もインストールされていることがわかります。

そして、vSAN むけのモジュールも PowerCLI に含まれています。

powerclicore/Dockerfile at master · vmware/powerclicore · GitHub

 

vCenter / NSX Manger に接続してみる。

それでは vCenter「vc-sv01.go-lab.jp」に接続します。

すでに InvalidCertificateAction の設定をしているので、エラーが抑止されています。

PS /root> Connect-VIServer vc-sv01.go-lab.jp

Specify Credential

Please specify server credential

User: gowatana

Password for user gowatana: **********

 

 

Name                           Port  User     

----                           ----  ----

vc-sv01.go-lab.jp              443   GO-LAB\gowatana

 

 

PS /root>

 

下記のように vSAN むけのコマンドも実行できます。

PS /root> Get-VsanClusterConfiguration | Sort-Object Cluster

 

 

Cluster              VsanEnabled  IsStretchedCluster   Last HCL Updated

-------              -----------  ------------------   ----------------

ha-cluster-01        False        False

ha-cluster-02        False        False

vsan-cluster-01      True         False                01/28/2018 12:01:23

vsan-cluster-02      True         False                01/28/2018 12:01:23

vsan-cluster-03      True         True                 01/28/2018 12:01:23

work-cluster-01      False        False

 

PS /root>

 

PowerNSX も含まれています。

NSX Manager に接続してみました。

PS /root> Connect-NsxServer -vCenterServer vc-sv01.go-lab.jp

 

PowerShell credential request

vCenter Server SSO Credentials

User: gowatana

Password for user gowatana: **********

 

Using existing PowerCLI connection to 192.168.1.95

 

 

Version             : 6.4.0

BuildNumber         : 7564187

Credential          : System.Management.Automation.PSCredential

Server              : 192.168.1.140

Port                : 443

Protocol            : https

UriPrefix           :

ValidateCertificate : False

VIConnection        : vc-sv01.go-lab.jp

DebugLogging        : False

DebugLogfile        : \PowerNSXLog-gowatana@-2018_03_15_11_10_47.log

 

 

PS /root>

 

macOS 自体に PowerShell / PowerCLI 10.0 をインストールすることも可能になりましたが、

Docker コンテナであれば PowerShell モジュールのインストールよりも、さらに手軽に実行できるはずです。

また、多くの PowerShell モジュールがインストールされてカオス環境になることを避けたり、

将来的に複数の PowerCLI バージョンをきれいに使い分けたり、といった使い方ができそうです。

 

以上、PowerCLI 10.0 の Docker コンテナを起動してみる話でした。

HA Configuration time out when adding a new host

$
0
0

I would like to share my recent experience when troubleshooting a HA issue.Be default when trying adding a new host to the existing cluster or when you reconfigure a HA on one of the existing host in the cluster HA opearing will timeout.To fix the issue eithwe we have to disable and enable the Ha on the cluster level or reconfigure HA on the master node

 

 

vpxd logs

 

 

vpxd-19.log:2017-09-26T01:17:53.673Z info vpxd[7FA6DC311700] [Originator@6876 sub=vpxLro opID=lro-53-79f246b8-02] [VpxLRO] -- BEGIN task-147951 -- svrau-esx03.jbhi-fi.local -- DasConfig.ConfigureHost --

vpxd-19.log:2017-09-26T01:17:53.673Z info vpxd[7FA6DC311700] [Originator@6876 sub=MoHost opID=lro-53-79f246b8-02] [HostMo::UpdateDasState] VC state for host host-220 (initialized -> uninitialized), FDM state (Live -> Live), src of state (null -> null)

vpxd-19.log:2017-09-26T01:17:53.965Z info vpxd[7FA6DC311700] [Originator@6876 sub=DAS opID=lro-53-79f246b8-02] [VpxdDasConfigLRO::ConfigureResources] Skipping aam RP config for ESX 6+ host

vpxd-19.log:2017-09-26T01:17:54.389Z info vpxd[7FA6DC311700] [Originator@6876 sub=HostUpgrader opID=lro-53-79f246b8-02] [VpxdHostUpgrader] Fdm on host-220 has build 5973321. Expected build is 6671409 - will upgrade

vpxd-19.log:2017-09-26T01:17:54.578Z info vpxd[7FA6DC311700] [Originator@6876 sub=HostAccess opID=lro-53-79f246b8-02] Using vpxapi.version.version11 to communicate with vpxa at host svrau-esx03.jbhi-fi.local

vpxd-19.log:2017-09-26T01:21:41.970Z warning vpxd[7FA6DC698700] [Originator@6876 sub=VpxProfiler opID=lro-53-79f246b8-02-TaskLoop-dc7c952] TaskLoop [TotalTime] took 222225 ms

vpxd-19.log:2017-09-26T01:21:42.104Z info vpxd[7FA6DC311700] [Originator@6876 sub=DAS opID=lro-53-79f246b8-02] [VpxdDasConfig::PushConfigToFDM] pushed config version 127  to host [vim.HostSystem:host-220,svrau-esx03.jbhi-fi.local] (cluster [vim.ClusterComputeResource:domain-c31,AU001_CLUSTER_GENERAL])

vpxd-19.log:2017-09-26T01:23:42.120Z error vpxd[7FA6DC311700] [Originator@6876 sub=DAS opID=lro-53-79f246b8-02] Timed out waiting for election to complete or for host to join existing master

vpxd-19.log:2017-09-26T01:23:42.120Z error vpxd[7FA6DC311700] [Originator@6876 sub=DAS opID=lro-53-79f246b8-02] EnableDAS failed on host [vim.HostSystem:host-220,svrau-esx03.jbhi-fi.local]: N3Vim5Fault8Timedout9ExceptionE(vim.fault.Timedout)

vpxd-19.log:2017-09-26T01:23:42.121Z info vpxd[7FA6DC311700] [Originator@6876 sub=MoHost opID=lro-53-79f246b8-02] [HostMo::UpdateDasState] VC state for host host-220 (initialized -> init error), FDM state (UNKNOWN_FDM_HSTATE -> UNKNOWN_FDM_HSTATE), src of state (null -> null)

vpxd-19.log:2017-09-26T01:23:42.184Z info vpxd[7FA6DC311700] [Originator@6876 sub=DAS opID=lro-53-79f246b8-02] [VpxdDasConfigLRO::Cleanup] Number of unprotected vms: 24

vpxd-19.log:2017-09-26T01:23:42.184Z warning vpxd[7FA6DC311700] [Originator@6876 sub=VpxProfiler opID=lro-53-79f246b8-02] VpxLro::LroMain [TotalTime] took 348510 ms

vpxd-19.log:2017-09-26T01:23:42.184Z info vpxd[7FA6DC311700] [Originator@6876 sub=vpxLro opID=lro-53-79f246b8-02] [VpxLRO] -- FINISH task-147951

vpxd-19.log:2017-09-26T01:23:42.184Z info vpxd[7FA6DC311700] [Originator@6876 sub=Default opID=lro-53-79f246b8-02] [VpxLRO] -- ERROR task-147951 -- svrau-esx03.jbhi-fi.local -- DasConfig.ConfigureHost: vim.fault.Timedout:

vpxd-19.log:2017-09-26T01:24:15.373Z warning vpxd[7FA6DE17B700] [Originator@6876 sub=VpxProfiler opID=lro-53-79f246b8-02-EventManagerProcessJobs-4606457a] EventManagerProcessJobs [TotalTime] took 33248 ms

 

 

From the above snippets it is evident that HA configuration is timing because of under lying network latency between the esxi hosts.This issue can be fixed by increasing the default timed out value for FDM in the Vcenter server advanced settings

 

 

Applying a VMware HA customization

Using the vSphere Web Client

 

Log in to VMware vSphere Web Client.

Go to Home > vCenter > Clusters.

Under Object, click on the cluster you want to modify.

Click Manage.

Click vSphere HA.

Click Edit.

Click Advanced Options.

Click Add and enter in Option add config.vpxd.das.fdmWaitForUpdatesTimeoutSec and Value field set it t0 60

Deselect Turn ON vSphere HA.

Click OK.

Wait for HA to unconfigure, click Edit and check Turn ON vSphere HA.

Click OK and wait for the cluster to reconfigure.

HCIBench のベンチマーク テスト実行をコマンドライン / Ansible で自動化してみる。

$
0
0

前回、HCIBench の設定を Ansible で自動化してみる話を投稿しました。

HCIBench の設定を Ansible で自動化してみる。

 

今回は、設定後のテスト実行にコマンドライン / Ansible を利用してみます。

 

HCIBench のコマンドラインでのテスト実行。

HCIBench をコマンドラインで実行する方法については、

下記のブログで紹介されています。

Use HCIBench Like a Pro – Part 2 - Virtual Blocks

 

まず、HCIBench の Photon OS に SSH でログインします。

HCIBench の仮想アプライアンスは「hci-bench02.go-lab.jp」というアドレスで用意しています。

[gowatana@client01 ~]$ ssh -l root hci-bench02.go-lab.jp

############################################

#                                          #

#        Welcome to HCIBench 1.6.6         #

#                                          #

############################################

root@photon-HCIBench [ ~ ]#

 

今回は、HCIBench で使用する設定ファイルは配置ずみです。

root@photon-HCIBench [ ~ ]# cat /opt/automation/conf/perf-conf.yaml

vc: 'vc-sv01.go-lab.jp'

vc_username: 'hci-bench-connect'

vc_password: 'パスワード'

datacenter_name: 'dc01'

cluster_name: 'vsan-cluster-01'

network_name: 'dvpg-vds01-vlan-1012'

static_enabled: false

reuse_vm: false

datastore_name:

- 'vsanDatastore-01'

deploy_on_hosts: false

hosts:

host_username:

host_password:

vm_prefix: 'vdbench'

easy_run: false

clear_cache: false

number_vm: 2

number_data_disk: 2

size_data_disk: 1

self_defined_param_file_path: '/opt/tmp/tmp20180315144339'

output_path: 'TEST_vsan-cluster-01_case-101'

warm_up_disk_before_testing: 'NONE'

testing_duration:

cleanup_vm: false

root@photon-HCIBench [ ~ ]# file /opt/automation/vdbench-param-files/*

/opt/automation/vdbench-param-files/vdb-case-101: ASCII text

root@photon-HCIBench [ ~ ]#

 

Web UI にある「Varidate」ボタンにかわるスクリプトの実行してみます。

ちなみに出力結果をみると、テスト対象が 6 ノード vSAN クラスタだということもわかります。

※ここでのタイムスタンプは JST ではないので読みかえることになります。

root@photon-HCIBench [ ~ ]# /opt/automation/pre-validate-config.sh

2018-03-15 15:01:07 -0700: Validating VC IP and Crendetial...

2018-03-15 15:01:10 -0700: VC IP and Credential Validated

2018-03-15 15:01:10 -0700: Validating Datacenter dc01...

2018-03-15 15:01:11 -0700: Datacenter dc01 Validated

2018-03-15 15:01:11 -0700: Validating Cluster vsan-cluster-01...

2018-03-15 15:01:12 -0700: Cluster vsan-cluster-01 Validated

2018-03-15 15:01:12 -0700: Cluster vsan-cluster-01 has DRS mode: fullyAutomated

2018-03-15 15:01:12 -0700: Validating If Hosts in Cluster vsan-cluster-01 Could be Connected...

2018-03-15 15:01:25 -0700: All Hosts could be Connected

2018-03-15 15:01:25 -0700: Validating If Any Hosts in Cluster vsan-cluster-01 is in Maintainance Mode...

2018-03-15 15:01:26 -0700: All the Hosts in Cluster vsan-cluster-01 are not in Maitainance Mode

2018-03-15 15:01:26 -0700: Validating Network dvpg-vds01-vlan-1012...

2018-03-15 15:01:28 -0700: Network dvpg-vds01-vlan-1012 Validated

2018-03-15 15:01:28 -0700: Checking If Network dvpg-vds01-vlan-1012 is accessible from all the hosts of vsan-cluster-01...

2018-03-15 15:01:29 -0700: Network dvpg-vds01-vlan-1012 is accessible from host hv-i22.go-lab.jp

2018-03-15 15:01:30 -0700: Network dvpg-vds01-vlan-1012 is accessible from host hv-i25.go-lab.jp

2018-03-15 15:01:31 -0700: Network dvpg-vds01-vlan-1012 is accessible from host hv-i21.go-lab.jp

2018-03-15 15:01:31 -0700: Network dvpg-vds01-vlan-1012 is accessible from host hv-i24.go-lab.jp

2018-03-15 15:01:32 -0700: Network dvpg-vds01-vlan-1012 is accessible from host hv-i26.go-lab.jp

2018-03-15 15:01:33 -0700: Network dvpg-vds01-vlan-1012 is accessible from host hv-i23.go-lab.jp

2018-03-15 15:01:33 -0700: Network dvpg-vds01-vlan-1012 is accessible from all the hosts of vsan-cluster-01

2018-03-15 15:01:33 -0700: Validating Type of Network dvpg-vds01-vlan-1012...

2018-03-15 15:01:34 -0700: Network dvpg-vds01-vlan-1012 Type is DistributedVirtualPortgroup

2018-03-15 15:01:34 -0700: Validating cluster inter-connectivity...

2018-03-15 15:03:20 -0700: Cluster inter-connectivity validated

2018-03-15 15:03:23 -0700: Validating Datastore vsanDatastore-01...

2018-03-15 15:03:24 -0700: Datastore vsanDatastore-01 Validated

2018-03-15 15:03:24 -0700: Checking Datastore vsanDatastore-01 type...

2018-03-15 15:03:24 -0700: Datastore vsanDatastore-01 type is vsan

2018-03-15 15:03:24 -0700: Checking If Datastore vsanDatastore-01 is accessible from all the hosts of vsan-cluster-01...

2018-03-15 15:03:25 -0700: Datastore vsanDatastore-01 is accessible from host hv-i22.go-lab.jp

2018-03-15 15:03:25 -0700: Datastore vsanDatastore-01 is accessible from host hv-i25.go-lab.jp

2018-03-15 15:03:25 -0700: Datastore vsanDatastore-01 is accessible from host hv-i21.go-lab.jp

2018-03-15 15:03:25 -0700: Datastore vsanDatastore-01 is accessible from host hv-i24.go-lab.jp

2018-03-15 15:03:25 -0700: Datastore vsanDatastore-01 is accessible from host hv-i26.go-lab.jp

2018-03-15 15:03:25 -0700: Datastore vsanDatastore-01 is accessible from host hv-i23.go-lab.jp

2018-03-15 15:03:25 -0700: Datastore vsanDatastore-01 is accessible from all the hosts of vsan-cluster-01

2018-03-15 15:03:25 -0700: Validating If VSAN Enabled in Cluster vsan-cluster-01...

2018-03-15 15:03:30 -0700: VSAN is Enabled in Cluster vsan-cluster-01, the VSAN Datastore name is vsanDatastore-01, capacity is 5589 GB and freespace is 4238 GB, the default policy is vsan-policy-raid5

2018-03-15 15:03:31 -0700: Deploy on hosts: False. Skip validating hosts...

2018-03-15 15:03:31 -0700: Validating Vdbench binary and the workload profiles...

------------------------------------------------------------------------------

2018-03-15 15:03:32 -0700: All the config has been validated, please go ahead to kick off testing

------------------------------------------------------------------------------

Caution:

You have 2 VM Have the Same Prefix as vdbench, Please Make Sure the VMs are OK to be Deleted Otherwise Please Change the VM Name Prefix.

------------------------------------------------------------------------------

root@photon-HCIBench [ ~ ]#

 

ちょうどテスト VM がすでにあるという注意メッセージがあるので、

VM のクリーンアップをしてみます。

root@photon-HCIBench [ ~ ]# /opt/automation/cleanup-vm.sh

Starting Cleaning VDBench Guest VMs...

VDBench Guest VMs Deleted

root@photon-HCIBench [ ~ ]#

 

ベンチマーク テストを実行します。

コマンドラインを実行すると、プロンプトがすくに戻されます。

root@photon-HCIBench [ ~ ]# /opt/automation/start-testing.sh

root@photon-HCIBench [ ~ ]#

 

実行の様子は、下記のようにログファイルから確認できます。

root@photon-HCIBench [ ~ ]# tail -f /opt/automation/logs/test-status.log

Deployment Started.

Verifying If VMs are Accessible

Deployment Successfully Finished.

I/O Test Started.

Started Testing vdb-case-101

Done Testing vdb-case-101

I/O Test Finished.

Testing Finished

 

テストが終了すると、下記のようなログファイルが出力されています。

root@photon-HCIBench [ ~ ]# ls -ltr /opt/automation/logs/

total 44

drwxrwxr-x 2 root root  4096 Mar 15 15:01 prevalidation

-rw-rw-r-- 1 root root   390 Mar 15 15:20 vm-cleanup.log

-rw-rw-r-- 1 root root 16321 Mar 15 15:24 vc-vc-sv01.go-lab.jp-vs-vm-deploy-0.log

-rw-rw-r-- 1 root root   696 Mar 15 15:24 deploy.log

-rw-rw-r-- 1 root root  6379 Mar 15 15:31 io-test-vdb-case-101.log

-rw-rw-r-- 1 root root  1184 Mar 15 15:31 vdbench-testing.log

-rw-rw-r-- 1 root root   195 Mar 15 15:31 test-status.log

root@photon-HCIBench [ /opt/automation/logs ]#

 

テストの進行は Web ブラウザからでも確認できます。

URL は下記のようになっています。

http://  HCIBench のアドレス /hcibench_logs/test-status.log

hci-bench-start-testing-01.png

 

「Testing Finished」があると、ベンチマークが終了しています。

通常の Web UI からの実行時と同様に、レポートが生成されています。

hci-bench-start-testing-02.png

 

レポートは、下記のようにまとめて採取することもできます。

[gowatana@client01 work]$ scp -pr root@hci-bench02.go-lab.jp:/opt/output/results/TEST_vsan-cluster-01_case-101 .

[gowatana@client01 work]$ ls TEST_vsan-cluster-01_case-101/

vdb-case-101-1521152685  vdb-case-101-1521152685-res.txt

 

HCIBench の Ansible でのテスト実行。

Ansible でテストを実行する場合は、shell モジュールなどが利用できます。

ここでは、例として Ansible の Playbook に記載したコマンド ラインを実行してみます。

 

まず、HCIBench の ホスト(ホスト名か、アドレスか)を記載した

Ansible のインベントリファイルを用意しておきます。

[gowatana@client01 hci-bench-config]$ cat hosts

hci-bench01.go-lab.jp

 

そして、下記のような YAML ファイルを用意しています。

Playbook の内容はただ 1行のコマンドラインを実行するだけなので

これだけだと Ansible を利用する意義はありません。

しかし、すでに Ansible を活用していたり、HCIBench の設定にも Ansible を利用するような場合は

環境の構成管理からベンチマーク テストの実行までツールを一貫させることができると思います。

[gowatana@client01 hci-bench-config]$ cat start-testing.yml

---

- name: HCI Bench start testing

  hosts: all

  remote_user: root

 

  tasks:

  - name: start testing

    shell: /opt/automation/start-testing.sh

 

 

ansible-playbook コマンドを実行します。

[gowatana@client01 hci-bench-config]$ ansible-playbook -i hosts start-testing.yml

 

PLAY [HCI Bench start testing] *************************************************

 

TASK [Gathering Facts] *********************************************************

ok: [hci-bench01.go-lab.jp]

 

TASK [start testing] ***********************************************************

changed: [hci-bench01.go-lab.jp]

 

PLAY RECAP *********************************************************************

hci-bench01.go-lab.jp      : ok=2    changed=1    unreachable=0    failed=0

 

[gowatana@client01 hci-bench-config]$

 

今回の Playbook にはテストの進行確認は含めていないため、curl で確認してしまいます。

[gowatana@client01 hci-bench-config]$ curl -s http://hci-bench01.go-lab.jp/hcibench_logs/test-status.log

Deployment Started.

 

ベンチマークテストの進行状況はログ出力され・・・

[gowatana@client01 hci-bench-config]$ curl -s http://hci-bench01.go-lab.jp/hcibench_logs/test-status.log

Deployment Started.

Verifying If VMs are Accessible

Deployment Successfully Finished.

I/O Test Started.

 

「Testing Finished」が出力されれば終了です。

[gowatana@client01 hci-bench-config]$ curl -s http://hci-bench01.go-lab.jp/hcibench_logs/test-status.log

Deployment Started.

Verifying If VMs are Accessible

Deployment Successfully Finished.

I/O Test Started.

I/O Test Finished.

Testing Finished

 

HCIBench 自体は vSAN に限らず、vSphere(vCenter / ESXi)環境であれば利用できるので、

できるだけベンチマーク 環境を自動化しておくと便利ではないかなと思います。

また、このような仕組みを利用すれば、構築作業後の確認や

他のベンチマークツールとの連携などにも利用できそうかなと思います。

 

これまでの HCIBench 利用の工夫については、下記もどうぞ。

HCIBench の OVA を PowerCLI でデプロイする。

HCIBench の設定を Ansible で自動化してみる。

 

以上、HCIBench のベンチマーク テストの実行を工夫してみる話でした。


ESXi server lost ping request during change IP and NIC

$
0
0

Scenario :- If we are using N3K and N9K , mostly used teaming policy ip hash , but when we changed NIC/IP its take origination port id.

 

Try to change it by these command

 

To Set the NIC teaming policy on a Virtual Switch on an ESXi 5.x

  • To list the current NIC teaming policy of a vSwitch, use the command:

    # esxcli network vswitch standard policy failover get -v vSwitch0
  • To set the NIC teaming policy of a vSwitch, use this command:
# esxcli network vswitch standard policy failover set -l policy -v vSwitchXFor example, to set the NIC teaming policy of a vSwitch to IP hash:

 

# esxcli network vswitch standard policy failover set -l iphash -v vSwitch0Note: Available Policy Options:
  • explicit = Use explicit failover order
  • portid = Route based upon port id (This is the Default setting)
  • mac = Source Based Upon MAC Hash
  • iphash = Source based up IP hash (This is only to be used in a etherchannel\Portchannel)

To Set the NIC teaming policy on a Port Group

  1. To list the current NIC teaming policy of a port group, run this command:


    esxcli network vswitch standard portgroup policy failover get -p "Management Network"
  2. To set the NIC teaming policy of a port group, run this command:


    esxcli network vswitch standard portgroup policy failover set -p "Management Network" -l "Policy Options"

policy option is iphash

 

VMware Knowledge Base

PowerCLI で vSphere / vSAN 環境での Oracle RAC むけ VM の構成情報を取得してみる。

$
0
0

PowerCLI を利用して、Oracle RAC 用に構成した vSphere / vSAN 環境の VM の情報を確認してみます。

 

vSphere / vSAN 環境に Oracle RAC を構築する場合に、いくつか VM に RAC むけの設定をします。

RAC の構築目的によって具体的な設定値は変わりますが、たとえば下記のような設定です。

  • vNICの数や、接続するネットワークを揃える。
  • 仮想ハード ディスク の VMDK ファイルを複数の VM で共有する。
  • VMDK ファイルは EagerZeroed Thick にして「Multi Writer フラグ」を設定する。
    (参考: https://kb.vmware.com/kb/2121181
  • 共有ディスクむけに容量を 100%予約する「仮想マシン ストレージ ポリシー」を作成する。
  • Oracle RAC のクラスタに参加している VM 同士を DRS のアンチ アフィニティ ルールで分割配置する。

など・・・

 

VM の設定項目が多いため、私のラボでは何か忘れていないか気づきやすいように

PowerCLI を利用して設定確認しています。

 

下記のようなスクリプトを作成しています。

get_rac-vm_info.ps1 · GitHub

  • ファイルは UTF-8(with BOM)で保存すると無難かなとおもいます。
  • 実行するときは、PowerShell / PowerCLI のウィンドウ幅を 100 くらいにしておくとよいです。

 

今回は、Windows で PowerCLI 10.0 を利用しています。

PowerCLI> Get-Module VMware.* | select Version,Name | Sort-Object

 

Version        Name

-------        ----

10.0.0.7893910 VMware.VimAutomation.Sdk

10.0.0.7894167 VMware.VimAutomation.Storage

10.0.0.7893909 VMware.VimAutomation.Core

10.0.0.7893915 VMware.VimAutomation.Cis.Core

10.0.0.7893906 VMware.VimAutomation.Common

 

 

PowerCLI>

 

スクリプトの実行前に、vCenter に接続しておきます。

PowerCLI> Connect-VIServer vc-sv01.go-lab.jp -Force | Out-Null

 

私のラボの RAC (db01 / db02 で 2ノード構成)で情報取得してみると、下記のようになっています。

vmx-13 の仮想マシンなので、OSTyep は「Oracle Linux 7 (64-bit)」にしています。

ESXi 6.5 での Guest OS の細分化について。(Oracle Linux 7 など)

PowerCLI> .\get_rac-vm_info.ps1 db01,db02

==========================================================================================

vCPU / vRAM

 

VM   PowerState NumCpu MemoryGB HwVersion OSType

--   ---------- ------ -------- --------- ------

db01  PoweredOn      2        8 vmx-13    Oracle Linux 7 (64-bit)

db02  PoweredOn      2        8 vmx-13    Oracle Linux 7 (64-bit)

 

==========================================================================================

Cluster

 

Cluster     : vsan-cluster-01

VsanEnabled : True

HAEnabled   : True

DrsEnabled  : True

EVCMode     : intel-haswell

 

==========================================================================================

Host

 

VM   Cluster         ESXi

--   -------         ----

db01 vsan-cluster-01 hv-i22.go-lab.jp

db02 vsan-cluster-01 hv-i21.go-lab.jp

 

==========================================================================================

vNIC

 

VM   Name                 Type NetworkName          StartConnected Connected

--   ----                 ---- -----------          -------------- ---------

db01 Network adapter 1 Vmxnet3 dvpg-vds01-vlan-1011           True      True

db01 Network adapter 2 Vmxnet3 dvpg-vds01-vlan-4001           True      True

db02 Network adapter 1 Vmxnet3 dvpg-vds01-vlan-1011           True      True

db02 Network adapter 2 Vmxnet3 dvpg-vds01-vlan-4001           True      True

 

==========================================================================================

vSCSI Controller

 

VM   Name                     Type BusSharingMode UnitNumber ControllerKey

--   ----                     ---- -------------- ---------- -------------

db01 SCSI controller 0 ParaVirtual      NoSharing          3          1000

db01 SCSI controller 1 ParaVirtual      NoSharing          4          1001

db02 SCSI controller 0 ParaVirtual      NoSharing          3          1000

db02 SCSI controller 1 ParaVirtual      NoSharing          4          1001

 

==========================================================================================

vDisk

 

VM   Name        Controller GB    StorageFormat           Persistence Sharing

--   ----        ---------- --    -------------           ----------- -------

db01 Hard disk 1       1000 16             Thin            Persistent sharingNone

db01 Hard disk 2       1000 40             Thin            Persistent sharingNone

db01 Hard disk 3       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db01 Hard disk 4       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db01 Hard disk 5       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db01 Hard disk 6       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db01 Hard disk 7       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db01 Hard disk 8       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db02 Hard disk 1       1000 16             Thin            Persistent sharingNone

db02 Hard disk 2       1000 40             Thin            Persistent sharingNone

db02 Hard disk 3       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db02 Hard disk 4       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db02 Hard disk 5       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db02 Hard disk 6       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db02 Hard disk 7       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

db02 Hard disk 8       1001 30 EagerZeroedThick IndependentPersistent sharingMultiWriter

 

==========================================================================================

Share vDisk

 

vDisk : Hard disk 3

Name  : [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_2.vmdk

VMs   : 2

VM    : db01,db02

 

vDisk : Hard disk 4

Name  : [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_3.vmdk

VMs   : 2

VM    : db01,db02

 

vDisk : Hard disk 5

Name  : [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_4.vmdk

VMs   : 2

VM    : db01,db02

 

vDisk : Hard disk 6

Name  : [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_5.vmdk

VMs   : 2

VM    : db01,db02

 

vDisk : Hard disk 7

Name  : [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_6.vmdk

VMs   : 2

VM    : db01,db02

 

vDisk : Hard disk 8

Name  : [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_7.vmdk

VMs   : 2

VM    : db01,db02

 

==========================================================================================

VM Storage Policy

 

VM   vDisk       StoragePolicy      ComplianceStatus

--   -----       -------------      ----------------

db01 Hard disk 1 vsan-policy-raid5         compliant

db01 Hard disk 2 vsan-policy-raid5         compliant

db01 Hard disk 3 vsan-policy-rac-01        compliant

db01 Hard disk 4 vsan-policy-rac-01        compliant

db01 Hard disk 5 vsan-policy-rac-01        compliant

db01 Hard disk 6 vsan-policy-rac-01        compliant

db01 Hard disk 7 vsan-policy-rac-01        compliant

db01 Hard disk 8 vsan-policy-rac-01        compliant

db02 Hard disk 1 vsan-policy-raid5         compliant

db02 Hard disk 2 vsan-policy-raid5         compliant

db02 Hard disk 3 vsan-policy-rac-01        compliant

db02 Hard disk 4 vsan-policy-rac-01        compliant

db02 Hard disk 5 vsan-policy-rac-01        compliant

db02 Hard disk 6 vsan-policy-rac-01        compliant

db02 Hard disk 7 vsan-policy-rac-01        compliant

db02 Hard disk 8 vsan-policy-rac-01        compliant

 

==========================================================================================

Storage Policy Setting

 

StoragePolicy      Capability                                                 Value

-------------      ----------                                                 -----

vsan-policy-rac-01 VSAN.proportionalCapacity                                    100

vsan-policy-rac-01 VSAN.hostFailuresToTolerate                                    1

vsan-policy-rac-01 VSAN.stripeWidth                                               2

vsan-policy-raid5  VSAN.replicaPreference      RAID-5/6 (Erasure Coding) - Capacity

vsan-policy-raid5  VSAN.proportionalCapacity                                      0

 

==========================================================================================

DRS Affinity Rule

 

Cluster   : vsan-cluster-01

Name      : drs-anti-affinity-rac-01

Type      : VMAntiAffinity

Mandatory : False

Enabled   : True

VMs       : db01,db02

 

PowerCLI>

 

vSAN 環境に RAC を構築した場合でも VM の構成は VMFS データストアの場合とあまり変わりませんが、

VMDK は EagerZeroed Thick にして、さらに「仮想マシン ストレージ ポリシー」で

オブジェクトの容量予約を 100% にしておきます。

 

Oracle RAC では(ゲスト)OS の iSCSI Initiator から

直接接続した iSCSI デバイスを共有ディスクとして利用することもできます。

一方、vSAN に iSCSI Target を提供する機能がありますが、

現時点(2018年3月)では物理マシンでの RAC のみを対象としているようです。

そして vSAN では RDM には対応しないので

ゲスト OS で RAC を構築するときには VMDK 共有をすることになるはずです。

 

下記の KB に制限が記載されていました。

 

vSAN 6.5 iSCSI デバイスを使用するためのベスト プラクティス (2151966)

https://kb.vmware.com/kb/2151966

制限

  • 現在、Microsoft クラスタの実装ではサポートされていません。
  • 現在、他の vSphere ホストのターゲットとしての使用はサポートされていません。
  • 現在、サードパーティのハイパーバイザーでの使用はサポートされていません。
  • 現在、仮想マシンでの使用はサポートされていません。

 

また、VMware から vSAN + Oracle RAC についてのドキュメントも公開されているので、

本番環境(デモ/開発むけのラボ環境ではなく)での構築となる場合には確認しておくとよいと思います。

 

Oracle Real Application Clusters on VMware vSAN

https://storagehub.vmware.com/t/vmware-vsan/oracle-real-application-clusters-on-vmware-virtual-san/

 

以上、PowerCLI を利用した Oracle RAC VM の情報取得例でした。

PowerCLI で vSphere / vSAN 環境での Oracle RAC むけ VM を設定してみる。(2 Node 構成)

$
0
0

以前の投稿で PowerCLI を利用して、vSAN 環境の Oracle RAC VM の情報を確認する方法を紹介しました。

PowerCLI で vSphere / vSAN 環境での Oracle RAC むけ VM の構成情報を取得してみる。

 

今回は、その VM を PowerCLI で作成する方法を紹介します。

vCenter 6.5 U1 / ESXi 6.5 U1 の vSAN 環境で、

PowerCLI は、あえて Oracle Linux 7 で使用してみました。

Linux で PowerCLI 10.0 をためしてみる。

 

VM の作成 / クローン。

今回は、db00-template というテンプレートの VM を用意しています。

テンプレート VM には、Oracle Linux 7 がインストールして、

rpm パッケージのアップデートなども済ませておくとよいと思います。

 

テンプレート VM をクローンします。

最初は Get-VM にしていますが、VM を「テンプレート」に変換している場合は Get-Template になります。

DRS を有効化している環境では、ESXi ではなく クラスタ / リソースプールを指定してクローンできます。

  • 今回のクローン先とし指定している リソースプール「rp-lab」は作成ずみです。
  • 仮想マシン フォルダ「vsan-oracle-rac」も作成ずみです。
  • クローン先のデータストアは vSAN データストア「vsanDatastore-01」です。
  • テンプレート VM には OS 領域の VMDK しかないので、Thin プロビジョニングにしています。

PS /home/gowatana> Get-VM db00-template | New-VM -ResourcePool rp-lab -Datastore vsanDatastore-01 -StorageFormat Thin -Location vsan-oracle-rac -Name db01

PS /home/gowatana> Get-VM db00-template | New-VM -ResourcePool rp-lab -Datastore vsanDatastore-01 -StorageFormat Thin -Location vsan-oracle-rac -Name db02

 

作成された VM です。

下記で見られる VM のスペックは、テンプレートの VM から引き継がれています。

PS /home/gowatana> Get-VM db0? | select Name,PowerState,NumCpu,MemoryGB,Version,GuestId,VMHost | Sort-Object Name | ft -AutoSize

 

Name PowerState NumCpu MemoryGB Version GuestId              VMHost

---- ---------- ------ -------- ------- -------              ------

db01 PoweredOff      2        8     v13 oracleLinux7_64Guest hv-i21.go-lab.jp

db02 PoweredOff      2        8     v13 oracleLinux7_64Guest hv-i21.go-lab.jp

 

 

vNIC の追加。

分散ポートグループの作成と、vNIC を追加します。

  • 今回の RAC では、Public(テンプレート VM にすでに作成ずみの vNIC#1)と Private(追加する vNIC#2)の NIC を使用する想定とします。
  • ASM 用のネットワークを分離できますが、今回は Private と兼用にします。
  • 共有ディスクは VMDK ファイルの共有で用意するので、NFS / iSCSI ネットワークも用意しません。
  • Private ネットワークむけに VLAN をわけたポートグループ作成して、vNIC はそこに接続します。
    ちなみに、この環境では分散仮想スイッチ(vDS)を利用しています。

 

まだ、それぞれの VM に vNIC は 1つだけです。

PS /home/gowatana> Get-VM db0? | Get-NetworkAdapter | select Parent,Name,Type,NetworkName,@{N="StartConnected";E={$_.ConnectionState.StartConnected}},@{N="Connected";E={$_.ConnectionState.Connected}} | Sort-Object Parent,Name | ft -AutoSize

 

Parent Name                 Type NetworkName          StartConnected Connected

------ ----                 ---- -----------          -------------- ---------

db01   Network adapter 1 Vmxnet3 dvpg-vds01-vlan-1011           True     False

db02   Network adapter 1 Vmxnet3 dvpg-vds01-vlan-1011           True     False

 

 

分散ポートグループを作成します。

PS /home/gowatana> Get-VDSwitch vds01 | New-VDPortgroup -Name dvpg-vds01-vlan-4001 -VlanId 4001

 

vNIC#2 を追加します。

PS /home/gowatana> Get-VM db0? | New-NetworkAdapter -Type Vmxnet3 -Portgroup dvpg-vds01-vlan-4001 -StartConnected:$true 

 

vNIC#2 が追加されました。

PS /home/gowatana> Get-VM db0? | Get-NetworkAdapter | select Parent,Name,Type,NetworkName,@{N="StartConnected";E={$_.ConnectionState.StartConnected}},@{N="Connected";E={$_.ConnectionState.Connected}} | Sort-Object Parent,Name | ft -AutoSize

 

Parent Name                 Type NetworkName          StartConnected Connected

------ ----                 ---- -----------          -------------- ---------

db01   Network adapter 1 Vmxnet3 dvpg-vds01-vlan-1011           True     False

db01   Network adapter 2 Vmxnet3 dvpg-vds01-vlan-4001           True     False

db02   Network adapter 1 Vmxnet3 dvpg-vds01-vlan-1011           True     False

db02   Network adapter 2 Vmxnet3 dvpg-vds01-vlan-4001           True     False

 

 

VMDK の追加。(ローカル ディスクむけ)

VM に、ローカル ディスク むけの VMDK を追加します。

これは、ソフトウェアをインストールする領域として利用します。

(いわゆる ORACLE_BASE / ORACLE_HOME / GRID_HOME...)

このディスクは、特にファイルシステムを分ける必要がない場合は不要ですが、

一般的にはファイルシステムを分割するのではないかと思います。

 

VM テンプレートでは VMDK#1 だけの状態でした。

PS /home/gowatana> Get-VM db0? | Get-HardDisk | select Parent,Name,CapacityGB,Filename | Sort-Object Parent,Name

 

Parent Name        CapacityGB Filename

------ ----        ---------- --------

db01   Hard disk 1         16 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01.vmdk

db02   Hard disk 1         16 [vsanDatastore-01] cac6ab5a-1074-611f-a546-b8aeedea7a23/db02.vmdk

 

 

VMDK を追加します。

PS /home/gowatana> Get-VM db0? | New-HardDisk -Datastore vsanDatastore-01 -CapacityGB 40 -StorageFormat Thin

 

VMDK が追加されました。

PS /home/gowatana> Get-VM db0? | Get-HardDisk | select Parent,Name,CapacityGB,Filename | Sort-Object Parent,Name

 

Parent Name        CapacityGB Filename

------ ----        ---------- --------

db01   Hard disk 1         16 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01.vmdk

db01   Hard disk 2         40 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_1.vmdk

db02   Hard disk 1         16 [vsanDatastore-01] cac6ab5a-1074-611f-a546-b8aeedea7a23/db02.vmdk

db02   Hard disk 2         40 [vsanDatastore-01] cac6ab5a-1074-611f-a546-b8aeedea7a23/db02_1.vmdk

 

 

VMDK の追加。(共有ディスクむけ / db01 側)

RAC の共有ディスクとして利用するための VMDK を追加します。

共有ディスクとして利用する VMDK ファイルの作成は、1台の VM(今回は db01)で実施します。

  • 共有ディスクむけの VMDK は、仮想 SCSI コントローラ(vSCSI Controller)を分けておきます。
  • EagerZeroed Thick にしておきます。
  • スナップショットの対象外になるように「-Persistence IndependentPersistent」にしておきます。

 

デフォルトでは、vSCSI Controller は 1つだけのはずです。

PS /home/gowatana> Get-VM db0? | Get-ScsiController | select Parent,Name,Type,BusSharingMode | Sort-Object Parent

 

Parent Name                     Type BusSharingMode

------ ----                     ---- --------------

db01   SCSI controller 0 ParaVirtual      NoSharing

db02   SCSI controller 0 ParaVirtual      NoSharing

 

 

VMDK と vSCSI Controller を追加します。

PS /home/gowatana> Get-VM db01 | New-HardDisk -CapacityGB 30 -Datastore vsanDatastore-01 -StorageFormat EagerZeroedThick -Persistence IndependentPersistent | New-ScsiController -Type ParaVirtual

 

これで、vSCSI Controllr と VMDK が同時に追加されます。

PS /home/gowatana> Get-VM db01 | Get-ScsiController | select Parent,Name,Type,BusSharingMode

 

Parent Name                     Type BusSharingMode

------ ----                     ---- --------------

db01   SCSI controller 0 ParaVirtual      NoSharing

db01   SCSI controller 1 ParaVirtual      NoSharing

 

 

PS /home/gowatana> Get-VM db01 | Get-HardDisk | Get-SpbmEntityConfiguration | ft -AutoSize

 

Entity      Storage Policy    Status    Time Of Check

------      --------------    ------    -------------

Hard disk 1 vsan-policy-raid5 compliant 2018/03/16 18:45:07

Hard disk 2 vsan-policy-raid5 compliant 2018/03/16 21:21:45

Hard disk 3                   none

 

 

さらに VMDK を追加する場合は、ここで追加された 「SCSI controller 1」を指定します。

今回は、あと 5つ追加します。

PS /home/gowatana> Get-VM db01 | New-HardDisk -CapacityGB 30 -Datastore vsanDatastore-01 -StorageFormat EagerZeroedThick -Persistence IndependentPersistent -Controller "SCSI controller 1"

PS /home/gowatana> Get-VM db01 | New-HardDisk -CapacityGB 30 -Datastore vsanDatastore-01 -StorageFormat EagerZeroedThick -Persistence IndependentPersistent -Controller "SCSI controller 1"

PS /home/gowatana> Get-VM db01 | New-HardDisk -CapacityGB 30 -Datastore vsanDatastore-01 -StorageFormat EagerZeroedThick -Persistence IndependentPersistent -Controller "SCSI controller 1"

PS /home/gowatana> Get-VM db01 | New-HardDisk -CapacityGB 30 -Datastore vsanDatastore-01 -StorageFormat EagerZeroedThick -Persistence IndependentPersistent -Controller "SCSI controller 1"

PS /home/gowatana> Get-VM db01 | New-HardDisk -CapacityGB 30 -Datastore vsanDatastore-01 -StorageFormat EagerZeroedThick -Persistence IndependentPersistent -Controller "SCSI controller 1"

 

結果的に、Controller 1001 の VMDK#3~#8 が追加されました。

PS /home/gowatana> Get-VM db01 | Get-HardDisk | select Parent,Name,CapacityGB,@{N="Controller";E={$_.ExtensionData.ControllerKey}},StorageFormat,@{N="StoragePolicy";E={($_|Get-SpbmEntityConfiguration).StoragePolicy}} | Sort-Object Parent,Name | ft -AutoSize

 

Parent Name        CapacityGB Controller    StorageFormat StoragePolicy

------ ----        ---------- ----------    ------------- -------------

db01   Hard disk 1         16       1000             Thin vsan-policy-raid5

db01   Hard disk 2         40       1000             Thin vsan-policy-raid5

db01   Hard disk 3         30       1001 EagerZeroedThick

db01   Hard disk 4         30       1001 EagerZeroedThick vsan-policy-raid5

db01   Hard disk 5         30       1001 EagerZeroedThick vsan-policy-raid5

db01   Hard disk 6         30       1001 EagerZeroedThick vsan-policy-raid5

db01   Hard disk 7         30       1001 EagerZeroedThick vsan-policy-raid5

db01   Hard disk 8         30       1001 EagerZeroedThick vsan-policy-raid5

 

 

VMDK ファイルは、すべて vSAN データストアに格納されています。

PS /home/gowatana> Get-VM db01 | Get-HardDisk | select Parent,Name,Filename | Sort-Object Parent,Name | ft -AutoSize

 

Parent Name        Filename

------ ----        --------

db01   Hard disk 1 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01.vmdk

db01   Hard disk 2 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_1.vmdk

db01   Hard disk 3 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_2.vmdk

db01   Hard disk 4 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_3.vmdk

db01   Hard disk 5 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_4.vmdk

db01   Hard disk 6 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_5.vmdk

db01   Hard disk 7 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_6.vmdk

db01   Hard disk 8 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_7.vmdk

 

 

仮想マシン ストレージ ポリシーの作成。

RAC の共有ディスクむけに、仮想マシン ストレージ ポリシーを作成します。

  • オブジェクト領域予約を 100% にします。
  • 許容される障害数(FTT)を 1 にします。
  • オブジェクトあたりのディスク ストライプ数は 2 にします。

PS /home/gowatana> $r1 = New-SpbmRule -Capability (Get-SpbmCapability -Name VSAN.proportionalCapacity) -Value 100

PS /home/gowatana> $r2 = New-SpbmRule -Capability (Get-SpbmCapability -Name VSAN.hostFailuresToTolerate) -Value 1

PS /home/gowatana> $r3 = New-SpbmRule -Capability (Get-SpbmCapability -Name VSAN.stripeWidth) -Value 2

PS /home/gowatana> $rs1 = New-SpbmRuleSet -AllOfRules $r1, $r2, $r3

PS /home/gowatana> New-SpbmStoragePolicy -Name vsan-policy-rac-01 -AnyOfRuleSets $rs1

 

ポリシーが作成されました。

PS /home/gowatana> Get-SpbmStoragePolicy -Name "vsan-policy-rac-01" | select -ExpandProperty AnyOfRuleSets | %{$name = $_.Name; $_ | select -ExpandProperty AllOfRules | select @{N="RuleName";E={$Name}},Capability,Value} | ft -AutoSize

 

RuleName   Capability                  Value

--------   ----------                  -----

Rule-Set 1 VSAN.proportionalCapacity     100

Rule-Set 1 VSAN.hostFailuresToTolerate     1

Rule-Set 1 VSAN.stripeWidth                2

 

 

VMDK へのポリシー割り当て。(db01)

共有ディスクむけの VMDK にポリシーを割り当てます。

接続されている vSCSI Controller を識別したほうがよいと思いますが、

今回は Persistence を IndependentPersistent にしている VMDK に対して割り当てます。

(見分けやすいので)

PS /home/gowatana> Get-VM db01 | Get-HardDisk | where {$_.Persistence -eq "IndependentPersistent"} | Set-SpbmEntityConfiguration -StoragePolicy vsan-policy-rac-01

 

vSCSI Controller 1(Key が 1001)の VMDK のポリシーが変更されました。

PS /home/gowatana> Get-VM db01 | Get-HardDisk | select Parent,Name,CapacityGB,@{N="Controller";E={$_.ExtensionData.ControllerKey}},StorageFormat,@{N="StoragePolicy";E={($_|Get-SpbmEntityConfiguration).StoragePolicy}} | Sort-Object Parent,Name | ft -AutoSize

 

Parent Name        CapacityGB Controller    StorageFormat StoragePolicy

------ ----        ---------- ----------    ------------- -------------

db01   Hard disk 1         16       1000             Thin vsan-policy-raid5

db01   Hard disk 2         40       1000             Thin vsan-policy-raid5

db01   Hard disk 3         30       1001 EagerZeroedThick vsan-policy-rac-01

db01   Hard disk 4         30       1001 EagerZeroedThick vsan-policy-rac-01

db01   Hard disk 5         30       1001 EagerZeroedThick vsan-policy-rac-01

db01   Hard disk 6         30       1001 EagerZeroedThick vsan-policy-rac-01

db01   Hard disk 7         30       1001 EagerZeroedThick vsan-policy-rac-01

db01   Hard disk 8         30       1001 EagerZeroedThick vsan-policy-rac-01

 

 

VMDK の追加。(共有ディスクむけ / db02 側)

db02 に、仮想ディスクを接続します。

db01 の下記のディスクが対象になります。

PS /home/gowatana> Get-VM db01 | Get-HardDisk | where {$_.Persistence -eq "IndependentPersistent"} | select Name,Filename

 

Name        Filename

----        --------

Hard disk 3 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_2.vmdk

Hard disk 4 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_3.vmdk

Hard disk 5 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_4.vmdk

Hard disk 6 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_5.vmdk

Hard disk 7 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_6.vmdk

Hard disk 8 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_7.vmdk

 

 

db02 の最初の共有 VMDK を接続するときに、あわせて vSCSI Controller を追加します。

PS /home/gowatana> Get-VM db02 | New-HardDisk -DiskPath "[vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_2.vmdk" -Persistence IndependentPersistent | New-ScsiController -Type ParaVirtual

 

Type                 BusSharingMode       UnitNumber

----                 --------------       ----------

ParaVirtual          NoSharing                     4

 

 

残りの VMDK も接続します。

PS /home/gowatana> Get-VM db02 | New-HardDisk -DiskPath "[vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_3.vmdk" -Persistence IndependentPersistent -Controller "SCSI controller 1"

PS /home/gowatana> Get-VM db02 | New-HardDisk -DiskPath "[vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_4.vmdk" -Persistence IndependentPersistent -Controller "SCSI controller 1"

PS /home/gowatana> Get-VM db02 | New-HardDisk -DiskPath "[vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_5.vmdk" -Persistence IndependentPersistent -Controller "SCSI controller 1"

PS /home/gowatana> Get-VM db02 | New-HardDisk -DiskPath "[vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_6.vmdk" -Persistence IndependentPersistent -Controller "SCSI controller 1"

PS /home/gowatana> Get-VM db02 | New-HardDisk -DiskPath "[vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_7.vmdk" -Persistence IndependentPersistent -Controller "SCSI controller 1"

 

db01、db02 両方に同じパスの VMDK ファイルが接続された状態になりました。

PS /home/gowatana> Get-VM db0? | Get-HardDisk | where {$_.Persistence -eq "IndependentPersistent"} | group Filename | select Count,@{N="VMs";E={($_.Group.Parent | Sort-Object)  -join ","}},Name | ft -AutoSize

 

Count VMs       Name

----- ---       ----

    2 db01,db02 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_2.vmdk

    2 db01,db02 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_3.vmdk

    2 db01,db02 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_4.vmdk

    2 db01,db02 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_5.vmdk

    2 db01,db02 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_6.vmdk

    2 db01,db02 [vsanDatastore-01] 60c4ab5a-6c3e-ca85-29da-b8aeedea7a23/db01_7.vmdk

 

 

VMDK へのポリシー割り当て。(db02)

db02 では、まだ想定しているポリシーが割り当てられていません。

PS /home/gowatana> Get-VM db02 | Get-HardDisk | Get-SpbmEntityConfiguration | ft -AutoSize

 

Entity      Storage Policy    Status    Time Of Check

------      --------------    ------    -------------

Hard disk 1 vsan-policy-raid5 compliant 2018/03/16 18:45:07

Hard disk 2 vsan-policy-raid5 compliant 2018/03/16 21:21:40

Hard disk 3                   none

Hard disk 4 vsan-policy-raid5 outOfDate 2018/03/17 2:11:59

Hard disk 5 vsan-policy-raid5 outOfDate 2018/03/17 2:12:15

Hard disk 6 vsan-policy-raid5 outOfDate 2018/03/17 2:12:32

Hard disk 7 vsan-policy-raid5 outOfDate 2018/03/17 2:12:48

Hard disk 8 vsan-policy-raid5 outOfDate 2018/03/17 2:13:05

 

 

ポリシーを割り当てます。

PS /home/gowatana> Get-VM db02 | Get-HardDisk | where {$_.Persistence -eq "IndependentPersistent"} | Set-SpbmEntityConfiguration -StoragePolicy vsan-policy-rac-01

 

ポリシーが割り当てれました。少しまつと Compliant になります。

PS /home/gowatana> Get-VM db02 | Get-HardDisk | Get-SpbmEntityConfiguration | ft -AutoSize

 

Entity      Storage Policy     Status    Time Of Check

------      --------------     ------    -------------

Hard disk 1 vsan-policy-raid5  compliant 2018/03/16 18:45:07

Hard disk 2 vsan-policy-raid5  compliant 2018/03/16 21:21:40

Hard disk 3 vsan-policy-rac-01 compliant 2018/03/17 2:26:09

Hard disk 4 vsan-policy-rac-01 compliant 2018/03/17 2:26:16

Hard disk 5 vsan-policy-rac-01 compliant 2018/03/17 2:26:25

Hard disk 6 vsan-policy-rac-01 compliant 2018/03/17 2:26:32

Hard disk 7 vsan-policy-rac-01 compliant 2018/03/17 2:26:39

Hard disk 8 vsan-policy-rac-01 compliant 2018/03/17 2:26:47

 

 

VMDK への multi-writer 設定。(db01 / db02 両方)

コマンドひとつで multi-writer フラグを設定できないようなので、下記のように設定します。

まず Hard disk 3 だけ設定変更します。

PS /home/gowatana> $vm = Get-VM db01

PS /home/gowatana> $disk = $vm | Get-HardDisk -Name "Hard disk 3"

PS /home/gowatana> $spec = New-Object VMware.Vim.VirtualMachineConfigSpec

PS /home/gowatana> $spec.deviceChange = New-Object VMware.Vim.VirtualDeviceConfigSpec

PS /home/gowatana> $spec.deviceChange[0].operation = 'edit'

PS /home/gowatana> $spec.deviceChange[0].device = New-Object VMware.Vim.VirtualDisk

PS /home/gowatana> $spec.deviceChange[0].device = $disk.ExtensionData

PS /home/gowatana> $spec.deviceChange[0].device.Backing.Sharing = "sharingMultiWriter"

PS /home/gowatana> $vm.ExtensionData.ReconfigVM($spec)

 

設定されました。

PS /home/gowatana> Get-VM db01 | Get-HardDisk | select Parent,Name,@{N="Sharing";E={$_.ExtensionData.Backing.Sharing}}

 

Parent Name        Sharing

------ ----        -------

db01   Hard disk 1 sharingNone

db01   Hard disk 2 sharingNone

db01   Hard disk 3 sharingMultiWriter

db01   Hard disk 4 sharingNone

db01   Hard disk 5 sharingNone

db01   Hard disk 6 sharingNone

db01   Hard disk 7 sharingNone

db01   Hard disk 8 sharingNone

 

 

煩雑なので、下記のような PowerShell のファンクションを作成します。

function Set-MultiWriterFlag ($vm_name, $vdisk_name) {

    $vm = Get-VM $vm_name

    $disk = $vm | Get-HardDisk -Name $vdisk_name

    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec

    $spec.deviceChange = New-Object VMware.Vim.VirtualDeviceConfigSpec

    $spec.deviceChange[0].operation = 'edit'

    $spec.deviceChange[0].device = New-Object VMware.Vim.VirtualDisk

    $spec.deviceChange[0].device = $disk.ExtensionData

    $spec.deviceChange[0].device.Backing.Sharing = "sharingMultiWriter"

    $vm.ExtensionData.ReconfigVM($spec)

}

 

ひたすら設定します。(db01)

PS /home/gowatana> function Set-MultiWriterFlag ($vm_name, $vdisk_name) {

>>     $vm = Get-VM $vm_name            

>>     $disk = $vm | Get-HardDisk -Name $vdisk_name

>>     $spec = New-Object VMware.Vim.VirtualMachineConfigSpec

>>     $spec.deviceChange = New-Object VMware.Vim.VirtualDeviceConfigSpec

>>     $spec.deviceChange[0].operation = 'edit'

>>     $spec.deviceChange[0].device = New-Object VMware.Vim.VirtualDisk

>>     $spec.deviceChange[0].device = $disk.ExtensionData

>>     $spec.deviceChange[0].device.Backing.Sharing = "sharingMultiWriter"

>>     $vm.ExtensionData.ReconfigVM($spec)

>> }

PS /home/gowatana> Set-MultiWriterFlag db01 "Hard disk 3"

PS /home/gowatana> Set-MultiWriterFlag db01 "Hard disk 4"

PS /home/gowatana> Set-MultiWriterFlag db01 "Hard disk 5"

PS /home/gowatana> Set-MultiWriterFlag db01 "Hard disk 6"

PS /home/gowatana> Set-MultiWriterFlag db01 "Hard disk 7"

PS /home/gowatana> Set-MultiWriterFlag db01 "Hard disk 8"

 

のこりの db02 も設定します。

PS /home/gowatana> Get-VM db02 | Get-HardDisk | where {$_.Persistence -eq "IndependentPersistent"} | % {Set-MultiWriterFlag $_.Parent.Name $_.Name}

 

設定されました。

PS /home/gowatana> Get-VM db0? | Get-HardDisk | select Parent,Name,@{N="Sharing";E={$_.ExtensionData.Backing.Sharing}} | Sort-Object Parent,Name

 

Parent Name        Sharing

------ ----        -------

db01   Hard disk 1 sharingNone

db01   Hard disk 2 sharingNone

db01   Hard disk 3 sharingMultiWriter

db01   Hard disk 4 sharingMultiWriter

db01   Hard disk 5 sharingMultiWriter

db01   Hard disk 6 sharingMultiWriter

db01   Hard disk 7 sharingMultiWriter

db01   Hard disk 8 sharingMultiWriter

db02   Hard disk 1 sharingNone

db02   Hard disk 2 sharingNone

db02   Hard disk 3 sharingMultiWriter

db02   Hard disk 4 sharingMultiWriter

db02   Hard disk 5 sharingMultiWriter

db02   Hard disk 6 sharingMultiWriter

db02   Hard disk 7 sharingMultiWriter

db02   Hard disk 8 sharingMultiWriter

 

 

DRS ルールの作成。

クラスタで DRS を有効にしているので、DRS ルールも設定しておきます。

アンチ アフィニティ ルールで、db01 と db02 が別の ESXi ホストで稼働するようにします。

 

アンチ アフィニティ ルールを作成します。

PS /home/gowatana> Get-Cluster vsan-cluster-01 | New-DrsRule -KeepTogether:$false -Name drs-anti-affinity-rac-01 -VM db01,db02

 

ルールが作成されました。

PS /home/gowatana> Get-Cluster vsan-cluster-01 | Get-DrsRule -Name drs-anti-affinity-rac-01 | select Cluster,Name,Type,Mandatory,Enabled,@{N="VMs";E={($_.VMIds | %{(Get-VM -Id $_).Name}) -join ","}}

 

 

Cluster   : vsan-cluster-01

Name      : drs-anti-affinity-rac-01

Type      : VMAntiAffinity

Mandatory : False

Enabled   : True

VMs       : db01,db02

 

 

VM の起動。

ここで VM を起動します。

PS /home/gowatana> Get-VM db0? | Start-VM

 

Name                 PowerState Num CPUs MemoryGB

----                 ---------- -------- --------

db01                 PoweredOn  2        8.000

db02                 PoweredOn  2        8.000

 

 

Oracle RAC 構築。

Oracle Grid Infrastructure と Oracle Database をインストールして、RAC データベースを作成します。

(ここでは省略)

 

Oracle RAC のゲスト OS からみた VMDK の様子。

vSAN 上の VMDK ファイルによる仮想ディスクは、ゲスト OS から見ると VMFS にある仮想ディスクと同様に

「VMware Virtual disk」と認識されています。

[grid@db01 ~]$ cat /etc/oracle-release

Oracle Linux Server release 7.4

[grid@db01 ~]$ lsscsi

[2:0:0:0]    disk    VMware   Virtual disk     2.0   /dev/sda

[2:0:1:0]    disk    VMware   Virtual disk     2.0   /dev/sdb

[3:0:0:0]    cd/dvd  NECVMWar VMware SATA CD00 1.00  /dev/sr0

[4:0:0:0]    disk    VMware   Virtual disk     2.0   /dev/sdc

[4:0:1:0]    disk    VMware   Virtual disk     2.0   /dev/sdd

[4:0:2:0]    disk    VMware   Virtual disk     2.0   /dev/sde

[4:0:3:0]    disk    VMware   Virtual disk     2.0   /dev/sdf

[4:0:4:0]    disk    VMware   Virtual disk     2.0   /dev/sdg

[4:0:5:0]    disk    VMware   Virtual disk     2.0   /dev/sdh

[grid@db01 ~]$

 

共有ディスクとして追加した 30GB のディスクは下記です。

[grid@db01 ~]$ lsblk -l /dev/sd[c-h]

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sdc    8:32   0  30G  0 disk

sdd    8:48   0  30G  0 disk

sde    8:64   0  30G  0 disk

sdf    8:80   0  30G  0 disk

sdg    8:96   0  30G  0 disk

sdh    8:112  0  30G  0 disk

[grid@db01 ~]$

 

Oracle RAC の ASM で利用される Oracle ASM Filter Driver (ASMFD)では、

下記のようなラベルが付与されます。

[grid@db01 ~]$ asmcmd afd_lsdsk --all

node 'db01':

--------------------------------------------------------------------------------

Label                     Filtering   Path

================================================================================

DATA1                       ENABLED   /dev/sdf

DATA2                       ENABLED   /dev/sdg

DATA3                       ENABLED   /dev/sdh

GRID1                       ENABLED   /dev/sdc

GRID2                       ENABLED   /dev/sde

GRID3                       ENABLED   /dev/sdd

node 'db02':

--------------------------------------------------------------------------------

Label                     Filtering   Path

================================================================================

DATA1                       ENABLED   /dev/sdf

DATA2                       ENABLED   /dev/sdg

DATA3                       ENABLED   /dev/sdh

GRID1                       ENABLED   /dev/sdc

GRID2                       ENABLED   /dev/sde

GRID3                       ENABLED   /dev/sdd

[grid@db01 ~]$

 

/dev/sdc、/dev/sdd、/dev/sde で +GRID という ASM Disk Group、

/dev/sdf、/dev/sdg、/dev/sdh で +DATA という ASM Disk Group を構成してあります。

今回の例では微妙な感じになっていますが、/dev/sd? のデバイス名は永続的なものではないので、

Linux OS の再起動で別の名前に変わったりします。

仮想ハードディスクと ゲストOSのデバイス名をうまく対応させるには

最初にディスク認識させたときに識別して ASMFD のラベル付けをする必要があります。

[grid@db01 ~]$ export ORACLE_SID=+ASM1

[grid@db01 ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 12.2.0.1.0 Production on 日 3月 18 03:20:34 2018

 

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

 

Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

 

SQL> set line 120

SQL> col label for a10

SQL> col path for a10

SQL> col DG_NAME for a10

SQL> select dg.NAME as DG_NAME,d.DISK_NUMBER,LABEL,PATH,d.TOTAL_MB from v$asm_disk d,v$asm_diskgroup dg where d.GROUP_NUMBER = dg.GROUP_NUMBER and d.TOTAL_MB > 0;

 

DG_NAME    DISK_NUMBER LABEL      PATH         TOTAL_MB

---------- ----------- ---------- ---------- ----------

GRID                 0 GRID1      AFD:GRID1       30720

GRID                 1 GRID2      AFD:GRID2       30720

GRID                 2 GRID3      AFD:GRID3       30720

DATA                 0 DATA1      AFD:DATA1       30720

DATA                 1 DATA2      AFD:DATA2       30720

DATA                 2 DATA3      AFD:DATA3       30720

 

6 rows selected.

 

SQL>

 

ちなみに、2 ノードでの 12c R2 RAC では下記のようなリソース構成になります。

[grid@db01 ~]$ crsctl stat res -t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ASMNET1LSNR_ASM.lsnr

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

ora.DATA.dg

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

ora.GRID.dg

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

ora.LISTENER.lsnr

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

ora.chad

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

ora.net1.network

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

ora.ons

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

ora.proxy_advm

               OFFLINE OFFLINE      db01                     STABLE

               OFFLINE OFFLINE      db02                     STABLE

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       db01                     STABLE

ora.MGMTLSNR

      1        ONLINE  ONLINE       db01                     169.254.131.137 192.

                                                             168.41.171,STABLE

ora.asm

      1        ONLINE  ONLINE       db01                     Started,STABLE

      2        ONLINE  ONLINE       db02                     Started,STABLE

      3        OFFLINE OFFLINE                               STABLE

ora.cvu

      1        ONLINE  ONLINE       db01                     STABLE

ora.db01.vip

      1        ONLINE  ONLINE       db01                     STABLE

ora.db02.vip

      1        ONLINE  ONLINE       db02                     STABLE

ora.mgmtdb

      1        ONLINE  ONLINE       db01                     Open,STABLE

ora.orcl.db

      1        ONLINE  ONLINE       db01                     Open,HOME=/u01/app/o

                                                             racle/product/12.2.0

                                                             /dbhome_1,STABLE

      2        ONLINE  ONLINE       db02                     Open,HOME=/u01/app/o

                                                             racle/product/12.2.0

                                                             /dbhome_1,STABLE

ora.qosmserver

      1        ONLINE  ONLINE       db01                     STABLE

ora.scan1.vip

      1        ONLINE  ONLINE       db01                     STABLE

--------------------------------------------------------------------------------

[grid@db01 ~]$

 

このなかで、共有ディスクの ASM Disk Group (+DATA、+GRID)のリソースは下記の部分です。

[grid@db01 ~]$ crsctl stat res -w '(TYPE = ora.diskgroup.type)' -t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.DATA.dg

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

ora.GRID.dg

               ONLINE  ONLINE       db01                     STABLE

               ONLINE  ONLINE       db02                     STABLE

--------------------------------------------------------------------------------

[grid@db01 ~]$

 

以上、PowerCLI で Oracle RAC むけ VM を設定してみる話でした。

Ireland VMUG February 2018 - An Insider Perspective

$
0
0

This year I got invited to speak at Ireland VMUG on Friday February 2nd. I have to admit I was quite nervous about it as I always considered presenting at VMUG a great honor - especially for someone as me; not really known in the industry... yet

 

Read more on my personal blog page:

Ireland VMUG February 2018 - An Insider Perspective

Quickie #1: vSphere Server in a budget lab

$
0
0

Quickie (noun):

1.  a rapidly consumed alcoholic drink.

2.  a brief act of sexual intercourse.

Today we're going to add a third definition to that list:

3. a low effort (but still informative) blog post.

 

In this post we're going to take a look at vCenter Server deployment in under-powered environment.

 

Read more on my personal blog page:

Quickie #1: vSphere Server in a budget lab

Quickie #2: Reset ESXi Password - The Easy Method

$
0
0

You've lost your ESXi root password. Simple as that. You might not like it, but that's the world we're living in. It's your fault, you know it, the world will never be the same unless you quickly open up your browser and look for a solution. Take a deep breath, because that's gonna be tricky (...as tying your shoes).

 

Read more on my personal blog page:

 

Quickie #2: Reset ESXi Password - The Easy Method

Setting up a simple Linux VM for internal routing within virtual environment

$
0
0

Essential network components are sometimes the hardest to configure without knowing the basics. When I first started working on a virtual environment, I didn't even know I had to setup networking! It took me weeks to understand fully how all the VMware "parts" speak to each other. The vKernels, vSwitches, vLANs versus VLANs... yeah, that's a story for another time.

For now, let's talk about the basics. In this post I'll quickly walk you through the process of setting up a virtual router (vRouter) - a Linux VM responsible for most of your internal virtual networking. Once we have that up and going, we can continue our journey through the exciting world of virtual networking inside both VMware vSphere and Hyper-V.

 

Read more on my personal blog page:

 

Setting up a simple Linux VM for internal routing within virtual environment


Setting up OpenVPN Server in a virutal environment

$
0
0

We’re all lazy, aren’t we? If you think about it for a second, everything you do is more or less aimed at making your life easier, simpler and less-time consuming. Think about your last project. What were you more concerned about: polishing every little detail or maybe getting some stuff done as soon as possible due to an incoming deadline?

 

Read more on my personal bloga page:

 

VPN - Setting up OpenVPN Server - Part 1

 

VPN - Setting up OpenVPN Server - Part 2

Quickie #3: Enabling RDP on VMware Horizon Client for Linux

Configuring VMware Identity Manager as Federation Identity Provider for Azure AD

$
0
0

Use Case

 

  • SaaS applications federated with Azure AD
  • Azure AD delegates all user authentication including conditional access to Workspace ONE (VMware Identity Manager)

 

Configuration Steps

 

  • Configure your Active Directory with Azure AD and VMware Identity Manager

 

 

 

  • Test the configuration
    Goto https://portal.azure.com. Enter user email address. You should be redirected to your VMware Identity Manager instance/tenant for authentication.

SovLabs Property Toolkit Part 2: Dynamic Custom Property Assignment

$
0
0

     Custom properties (CPs henceforth) are the lifeblood of vRA, as many of those reading this know. They are a rich system of metadata which can influence not only the decisions made by vRA proper but also extensibility through vRO. CPs are life, effectively, and one of the biggest challenges is managing those CPs and having their values set simply and without too much complexity. A common problem arises in the face of this which amounts to CP sprawl in a request form. When CPs are used for most major decisions, the user in the request form may be bombarded with a whole array of them which can slow down provisioning time, increase adoptability, and lead to user error (by virtue of incorrect selection in the form). Property Toolkit can help eliminate almost all of these through transparent, background, silent assignment of other properties.

 

     Consider this scenario: Your vRA catalog requires users to select a number of values which steer the deployment in a variety of ways. For example, you ask the user to select the following: Application, Environment, Storage, and Network. But you require them to select the correct value based on an earlier selection, like where the application is “Oracle” they need to provision this to “Production” only as other environments are not licensed appropriately. And also, given the environment, there is a specific network associated with only that environment and so they have to pick the correct one. Now, this can be done with vRO actions, but wouldn’t it be nice if you could only ask them to choose *one* thing in the form and all other decisions were made automatically? Further, wouldn’t it be awesome if all that logic *didn’t* require you to design new workflows or actions in vRO or crunch new JavaScript? Well, if this is something you’re looking to do (or any variant thereof), then Property Toolkit is your savior because that’s exactly what it’s designed to do (plus more). Let’s see how to do this in a real life example.

 

We need to set several CPs to steer a deployment to the correct place. These are as follows:

  1. Environment. This sets the target cluster where the machine(s) will be built.
  2. Reservation Policy. Selects the right reservation policy (which can open up things like endpoint and datacenter).
  3. Network Profile. Sets the correct network on which the machine(s) will be attached.
  4. Name. Provides part of the name in our custom naming standard.
  5. Storage Reservation Policy. Sets the storage which will be consumed.

 

Now, we could list each of these individually in a request form and have the user select each and every one (after making sure to tell them how to complete the form). But even easier, let’s define only a single CP and have each of these 5 CPs get their value based on it. I’m going to create a CP called My.RequestForm.Prop and provide three possible values: A, B, and C.

 

 

I’ll show this as a dropdown in the form. These values can be whatever you like, but I’m just using simple letters in this case for illustration. For example, instead of A, B, and C these could be application names like Oracle, JBoss, and Apache.

 

Next, I want to set the first of the dynamic properties, Environment, based on the value of My.RequestForm.Prop. The Environment CP will be called CZ.MyProp.Environment and the choices I have are Prod, Dev, and QA. I’ll map them one-for-one to the values you see above in My.RequestForm.Prop. In other words, if a user selects A from the list, then the value of CZ.MyProp.Environment will be dynamically set to Prod. If the user chooses B then it’ll be Dev and so on. In order to do this, all we need to do is create a new property on the deployment and call it SovLabs_CreateProperties_<anything>. The <anything> portion can truly be whatever you want—it’s only a label for your organizational purposes. So long as the property begins with SovLabs_CreateProperties_ then it’ll invoke the Property Toolkit module. The value of this property can be a variety of things as explained in the documentation, but in this case let’s use an array of single objects. The value of this property becomes the value of another property. For example, if I wanted to define a new property in the simplest way, I could set the value to this:

 

[{"name" : "CZ.Cities", "value" : "Texas"}]

 

When the module ran, I would then get a new CP defined on the deployment with name of CZ.Cities and a value of Texas. But, because everything SovLabs does is templated, we have a whole host of operators at our disposal thanks to the templating engine. The one which we want to use here is the case/when operator. This will allow us to switch to a different value based on another value. So getting back to the new CP we want to set, the value of that property would get defined as such:

 

[{"name" : "CZ.MyProp.Environment", "value" : "{% case My.RequestForm.Prop %}{% when 'A' %}Prod{% when 'B' %}Dev{% when 'C' %}QA{% else %}UNKNOWN{% endcase %}"}]

 

It’s fairly straightforward. If the value set in My.RequestForm.Prop equals A then assign the value of Prod to CZ.MyProp.Environment. If that value is B then let it equal Dev and so on.

 

Now we have that one, let’s define the others with the same basic statement. To simplify this, you can put them all in a single property group and attach that property group to your blueprint. To save time, I’ve drawn up the following table which shows the combinations.

 

CP Name

CP Value

My.RequestForm.Prop

A

B

C

CZ.MyProp.Environment

Prod

Dev

QA

CZ.MyProp.ResPol

ReservationA

ReservationB

ReservationC

CZ.MyProp.NetProfile

NetworkA

NetworkB

NetworkC

SovLabs.Naming.App

TST

ORA

APA

VirtualMachine.Disk0.StorageReservationPolicy

Diskstation

vSAN

Diskstation

 

Effectively, then, the value of a single property (My.RequestForm.Prop) will influence the outcome of five other properties dynamically. Graphically, it can be represented as the following.

 

If the value of My.RequestForm.Prop equals A then all the following values are set below it. If B, then all those in that column apply, etc. In this demo, I built a single property group and stashed all these properties there, although they could be in just a single dynamic property definition if you wish.

 

 

The exception is the CP VirtualMachine.Disk0.StorageReservationPolicy as this must be set on the machine element in the canvas and not the blueprint level.

 

If we flip over to the request form, we can see how simple this can be when presented to the end user.

 

 

Let’s select A then deploy to see what happens.

 

 

 

Based on the value A the Property Toolkit then set the 5 CPs we were after, including SovLabs.Naming.App which I am then consuming in another SovLabs module for Custom Naming (which produced the “TST” portion of the hostname you see). It got the correct Environment, it got the correct Reservation Policy, Network Profile, and it also went to the correct storage because this property, while on the machine element, still was able to be set from the initial value of A.

 

 

Although I’ve obviously created a few of these properties myself to illustrate what you can do, you can use this module to set any CP, even reserved system properties such as the one that controls the storage reservation policy. Can you not see how incredibly flexible this can make your deployments? We can ask the user to make but a single decision, and based on that outcome we can then dynamically set any number of other CPs. That’s amazing if you ask me and something that, prior to the Property Toolkit, required a whole heap of complex JavaScript and vRO plumbing to get done.

 

So, this is cool, but let’s take it one step further. Let’s let My.RequestForm.Prop influence another CP, and then let’s let *that* value influence another CP. In this manner, we can create cascading dynamic property assignment. Here’s what I mean.

 

Let’s still ask the user to pick a value of My.RequestForm.Prop. The value they choose will still influence the Environment CP (CZ.MyProp.Environment if you recall). But, rather than basing the Reservation Policy CP on My.RequestForm.Prop, what if we could determine that from the Environment CP? Graphically, it’d be represented like this:

 

 

And to put that in context with the other properties, the altered flow chart would result as the following.

 

 

In order to distinguish, I’ll change the possible values of CZ.MyProp.ResPol from the table previously to be the following: ReservationPrd, ReservationDev, and ReservationQA. Now, let’s change the definition of CZ.MyProp.ResPol to key off of CZ.MyProp.Environment and not My.RequestForm.Prop.

 

[{"name" : "CZ.MyProp.ResPol", "value" : "{% case CZ.MyProp.Environment %}{% when 'Prod' %}ReservationPrd{% when 'Dev' %}ReservationDev{% when 'QA' %}ReservationQA{% else %}UNKNOWN{% endcase %}"}]

 

Let’s make the same request and see what happens this time.

 

 

Amazing! All we’ve changed is the definition for CZ.MyProp.ResPol in this case and nothing else. Can you imagine the possibilities this opens up? The freedom, flexibility, and power the Property Toolkit enables your vRA to have is limited only by your imagination.

 

     To recap, then, in part one of the Property Toolkit series, we showed how it can synthesize new CPs based on the value of others. This was illustrated with the vCenter Folder use case. In part two here, we are creating dynamic property sets in which the value of multiple different CPs get their values from other CPs. We did this in two ways. The first was to assign five separate properties based on the value of one reference CP. The second was to cascade this logic by letting one equal another which equals yet another. In both cases, we achieved a dynamic assignment of various CPs even in different places by exposing just a single decision in the request form.

 

     I really hope you’ve found this article to be helpful and that it has stirred your imagination with all the various ways you can use Property Toolkit to make your life simpler and your vRA much more powerful all while reducing complexity. It really is game-changing integration that opens so many doors all while eliminating the need to write, test, and maintain custom code. If you have any thoughts or comments about this article, please feel free to reach me on Twitter (@chipzoller).

Making vRA Email Easy with Custom Notifications

$
0
0

     Email is one of those things that most of us take for granted these days. We just expect email works, that it is flexible, and that it’s adaptable to our situation. Within vRA, we can also get email in and out based on a variety of scenarios. But when it comes to customizing how that looks and works, it’s a little tricky. As a result, many folks don’t even bother mucking around with it because of how complex it is what with manually uploading new email templates to the appliance, restarting services, customizing XML files, or writing vRO code and event broker subscriptions and doing all the plumbing work yourself. But thanks to the godsend that is SovLabsCustom Notifications module, all this is now a thing of the past. It not only makes it super simple to create your own custom notifications, but it’s actually kind of fun to see how quickly and easily you can give your CMP that extra edge with rich emails that can be your own HTML, include whatever custom properties you want, and go to basically anyone you want. In this article, I want to bring this module to attention and show you exactly how you can use it to extend your vRealize Automation platform to send custom email notifications to recipients of your choosing.

 

     In order to get email out of vRA for basic things like knowing if your provisioning request was successful, you need to setup a few things. First, there’s the outbound email server (Administration -> Notifications -> Email Server) so that you can connect the appliance to the mail relay. Next, there’s ensuring you have the scenarios you wish activated (Administration -> Notifications -> Scenarios) of which there are a whole host. And there’s also ensuring the email address is present in your Active Directory user profile.

 

Once you have all this, you should begin receiving some mail. But when you do, it comes to you only, and it’s just kind of bland.

 

 

You can see all of the basic information, but you don’t have any extra metadata that’s in the request (I have a couple in this catalog item) and also what if you need this to go to an operations team instead of yourself? It’s not really possible without some heavy lifting and running around. Changing what you see above in vRA is not a trivial task although there are some templates available that can assist. The latter use case of sending email upon provision and destruction to arbitrary recipients is even trickier with only some community code out there in vRO. This approach requires much more massaging.

 

     Now, let’s see how to accomplish this using the SovLabs Custom Notifications module. What’s nice about this and other SovLabs functionality is that you never have to leave the comforts of your vRA portal, never have to write and manipulate your own JavaScript, and never have to monkey with system files and services.

 

     In this scenario, we will configure notifications to send successful build and destroy emails to an operations team so they can be notified and make the appropriate changes to external systems of record. First, we add a Notifications Configuration through a simple catalog item which was published automatically for you when you added the license.

 

There’s a form we must fill out with all the conveniences you might expect, including which types of events we want to get (VMLIFECYCLE contains the provisioning aspects), but there are others including snapshot notifications and IPAM. We choose the states we want with simple check boxes. Then, we choose standard things like title and body. Oh, and as you can see, the HTML is already pre-built for you making it easy to copy and paste whatever you like!

 

 

Over on the Message Server Configuration tab, we can use an existing mail server definition as well as an existing email group definition. Let’s create a new one to see what’s here.

 

 

Everything you would expect to see, including the ability to set and save email server credentials if you enable authorization. And down on the Email Group configuration portion, here we can very easily add To, CC, and BCC addresses all in one profile! This ability makes it super simple to put whatever email(s) you like into a profile that can then be used on a per-blueprint basis if you like. Submit the configuration, check your requests to ensure it completes, and then go back to the SovLabs vRA Extensibility Modules service in the catalog. This time, select Add Notification Group.

 

Here, we’ll choose the profile we just selected giving it a label and type.

 

 

Once this is submitted and successful, you should now see a nifty new property group that was auto-created for you.

 

 

If you dive into this property group, you’ll see a number of system properties in addition to the main custom property called SovLabs_NotificationGroup and the value of which is the profile you created in the last step.

 

 

The SovLabs Notification module essentially checks to see if this property exists and, when it does, it matches the profile to the value and uses that to know what, where, and to whom to send notifications. You can then use this property anywhere in vRA you see fit, but in this demonstration we’ll consume this property group simply by attaching it to a blueprint.

 

In this blueprint, all I’ve done is found and attached this pre-created property group, then saved the blueprint. It’s really that simple and I’ve done absolutely nothing else.

 

 

Now, I’ll go to the catalog and request this item to see what happens.

 

 

You can see I have a couple of custom fields in the request. More on this in a second.

 

 

After the request succeeds, I check my email and find this.

 

 

And, bam, there it is! What you see is an HTML-formatted email that comes entirely out-of-the-box. It’s important to stress that what you see above is stock and I’ve made absolutely no modifications whatsoever to the body of the message. It’s pretty detailed already, right? And easy to read? Certainly. They’ve done a great job of putting this together, but also in making it easy to extend into whatever you’d like to see.

 

     Now that we have a basic email, how do we customize this easily to add additional things like custom properties that I had on the request form? If you scroll up, you’ll see I had a drop-down called CZAD.Users. I supplied a value for this field at request time. I now want to see that in my email that came across. Maybe this is something like an application owner or backup retention policy or other metadata to go into an asset tracking system. Whatever it may be, it’s simple to drop into these custom notifications. So let’s see that process.

 

     From your Items tab, go over to SovLabs Notification and find this profile you created earlier. We need to edit the body of it. Open the item and click the Update action item.

 

 

The body as well as the other fields become editable.

 

 

You have the choice of either editing it as-is here in the text area, or lifting it into an HTML editor of your choice. I’m going to choose the latter because I’m not a hardcore HTML programmer. I’ll just jump over to a simple online editor for demo purposes and paste in the code.

 

 

This may be a little difficult to see depending on how it gets published, but on the right I have pasted in the raw HTML, and on the left I have it rendered out.

 

I want to add a new row under the “Machine details” heading that shows my CZAD.Users custom property and its value. Now, you may notice I have a number of these words enclosed in double braces like {{ something }}. These are actually custom properties inside vRA that, thanks to the wonders of the SovLabs Template Engine, we can easily pick up and translate. Yes, really, it’s as simple as enclosing whatever custom property we want in double braces and it gets automatically translated, and it can be *any* custom property as well—even system properties!

 

 

Maybe it’s just me, but I find that AWESOME and waaay better than having to write any code to pick it up and interpret it myself.

 

So, getting back, let’s add that line underneath “Network name” so our code and, thus, the HTML gets rendered as shown.

 

 

Again, maybe difficult to see, but I’ve made the code change in the editor on the right (highlighted), and I can see the editions rendered on the left. Let’s copy and paste this entire block back into our notification definition and update it.

 

 

That was successful, now let’s re-request the same item and see what we get.

 

 

I’ve highlighted the field and its value, so we should hopefully see this now.

 

 

 

And, boom, there we go! The new email that came from the system has the custom property added and got the correct value. And, likewise, when we destroy this deployment, we get another email with the same information making it easy for an operations team to get all the info they need.

 

 

     Now, hopefully, you can see how huge this notification module is, how vastly powerful and flexible it can make your vRA infrastructure, and, above all else, how much easier it is to setup and administer versus everything else out there. This is a great way to add value to your CMP and can solve a whole variety of use cases. Now all that’s left is to go forth and see how you can use this in your organization!

Viewing all 3135 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>