Deployment Scripts
This section describes the onprem_rollout.py
script for Cybereason On-Prem environments using Python, and the onprem-rollout.ps1
script for Cybereason On-Prem environments using PowerShell.
In this topic:
onprem_rollout.py
onprem_rollout.py
is a Python script that installs the Cybereason servers, configures the Detection server(s) and the WebApp server, and imports the Server_Configuration.csv
file. You can download the onprem_rollout.py script from here.
Prerequisites: Python package pyvmomi version 8.0 and above is required.
Arguments
The script supports the following arguments:
Argument |
Description |
Possible Values/Format |
Required/Optional |
Example |
---|---|---|---|---|
-action |
The type of deployment that the script performs. |
|
Required |
-action deploy |
-vc |
The IP or FQDN of your vCenter server. |
Provide the full IP or FQDN. |
Required |
-vc yourvcenter.domain.com |
-user |
The username used to connect to your vCenter server. |
Required |
-user username@domain.com |
|
-file |
The name of the folder path where your Server_Configuration.csv file is located. |
Exact folder path. |
Required |
-file /folder1/folder2/exampleFolder |
-dc |
The name of the VMware datacenter that includes the VMs. To retrieve the data center name, see Retrieve required information. |
Exact data center name. |
Required |
-dc datacenter1 |
-cluster |
The name of the VMware cluster that includes the VMs. To retrieve the cluster name, see Retrieve required information. |
Exact cluster name. |
Required |
-cluster cluster1 |
-folder |
The name of the VMware folder that includes the VMs. To retrieve the folder name, see Retrieve required information. |
Exact folder name. |
Required |
-folder folder1 |
-h/-help |
Displays the script help information and exits. |
N/A |
Optional |
N/A |
-maxrunning |
The number of allowed concurrent tasks in the vCenter server. |
The default and recommended value is 8. |
Optional |
-maxrunning 8 |
-resourcepool |
The name of the VMware resource pool that includes the VMs. To retrieve the resource pool name, see Retrieve required information. |
Exact resource pool name. |
Optional |
N/A |
-templatefolder |
Defines the VM folder that stores the VM templates. |
Exact folder name. |
Optional |
-template folder folder1 |
-logfile |
The path under which you want to save the logs. |
Full folder path. Default value: rollout_log.log |
Optional |
|
-verbose |
Runs the script in debug mode, which provides detailed log information. |
N/A |
Optional |
N/A |
-nopreflight |
When you provide this argument and the -action argument with the deploy option, the script performs deployment only, without preflight checks. |
N/A |
Optional |
N/A |
-q |
Runs the script in quiet mode - does not print logs to stdout. |
N/A |
Optional |
N/A |
-s |
When this flag is used, the script asks the user for their vCenter username and password while the script is running. |
N/A |
Optional |
N/A |
Python script actions
The onprem_rollout.py
script’s -action
argument performs the following actions:
Action |
Description |
---|---|
deploy |
|
preflight |
.. note:: Because the deploy option includes preflight checks, use this option only if you need to perform preflight checks as a separate procedure. |
delete |
Shuts down and deletes all servers defined in the Server_Configuration.csv file. |
convert |
For each template listed in the Server_Configuration.csv file, checks vCenter for an object with the same name. If the object is not a template, the script converts the object from a VM to a template. |
onprem-rollout.ps1
The onprem-rollout.ps1
is a PowerCLI script that installs the Cybereason servers and configures the Detection server(s) and the WebApp server.
PowerCLI script actions
The script performs the following actions:
Imports the
Server_Configuration.csv
file.Runs automatic post-deployment checks, including resource validation and network connectivity.
Searches if the IP addresses in the Server_Configuration.csv file exist in vCenter.
Note
If you are running the script for the second time, use the # operator to instruct the script to skip this function.
Runs the following functions:
Function
Description
convert_to_template
Converts the VMs to templates (runs only once).
stop_vm
Stops the existing Cybereason servers, if running an upgrade from a Cybereason version earlier than 19.1.
deploy
Deploys the Cybereason servers based on the CSV mapping file and apply IP and host name settings according to the Server_Configuration.csv file.
customize
Configures the servers’ hardware setting (CPU, memory), and applies additional hard disk space and advanced configuration if necessary (memory reservation).
start_vms
Starts the servers after deployment is complete.
delete_vms
(Optional) Removes the servers, which are running manually.
wait_create
Waits for the script to finish setting up the servers.
take_snapshot
(Optional) Creates snapshot a of all the servers.
The following code snippet displays the script’s sequence. The script runs automatically and deploys the environment. It is not recommended to edit the script, unless you are running the script for the second time and you want to skip the convert_to_template function (as explained above). For other scenarios, contact your Cybereason technical representative.
if($upgrade -eq $true){
stop_vms
}
convert_to_template
deploy
wait_create
start-Sleep -s 90
customize
start-Sleep -s 90
start_vms
Script parameters
Note
All of the fields in the onprem-rollout.ps1
script are required.
Parameter |
Description |
---|---|
dcname |
The data center name (dcname) indicated in VMWare for this ESXi server, according to the naming used by the customer during setup. |
clustername |
The cluster name indicated in VMWare for this ESXi server, according to the naming used by the customer during setup. |
foldername |
The folder name indicated in VMWare for this ESXi server, according to the naming used by the customer during setup. |
resourcepool |
If the VMware cluster hosts are configured with a resource pools, this parameter is required. |