Skip to content

Commit

Permalink
more wip completed
Browse files Browse the repository at this point in the history
  • Loading branch information
lizoron committed Mar 14, 2024
1 parent e9578c2 commit 887d761
Show file tree
Hide file tree
Showing 8 changed files with 442 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,38 @@ sidebar_position: 1

# Create VM using the OVF Template (vSphere)

WIP
Use the following steps to use vSphere to deploy the OVF template and create a VM.

**To create a VM by deploying the OVF template:**

1. Make sure you have the Linux Execution Server installation files in a temporary location. For details, see [Downloading the Linux Virtual Appliance Image](https://help.quali.com/Online%20Help/0.0/Portal/Content/Linux/Dwnld-Lnx-VM-Img.htm).

2. In your local machine, login to vSphere with administrator credentials.
3. Click **File > Deploy OVF Template**. The **Deploy OVF Template** dialog box is displayed.

![](/Images/Linux2/vSphereSource_418x400.png)

4. Click **Browse** and navigate to the directory where the installation files are located.
5. In the **Deploy from a file or URL** field, select the required OVF file

6. Click **Next**. View the summary of the OVF template. If the details are correct, click **Next**.

The End User License Agreement page is displayed with the details of license agreements that are associated with the software that is installed in the OVF template.

7. You must accept the license agreements to deploy the OVF template. If no license agreements are associated with the installed software, this screen will not appear. Click **Next**.

![](/Images/Linux2/vSphereNameAndLocation_418x400.png)

8. Enter the name for the deployed OVF template.

The length of the name can be up to 80 characters long and should be unique within the VM folder. Names are case sensitive.

9. Select the folder location within the inventory for the virtual appliance. Click **Next**.

![](/Images/Linux2/vSphereDiskFormat_418x400.png)

10. Specify **Thin Provision**. Click **Next**.
11. When the deployment has completed, click **Power On**.
12. Right-click the VM and select **Open Console**.
13. In the VM console window, check the **Settings Screen** to be sure that it uploaded without root errors.
14. Next, [Log into the VM](https://help.quali.com/Online%20Help/0.0/Portal/Content/Linux/Login.htm).
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,54 @@ sidebar_position: 2

# Create VM using the qcow2 Image File (KVM)

WIP
Use the following steps to create a VM on your Centos 7 machine (CentOS 7.2 and up).
:::note
Your CPU must have hardware virtualization support (Intel VT-x or AMD-V) to be able to use KVM.
:::
**To create a VM by deploying the OVF template:**

1. Make sure you have the Linux Execution Server installation files in a temporary location. For details, see [Downloading the Linux Virtual Appliance Image](https://help.quali.com/Online%20Help/0.0/Portal/Content/Linux/Dwnld-Lnx-VM-Img.htm).
2. Login to your machine as root user.
3. Navigate to the directory where the installation files were downloaded. Create a backup copy of the qcow2 image file.

4. Move the qcow2 image file to the directory where you want to place the VM.
5. In the Linux desktop, open Virt-manager ![](/Images/Linux2/Creating-a-VM-using-the-qcow2_74x57.png) and click **Create a new virtual machine** ![](/Images/Linux2/Creating-a-VM-using-the-qcow2_1.png).

![](/Images/Linux2/Creating-a-VM-using-the-qcow2_2.png)


6. In the **New VM** window, in the **Name** field, enter a name for the VM.
7. Select **Import existing disk image** and click **Forward**.

![](/Images/Linux2/Creating-a-VM-using-the-qcow2_3.png)


8. Click **Browse** and navigate to the path of the `qcow2` image file. Select the image file and click **Open**. Click **Forward**.

![](/Images/Linux2/Creating-a-VM-using-the-qcow2_4.png)


9. For memory and CPU settings, specify values that match your system. For the purposes of this procedure, the values 4 GB RAM (4096 MB) and 4 CPUs are used. Click **Forward**.

![](/Images/Linux2/Creating-a-VM-using-the-qcow2_5_334x328.png)


10. Select **Customize configuration before install**. Click **Finish**.

The details of the VM to be created are displayed.

![](/Images/Linux2/Creating-a-VM-using-the-qcow2_6_389x327.png)


11. From the left pane, select **IDE Disk 1**. Click **Advanced** options.

![](/Images/Linux2/Creating-a-VM-using-the-qcow2_7_223x136.png)


12. Ensure that IDE is selected in the **Disk bus** field.
13. In the **Storage format** field, select qcow2. Click **Apply**.
14. Click ![](/Images/Linux2/Creating-a-VM-using-the-qcow2_8_76x14.png).

The VM is created.

15. Next, [Log into the VM](https://help.quali.com/Online%20Help/0.0/Portal/Content/Linux/Login.htm).
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,135 @@ sidebar_position: 3

# Create the Linux Execution Server from a Script

WIP
## Online installation process (CentOS)

**Prerequisites:**

- Quali Server
- Execution server script that matches your Quali Server version
- Existing Linux CentOS 7.x VM

**To create the Linux execution server in an online environment:**

1. Make sure you have the Linux execution server installation script in a temporary location. For details, see [Downloading the Linux Virtual Appliance Image](https://help.quali.com/Online%20Help/0.0/Portal/Content/Linux/Dwnld-Lnx-VM-Img.htm).

2. Create a Linux VM with a CentOS version that matches the script's version.

3. Using a file transfer client like WinSCP, upload the script to the VM's root folder.

4. If the VM is in offline mode, extract the **Offline Package Repository** zip file to the local PyPi Server repository. For details, see [Add the out-of-the-box dependencies package to the local PyPi Server repository](https://help.quali.com/Online%20Help/0.0/Portal/Content/Admn/Cnfgr-Pyth-Env-Wrk-Offln.htm#Add2).

5. Run the following command to allow the script to be executable.

```javascript
chmod +x cloudshell_es_install_script.sh
```

6. Execute the script with the right parameters.

```python
./cloudshell_es_install_script.sh <CloudShell IP> <CloudShell User> <CloudShell Password> <ES Server Name>
```

7. Next, [Log into the VM](https://help.quali.com/Online%20Help/0.0/Portal/Content/Linux/Login.htm).


## Offline installation (CentOS, RedHat, Ubuntu)

The offline installation script supports CentOS, RedHat and Ubuntu.

**Prerequisites:**

- Download server: Machine with an internet connection for downloading the execution server's script package and dependencies
- Execution server: Offline machine with access to Quali Server and one of the following operating systems:
- RHEL/CentOS 8.x
- Ubuntu 22.04
- Python installed on the VM or in the base image
- Create the following folder structure on the execution server machine:
- `/tmp/ExecutionServerInstall`
- `/os_pkgs`
- `/python_pkgs`
**To create the Linux execution server:**
1. In [CloudShell Download Center](https://support.quali.com/hc/en-us/articles/231613247-Quali-s-Download-Center), find the appropriate **CloudShell Execution Server Offline Installation Package** and copy its URL.
:::note
Execution server and Quali Server must have the same version.
:::
2. Download the package to the download server.
```javascript
wget <CloudShell Execution Server Offline Installation Package URL> -O ExecutionServer.tar
```
And copy the package to the execution server's `/tmp/ExecutionServerInstall` folder.

3. Make sure the execution server has either Python 2.7.18 and Python 3.9.9 installed. If it is missing, run the appropriate commands to download the appropriate package:

- Python 2:

```javascript
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
```


- Python 3:

```javascript
wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
```


And copy the `.tgz` Python files to the execution server's `/tmp/ExecutionServerInstall` folder.
4. Download the appropriate packages:
- For RedHat/CentOS:
```javascript
yumdownloader --resolve yum-utils make mono-complete-5.16.0.220 gcc python2-devel python3-devel openssl-devel zlib zlib-devel libffi-devel python2-pip python3-pip
```
- For Ubuntu:
```javascript
apt install --download-only build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev zlib* python-pip mono-complete=6.12.* -y
```
Note that the Ubuntu packages will be located at `/var/cache/apt/archives`.
And copy the packages to the execution server's `/tmp/ExecutionServerInstall/os_pkgs` folder.

5. Download the appropriate Python packages to the download server.

- Python 2:

```javascript
pip2 download pip==19.2.3
pip2 download virtualenv==20.13.0
pip2 download wheel==0.37.1
```

- Python 3:

```javascript
pip3 download pip==21.2.4
pip3 download virtualenv==20.13.0
pip3 download wheel==0.37.1
```


And copy the package to the execution server's `/tmp/ExecutionServerInstall/python_pkgs` folder.
6. On the execution server, navigate to the `/tmp/ExecutionServerInstall` folder and run:
```javascript
./cloudshell_es_installation -s <Cloudshell Server> -u <Username> -p <Password> -n <ES Name> -o <rhel or ubuntu>
```
:::note
Omit `-n <ES Name>` to use the machine's hostname as the execution server's display name in CloudShell Portal.
:::
7. When the installation completes, you can optionally cleanup the `/tmp/ExecutionServerInstall` folder or the download server altogether.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,54 @@ sidebar_position: 3

# Configure the Linux Execution Server for Ansible

WIP
To run Ansible configuration management on this Execution Server, several additional configurations are needed.

**Prerequisites:**

- Execution Server has the `/ansible` flag enabled. For details, see [Example: How to Run the Configuration File](https://help.quali.com/Online%20Help/0.0/Portal/Content/Linux/Exmpl-Run-Cnfg.htm)

**To configure the Execution Server to run Ansible:**

1. Install Ansible as globally available command line utility.

```javascript
python3 -m pip install ansible
```
:::note
**To install in an offline environment:**

1. Download the offline dependencies from [here](https://help.quali.com/help%20versions/attachments/PY39-linux-ansible-reqs-2.14.0.zip).
2. Place them in the Quali Server offline repository:

`C:\Program Files (x86)\QualiSystems\CloudShell\Server\Config\Pypi Server Repository`

3. Run the following command:

```javascript
python3 -m pip install ansible --index-url=http://<QUALI_SERVER_IP>:8036/simple --trusted-host <QUALI_SERVER_IP>
```

Replace \<QUALI\_SERVER\_IP\> with the IP of the machine containing the offline packages.

**index-url** tells pip to download from local repo rather than public pypi, and **trusted-host** says you can trust this local server
:::

2. Verify install by running:

```javascript
ansible --version
```

![](/Images/Linux2/ansible-status.png)

3. Install **pywinrm** into same python environment as global Ansible. This library is required by Ansible to connect to Windows Apps.

```javascript
python3 -m pip install pywinrm
```

4. Install the **CentOS sshpass** module to allow password authentication to Apps.

```javascript
yum install sshpass
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,42 @@ sidebar_position: 1

# Example: How to Run the Configuration File

WIP
In the `/root/ExecutionServer` folder (or `opt/ExecutionServer` for Linux machines on Azure or AWS), run the appropriate command:

- **To use this Execution Server for general operations:**

```javascript
mono QsExecutionServerConsoleConfig.exe /s:ServerAddress /u:User /p:Pass /esn:ESName
```

For example:

```javascript
mono QsExecutionServerConsoleConfig.exe /s:192.168.30.56 /u:admin /p:admin /esn:ESName
```


- **To use this Execution Server for Ansible configuration management operations, you need to set the /ansible flag, which tells CloudShell to use this Execution Server to run Ansible playbooks.**

```javascript
mono QsExecutionServerConsoleConfig.exe /s:ServerAddress /u:admin /p:admin /esn:ExecutionServerName /ansible
```

And perform the steps in the [Configure the Linux Execution Server for Ansible](https://help.quali.com/Online%20Help/0.0/Portal/Content/Linux/Cnfg-Exec-Srv-for-ansible.htm) article that follows.

- **If you have several Execution Servers that support Ansible but want to use a specific Execution Server for certain operations, use the Execution Server Selector attribute to associate the Execution Server to the appropriate cloud providers, or associate it to the Ansible shell to designate it globally for Ansible operations.**

1. First, set the **Execution Server Selector** attribute with a value on the Execution Server.

For example:

```javascript
mono QsExecutionServerConsoleConfig.exe /s:192.168.35.41 /u:admin /p:admin /esn:ExecutionServerName /ansible /a:"{'Execution Server Selector':'London'}"
```

You might need to attach the **Execution Server Selector** rule to the Execution Server Selector attribute. As explained in [Associating Resources to Specific Execution Servers](https://help.quali.com/Online%20Help/0.0/Portal/Content/CSP/INVN/Assct-Rsrc-to-ES.htm#Creating).

2. Then, set the same **Execution Server Selector** value specified in the **Execution Server Selector** attribute in the cloud provider resource and/or on **Resource Manager Client > Configuration Services > Ansible Configuration** service model. By default, CloudShell will use the Execution Server defined in the cloud provider resource. If it is not available, CloudShell will use the Execution Server defined in the **Ansible Configuration** model. Execution Servers specified on the deployed App shell/resource are not used for configuration management.
:::note
To run Ansible on App-deployed Windows VMs, WinRM must be enabled on those VMs. For additional information, see [Configure Execution Server for Ansible](https://help.quali.com/Online%20Help/0.0/Portal/Content/DevGuide/Config-Mng/Cnfg-Ansible-ES-Sprt.htm).
:::
Loading

0 comments on commit 887d761

Please sign in to comment.