📜 ⬆️ ⬇️

Recipes from CHEF: automated deployment of business application environments using HPE OneView

Information technologies are becoming an integral part of the products and services of the new IT style, in which a business expects to receive the requested resources for new applications almost instantly. IT resources, in the paradigm of new requirements from modern applications, should be automatically allocated, used, returned and reused from the common pool of computing, storage, and network nodes.


Such an infrastructure may have different types of hardware platforms, abstracted under a single control system. This approach is called “infrastructure as a code” (infrastructure-as-code). Hewlett Packard Enterprise’s vision is to move to Composable (Compiled) Infrastructure — a flexible resource pool from which, under the control of the HPE OneView manager, using templates and APIs, applications are deployed, maintained and monitored.

To implement the Composable Infrastructure concept and automate the deployment of environments for business applications, HPE combined its work with well-known software configuration management software developer CHEF Software.
')
CHEF (Shaf) is a configuration management system written in Ruby and Erlang using a domain-specific configuration description language. Used to simplify the tasks of setting up and supporting multiple servers and can be integrated into cloud platforms to automate the management of current and automate the process of setting up new servers.

The user CHEF creates certain “recipes” describing how to manage server applications (for example, Apache, MySQL or Hadoop) and their settings.

A “recipe” is a description of the state of the resources of the system in which it must reside at a particular point in time, including installed packages, running services, and files created. CHEF checks that each of the system resources is configured correctly and tries to correct the state of the resource if it does not match the expected one.

“Recipes” are used to manage both Linux nodes and Windows (in recent releases)

The CHEF Deployment Driver for HPE OneView allows IT administrators to use CHEF "recipes" to automate the physical deployment process of both the physical environment, including servers, network connections, storage, and deployment of operating systems and applications. This integration increases business productivity and increases deployment reliability by automating all steps.


Figure 1 - CHEF driver interaction diagram with HPE OneView
To create a fast and efficient IT infrastructure, an organization must transform traditional physical systems into flexible pools of physical and virtual resources.

As such transformations occur, an organization often faces difficulties in automating the deployment of bare metal physical equipment. Deployment is always a complicated process. It requires the installation and preparation of the hardware, connections, OS and application stack on the appropriate equipment for this task. These processes often require manual control and monitoring, which is time consuming and can lead to errors.

This is where the idea of ​​Composable Infrastructure appears. In such an infrastructure, there is a flexible pool of calculators, storage and networks, the resources in it are allocated, increased, reduced, reused dynamically, using a software-defined approach. In the Hewlett Packard Enterprise solution portfolio, all server, storage, and data network products have been specifically designed to be embedded in such a software-defined infrastructure.

For example, each server is equipped with an iLO chip, which allows collecting the status of all hardware components and setting up interaction with the server without installing agents into the OS. Storage and network devices in the Hewlett Packard Enterprise solution portfolio understand the open standard RESTful API. It remained to create a product that would be able to combine all the developments in the hardware of the portfolio and create a full-fledged orchestrator who can manage the entire infrastructure of the data center. OneView, released in October 2013, became such a product.

HPE OneView



Figure 2 - HPE OneView Environment
HPE OneView is a complete cycle management software for modern data centers: uses connectors to manage network, servers and storage systems built on Hewlett Packard Enterprise, Brocade, some Cisco switches, integrates into all known hypervisors and can access them to deploy virtual environments.

It is delivered as an image of a VMware or Hyper-v virtual machine and can be deployed on any hardware with the support of these hypervisors. HPE OneView has a clear and easy-to-learn interface that can be adapted to specific groups of administrators by adding or removing components in the graphical console. In addition, HPE OneView can integrate with the infrastructure of the data center - UPS, PDU (Schneider Electric, Eaton, etc.), racks, allowing you to get a three-dimensional picture of what is happening in the server rooms and manage the movement of applications or virtual machines based on the data.


Fig.3 - Temperature map of the data center in OneView
An administrator can build a device interaction map in the OneView interface:


Figure 4 - Relationship elements of server architecture
HPE OneView replaces the entire 5 previous server infrastructure management products: HP SIM, Insight Control, Onboard Administrator, VCM, HPSUM.

In version 2.0 of HPE, OneView expanded its capabilities - there appeared a functionality for migrating profiles (IP settings, WWN, MAC addresses and other parameters) of a server from one blade to another, as between compartments with identical blade servers (the same types of processors, memory, network adapters), and between the bays with different generations of blade servers with different generations of CPUs, LAN type and FC adapters. Moreover, such a migration is possible now not only within one blade basket, but also between several.


Fig.5 - New features for migrating profiles to OneView 2.0
HPE OneView allows administrators to use patterns and profiles to implement the idea of ​​a software-defined architecture or infrastructure-as-code (infrastructure-as-code) in their enterprise.

The templates supplied with OneView can be easily adapted and modified for different applications and based on the specific equipment in each case.

These templates are recommended for use in the DevOps approach because they reduce the infrastructure deployment time for developers and eliminate the mismatch between IT department representatives, allowing you to start testing applications in a matter of minutes.

Deployment Steps


In order to show the possibility of automated deployment of applications from scratch, using the capabilities of OneView and CHEF, you must perform several steps.

Deploy a physical server using HPE OneView

To do this, go to the HPE OneView console - Server Profiles - Create Profile. And we get something like this:


Fig.6 - Creating a profile in OneView
In this scenario, the profile name is set to “Web Server Template”, the parameters for the blade basket, server blade, and network connections are filled based on the specific hardware models in your data center.

