Skip to content

Commit

Permalink
Version 3.0.0 (#6)
Browse files Browse the repository at this point in the history
UPDATE: Kitchen.yml typo
UPDATE: Libraries::Helper to enhance prerequisites versions
UPDATE: Libraries::Helper to include support to ignore_errors in validate_cmd method when called from method find_current_veeam_version
UPDATE: Libraries::Helper to include version information for explorers and win_clean_path helper
UPDATE: Libraries::Helper to include links for 9.5.4

UPDATE: Recipes::Catalog to include calling veeam_upgrade by default
UPDATE: Recipes::Console to include veaam_upgrade
UPDATE: Recipes::HostMgmt to support 9.5.4
ADD:    Recipes::Prerequisites
UPDATE: Recipes::ProxyServer to support 9.5.4
UPDATE: Recipes::Server to support 9.5.4
UPDATE: Recipes::ServerWithConsole to include upgrades and build version handling
UPDATE: Recipes::StandaloneComplete to support 9.5.4

UPDATE: Resources to use win_clean_path instead of win_friendly_path from Windows Cookbook
UPDATE: Resources::Catalog to handle installation of 9.5.4 media and upgrades of the current version from 9.5.0 to 9.5.4 when version is selected
UPDATE: Resources::Console to support upgrading and installing 9.5.4
UPDATE: Resources::Explorer to support 9.5.4 version upgrades
UPDATE: Resources::Prerequisites to support new version of SQL Express installation based on the build_version
UPDATE: Resources::Server to enable support for upgrading the version to 9.5.4
UPDATE: Resources::Upgrade to initiate an upgrade when the Veeam Backup Catalog version does not match the requested build version

UPDATE: Templates::SqlBuildScript to handle installation of SQL Express 2016 when performing a new installation of 9.5 Update 4
ADD:    Test::Inspec/9.5.4

UPDATE: README
BUMP:	Metadata to Version 3.0.0
  • Loading branch information
goodrum authored Jan 22, 2019
1 parent 2af227e commit a081919
Show file tree
Hide file tree
Showing 50 changed files with 471 additions and 140 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ bin/*

.kitchen/
.kitchen.local.yml
.kitchen.local.*.yml

.delivery/cli.toml
2 changes: 1 addition & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ driver:
provisioner:
name: chef_zero
data_bags_path: "../../data_bags/"
# You many wish to test your CHEF::Log.<level> messages while using test-kitche. Change the below
# You many wish to test your CHEF::Log.<level> messages while using test-kitchen. Change the below
# value to the level of choice. For cleaner output, comment this option out.
log_level: info
# You may wish to disable always updating cookbooks in CI or other testing environments.
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ The attribute `node['veeam']['version']` is used to evaluate the ISO download pa
| **9.5.0.1038** | [VeeamBackup&Replication_9.5.0.1038.Update2.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1038.Update2.iso) | 180b142c1092c89001ba840fc97158cc9d3a37d6c7b25c93a311115b33454977 |
| **9.5.0.1536** | [VeeamBackup&Replication_9.5.0.1536.Update3.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.iso) | 5020ef015e4d9ff7070d43cf477511a2b562d8044975552fd08f82bdcf556a43 |
| **9.5.0.1922** | [VeeamBackup&Replication_9.5.0.1922.Update3a.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.iso) | 9a6fa7d857396c058b2e65f20968de56f96bc293e0e8fd9f1a848c7d71534134 |
| **9.5.4.2615** | [VeeamBackup&Replication_9.5.4.2615.Update4.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso) | 8a594cec74059f9929ea765ac5e70a49da6fc93803b567cbb9d74fbb1a49a6cc |


### Veeam Backup and Replication Update Zip files
Expand All @@ -193,6 +194,7 @@ The attribute `node['veeam']['build']` is used to evaluate the Zip download path
| **Update 2** | [VeeamBackup&Replication_9.5.0.1038.Update2.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1038.Update2.zip) | d800bf5414f1bde95fba5fddbd86146c75a5a2414b967404792cc32841cb4ffb |
| **Update 3** | [VeeamBackup&Replication_9.5.0.1536.Update3.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.zip) | 38ed6a30aa271989477684fdfe7b98895affc19df7e1272ee646bb50a059addc |
| **Update 3a** | [VeeamBackup&Replication_9.5.0.1922.Update3a.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.zip) | f6b3fc0963b09362c535ef49691c51d368266cc91d6833c80c70342161bb7123 |
| **Update 4** | [VeeamBackup&Replication_9.5.4.2615.Update4.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso) | 8a594cec74059f9929ea765ac5e70a49da6fc93803b567cbb9d74fbb1a49a6cc |

### Veeam Backup and Replication License file
The server must be licensed to unlock the full potential of the application. The attribute `node['veeam']['server']['evaluation']` should be configured as `false`. To license, choose one of the below options.
Expand All @@ -209,6 +211,8 @@ The server must be licensed to unlock the full potential of the application. Th
## Veeam Upgrade Procedures and Details
The process to perform upgrades requires that the appropriate installation media is provided which contains the updates from Veeam. This cookbook will initiate an upgrade if the currently installed versions are less than the desired Build version as defined by the attribute `node['veeam']['build']`. When the installed version does not match the requested build version, the process will mount the ISO or extract the ZIP that contains the update and then perform an automatic upgrade of each service installed on the host.

> As of Update 4, the upgrade process has changed. The update to version 9.5.4+ will be automatically applied if the installer media leverages Update4. Due to the nature of the process, a reboot is required. The Automatic Reboot will occur at the end of the convergance unless the attribute `nde['veeam']['reboot_on_upgrade']` equals false
### Configuring the Updates
Updates are identified by passing one of the following to the attributes for the server:
1. `node['veeam']['installer']['update_url']` attribute should contain either the full installation ISO or the update ZIP link. The file name must include the full build name like such:
Expand All @@ -221,6 +225,8 @@ Updates are identified by passing one of the following to the attributes for the
- 9.5.0.711 (GA)
- 9.5.0.1038 (Update2)
- 9.5.0.1536 (Update3)
- 9.5.0.1922 (Update3a)
- 9.5.4.2615 (Update4)

### Upgrade Process and Warnings
*Warning*
Expand All @@ -231,7 +237,13 @@ If the automatic upgrade should be skipped then set the following attribute on t
- `node['veeam']['reboot_on_upgrade']` = false

### Recipes that perform automatic upgrades
> As of Update 4, the upgrade process has changed. The update to version 9.5.4+ will be automatically applied if the installer media leverages Update4. Due to the nature of the process, a reboot is required. The Automatic Reboot will occur at the end of the convergance unless the attribute `nde['veeam']['reboot_on_upgrade']` equals false
Ongoing updates are automatically handled by the following included recipes:
- catalog
- console
- server_with_catalog
- server_with_console
- standalone_complete
- proxy_server
- host_mgmt
Expand Down
68 changes: 55 additions & 13 deletions libraries/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# limitations under the License.

require 'chef/mixin/shell_out'
require 'chef/util/path_helper'

module Veeam
module Helper
Expand Down Expand Up @@ -66,6 +67,10 @@ def package_list(version)
'package_url' => 'https://download2.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.iso',
'package_checksum' => '9a6fa7d857396c058b2e65f20968de56f96bc293e0e8fd9f1a848c7d71534134'
}
when '9.5.4.2615' then {
'package_url' => 'https://download2.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso',
'package_checksum' => 'ecc27bbcf49104861566782701dca42375b324b4710e2fa79b5f8068c31c4494'
}
end
end

Expand Down Expand Up @@ -107,6 +112,10 @@ def update_list(version)
'update_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.zip',
'update_checksum' => 'f6b3fc0963b09362c535ef49691c51d368266cc91d6833c80c70342161bb7123'
}
when '9.5.4.2615' then {
'package_url' => 'https://download2.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso',
'package_checksum' => 'ecc27bbcf49104861566782701dca42375b324b4710e2fa79b5f8068c31c4494'
}
end
end

Expand All @@ -117,11 +126,26 @@ def prerequisites_list(version)
'1' => { 'Microsoft SQL Server 2012 Management Objects (x64)' => 'SharedManagementObjects.msi' },
'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SQLEXPR_x64_ENU.exe' }
}
when /9.0.0.\d+/ then {
'0' => { 'Microsoft System CLR Types for SQL Server 2012 (x64)' => 'SQLSysClrTypes.msi' },
'1' => { 'Microsoft SQL Server 2012 Management Objects (x64)' => 'SharedManagementObjects.msi' },
'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SQLEXPR_x64_ENU.exe' }
}
when '9.5' then {
'0' => { 'Microsoft System CLR Types for SQL Server 2014' => 'SQLSysClrTypes.msi' },
'1' => { 'Microsoft SQL Server 2014 Management Objects (x64)' => 'SharedManagementObjects.msi' },
'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SQLEXPR_x64_ENU.exe' }
}
when /9.5.0.\d+/ then {
'0' => { 'Microsoft System CLR Types for SQL Server 2014' => 'SQLSysClrTypes.msi' },
'1' => { 'Microsoft SQL Server 2014 Management Objects (x64)' => 'SharedManagementObjects.msi' },
'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SQLEXPR_x64_ENU.exe' }
}
when /9.5.4.\d+/ then {
'0' => { 'Microsoft System CLR Types for SQL Server 2014' => 'SQLSysClrTypes.msi' },
'1' => { 'Microsoft SQL Server 2014 Management Objects (x64)' => 'SharedManagementObjects.msi' },
'SQL' => { 'Microsoft SQL Server 2016 (64-bit)' => 'SQLEXPR_x64_ENU.exe' }
}
end
end

Expand All @@ -135,11 +159,25 @@ def explorers_list(version)
'Oracle' => 'Veeam Explorer for Oracle'
}
when '9.5' then {
'ActiveDirectory' => 'Veeam Explorer for Microsoft Active Directory',
'SQL' => 'Veeam Explorer for Microsoft SQL Server',
'Exchange' => 'Veeam Explorer for Microsoft Exchange',
'SharePoint' => 'Veeam Explorer for Microsoft SharePoint',
'Oracle' => 'Veeam Explorer for Oracle'
'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory', version: '9.5.0.836' },
'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server', version: '9.5.0.836' },
'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange', version: '9.5.0.836' },
'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint', version: '9.5.0.836' },
'Oracle' => { name: 'Veeam Explorer for Oracle', version: '9.5.0.836' }
}
when /9.5.4.\d+/ then {
'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory', version: '9.6.4.1053' },
'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server', version: '9.6.4.1053' },
'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange', version: '9.6.4.1053' },
'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint', version: '9.6.4.1053' },
'Oracle' => { name: 'Veeam Explorer for Oracle', version: '9.6.4.1053' }
}
when /9.5.0.\d+/ then {
'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory', version: '9.5.0.836' },
'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server', version: '9.5.0.836' },
'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange', version: '9.5.0.836' },
'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint', version: '9.5.0.836' },
'Oracle' => { name: 'Veeam Explorer for Oracle', version: '9.5.0.836' }
}
end
end
Expand All @@ -155,12 +193,12 @@ def find_current_dotnet
installed_version.nil? ? 0 : installed_version
end

def validate_powershell_out(script, timeout: nil)
def validate_powershell_out(script, timeout: nil, ignore_errors: false)
# This seemed like the DRYest way to handle the output handling from PowerShell.
cmd = powershell_out(script) if timeout.nil?
cmd = powershell_out(script, timeout: timeout) unless timeout.nil?
# Only return the output if there were no errors.
return cmd.stdout.chomp if cmd.stderr == '' || cmd.stderr.nil?
return cmd.stdout.chomp if cmd.stderr == '' || cmd.stderr.nil? || ignore_errors
raise cmd.inspect if cmd.stderr != ''
end

Expand Down Expand Up @@ -192,7 +230,7 @@ def find_current_veeam_version(package_name)
when /Console/
"#{veeam_package}\\Console\\veeam.backup.shell.exe"
when /Server/
"#{veeam_package}\\Packages\\VeeamDeploymentDll.dll"
"#{veeam_package}\\Backup\\Packages\\VeeamDeploymentDll.dll"
when /Catalog/
"#{veeam_package}\\Backup Catalog\\VeeamDeploymentDll.dll"
else
Expand All @@ -202,7 +240,7 @@ def find_current_veeam_version(package_name)
$File = Get-Item -Path '#{veeam_exe}'
$File.VersionInfo.ProductVersion
EOH
output = validate_powershell_out(cmd_str)
output = validate_powershell_out(cmd_str, ignore_errors: true)
output = nil if output == ''
output
end
Expand All @@ -227,10 +265,10 @@ def iso_installer(downloaded_file_name, new_resource)
end

def extract_installer(downloaded_file_name, new_resource)
package_name = downloaded_file_name.split('\\').last
package_name = downloaded_file_name.split('/').last
package_type = ::File.extname(package_name)
install_media_path = win_friendly_path(::File.join(::Chef::Config[:file_cache_path], "Veeam/#{package_name.gsub(package_type, '')}"))
update_path = win_friendly_path(::File.join(install_media_path, '/Updates'))
install_media_path = win_clean_path(::File.join(::Chef::Config[:file_cache_path], "Veeam/#{package_name.gsub(package_type, '')}"))
update_path = win_clean_path(::File.join(install_media_path, '/Updates'))

remote_file downloaded_file_name do
source new_resource.package_url
Expand All @@ -240,7 +278,7 @@ def extract_installer(downloaded_file_name, new_resource)
not_if { ::File.exist?(update_path) }
end

windows_zipfile win_friendly_path(::File.join(install_media_path, '/Updates')) do
windows_zipfile win_clean_path(::File.join(install_media_path, '/Updates')) do
source downloaded_file_name
action :unzip
not_if { ::File.exist?(update_path) }
Expand Down Expand Up @@ -275,5 +313,9 @@ def get_media_installer_location(downloaded_file_name)
Chef::Log.debug "Found the Veeam installation media at Drive Letter [#{output}]"
output
end

def win_clean_path(path)
Chef::Util::PathHelper.cleanpath(path)
end
end
end
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache-2.0'
description 'Installs/Configures Veeam Backup and Recovery'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.1.1'
version '3.0.0'
chef_version '>= 12.5' if respond_to?(:chef_version)

supports 'windows'
Expand Down
12 changes: 10 additions & 2 deletions recipes/catalog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
veeam_prerequisites 'Install Veeam Prerequisites' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
install_sql false
action :install
end

veeam_catalog 'Install Veeam Backup Catalog' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
install_dir node['veeam']['catalog']['install_dir']
vm_catalogpath node['veeam']['catalog']['vm_catalogpath']
vbrc_service_user node['veeam']['catalog']['vbrc_service_user']
Expand All @@ -32,3 +32,11 @@
keep_media node['veeam']['catalog']['keep_media']
action :install
end

veeam_upgrade node['veeam']['build'] do
package_url node['veeam']['installer']['update_url']
package_checksum node['veeam']['installer']['update_checksum']
keep_media node['veeam']['upgrade']['keep_media']
auto_reboot node['veeam']['reboot_on_upgrade']
action :install
end
10 changes: 9 additions & 1 deletion recipes/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@
veeam_console 'Install Veeam Backup console' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
accept_eula node['veeam']['console']['accept_eula']
install_dir node['veeam']['console']['install_dir']
keep_media node['veeam']['console']['keep_media']
action :install
end

veeam_upgrade node['veeam']['build'] do
package_url node['veeam']['installer']['update_url']
package_checksum node['veeam']['installer']['update_checksum']
keep_media node['veeam']['upgrade']['keep_media']
auto_reboot node['veeam']['reboot_on_upgrade']
action :install
end
4 changes: 2 additions & 2 deletions recipes/host_mgmt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
veeam_prerequisites 'Install Veeam Prerequisites' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
install_sql false
action :install
end

veeam_console 'Install Veeam Backup console' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
accept_eula node['veeam']['console']['accept_eula']
install_dir node['veeam']['console']['install_dir']
keep_media true
Expand Down
21 changes: 21 additions & 0 deletions recipes/prerequisites.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Cookbook Name:: veeam
# Recipe:: prerequisites
#
# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved.

error_message = 'This recipe requires a Windows 2012 or higher host!'

# If this host is not Windows, then abort
raise ArgumentError, error_message unless node['platform'] == 'windows'

# If this host is older than Windows 2012, we should abort the process for an unsupported platform
raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012

veeam_prerequisites 'Install Veeam Prerequisites' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['build']
install_sql true
action :install
end
4 changes: 2 additions & 2 deletions recipes/proxy_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
veeam_prerequisites 'Install Veeam Prerequisites' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
install_sql false
action :install
end

veeam_console 'Install Veeam Backup console' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
accept_eula node['veeam']['console']['accept_eula']
install_dir node['veeam']['console']['install_dir']
keep_media true
Expand Down
12 changes: 10 additions & 2 deletions recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
veeam_prerequisites 'Install Veeam Prerequisites' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
install_sql true
action :install
end

veeam_server 'Install Veeam Backup Server' do
package_url node['veeam']['installer']['package_url']
package_checksum node['veeam']['installer']['package_checksum']
version node['veeam']['version']
version node['veeam']['build']
accept_eula node['veeam']['server']['accept_eula']
evaluation node['veeam']['server']['evaluation']
install_dir node['veeam']['server']['install_dir']
Expand All @@ -33,3 +33,11 @@
keep_media node['veeam']['server']['keep_media']
action :install
end

veeam_upgrade node['veeam']['build'] do
package_url node['veeam']['installer']['update_url']
package_checksum node['veeam']['installer']['update_checksum']
keep_media node['veeam']['upgrade']['keep_media']
auto_reboot node['veeam']['reboot_on_upgrade']
action :install
end
Loading

0 comments on commit a081919

Please sign in to comment.