Click "Create" and save the profile. Next you need to install the integration driver CHEF and OneView.

Deploy an OS using a template in oneview
Download the chef-settings-Linux® script from GitHub . We change the following values ​​in the script:

CHEF_PROXYSERVER: the proxy server address YUM_REPOSITORY_INFO: the yum repository information CHEF_CERT: the SSH certificate information to be copied into the authorization files LOGIN_DISABLED: should be set to YES/yes to disable user login and NO/no if LOGIN using username/password should not be disabled 

This script must be embedded in the OS deployment package - OS Build Plan. Learn more about creating an OS Build Plan here and here .

Application stack configuration using Cookbook (cookbook) CHEF
Next, create a cookbook and recipe in CHEF. What is the main tool of the chef? Knife!
The first recipe file will have the same name, find it https://github.com/HewlettPackard/chef-provisioning-oneview#prerequisites and fill in all the parameters of your environment.

The next step is to create the recipe itself, replacing the parameters of the code below with the actual ones for your environment:

 require 'chef/provisioning' with_driver 'oneview' with_chef_server "<a href="https://my-chef.my-domain.com/organizations/my-org">https://my-chef.my-domain.com/organizations/my-org</a>", :client_name => Chef::Config[:node_name], :signing_key_filename => Chef::Config[:client_key] machine 'web01' do recipe 'my_server_cookbook::default' machine_options :driver_options => { :server_template => 'Web Server Template', :os_build => 'CHEF-RHEL-6.5-x64', :host_name => 'chef-web01', :ip_address => 'xx.xx.xx.xx', :domainType => 'workgroup', :domainName => 'sub.domain.com', :mask => '255.255.255.0', :dhcp => false, :gateway => 'xx.xx.xx.1', :dns => 'xx.xx.xx.xx,xx.xx.xx.xx,xx.xx.xx.xx', :connections => { #1 => { ... } (Reserved for PXE on our setup) 2 => { :ip4Address => 'xx.xx.xx.xx', :mask => '255.255.254.0', # Optional :dhcp => false :gateway => 'xx.xx.xx.1' # Optional :dns => 'xx.xx.xx.xx' # Optional } }, :custom_attributes => { :chefCert => 'ssh-rsa AA...' # Optional } }, :transport_options => { :user => 'root', # Optional. Defaults to 'root' :ssh_options => { :password => Chef::Config.knife[:node_root_password] } }, :convergence_options => { :ssl_verify_mode => :verify_none, # Optional :bootstrap_proxy => '<a href="http://proxy.domain.com:8080/">http://proxy.domain.com:8080</a>' # Optional } chef_environment '_default' converge true end 

Unwrap! Now that everything is ready, we proceed to the final part. CHEF will use the created recipe and together with the OneView driver, the web server will be fully deployed from scratch.

In the CHEF console, you need to go to the directory containing the recipe and run the command:

 $ bundle exec chef-client -z __.rb 

Let's take a look at the OneView console and see how our application is deployed:


Fig.7 - Quiet, deployment is underway!
When the deployment is complete - check that all components are installed and configured correctly:


Fig.8 - Check the parameters
Now we are switching to the CHEF console and checking that the node has actually been created using the CHEF recipe:


Figure 9 - CHEF also knows about this node
We also check that the server has been assigned a serial number, Apache is configured on it and Apache Webserver is raised, how long it took and what steps were taken:


Fig.10 - Most of the components are initialized in seconds!
The fact that this server is now visible in the console means that it is properly configured and sends information about itself. It's time to make sure that the application really works, for this we access the Webserver in the browser:


Pic.11 - Webserver is alive and ready to work!
The deployment mechanics in HPE OneView consists of 5 steps:

1. We select compatible server hardware from the pool of available servers managed by HPE OneView using the HPE OneView search REST API.

2. Create a new server profile template using the HPE OneView REST API and assign:

A. Firmware version, BIOS, local storage configuration: HPE OneView uses the built-in HP Intelligent Provisioning (IP) Linux environment for the PXE boot, which is already built into the iLO baseboard management card (BMC) processor, SmartStart.

B. Network Connections: HPE OneView uses a virtual connect network platform to dynamically represent network connections for servers from a pool of network connections.

C. SAN: HPE OneView automates the SAN for HPE 3PAR storage and for Fiber Channel switches, including Brocade, Cisco, and HPE Networking.

3. Deploy the selected OS as soon as the provision of physical resources is over:

A. The server profile is configured to download the installation image over the network.

B. The server turns on and the PXE boot starts.

C. The OneView driver launches the OS installation using the HPE OneView REST API (Insight Control server provisioning).

4. Set network parameters

A. IP addresses, subnets, hostnames, etc. for various network adapters and virtual network adapters, allowing you to create complex network configurations.

5. CHEF pushes the application stack on top of the deployed OS.

A. Download the CHEF client to the server, then the CHEF client is registered on the CHEF server.

B. Launch the CHEF client on the new server, which pulls up the required “cookbook” from the CHEF server and applies the recipe to configure the Web server.

Deployment video:



As you can see, using CHEF recipes, in conjunction with Hewlett Packard Enterprise hardware and software, you can get simple, open and fully automated infrastructure-like code for deploying applications. Do not be afraid to experiment, the only way to become a real IT kitchen chef!

For self-study: Van - Tu - Free - Fo

Thanks for attention!

Source: https://habr.com/ru/post/273605/


All Articles