Skip to content

Commit

Permalink
more WIP updated to complete
Browse files Browse the repository at this point in the history
  • Loading branch information
lizoron committed Feb 23, 2024
1 parent 26b651e commit 9395356
Show file tree
Hide file tree
Showing 8 changed files with 605 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,228 @@ sidebar_position: 2

# How to Upgrade MongoDB From 4.2 to 6.0

WIP
Following security risks in MongoDB 4.2, it was about time to update the version used by Cloudshell.

## Disclaimer

The below instructions are for Cloudshell default installation with a standalone MongoDB installation only.

:::note
MongoDB does not support Windows Server 2012. For details, see [Windows OS requirements](https://help.quali.com/Online%20Help/0.0/Portal/Content/IG/Overview/srvrs.htm#Software).
:::

## Prerequisites

- RDP connection to Cloudshell server
- Cloudshell services down time
- Internet access to download all relevant files (can be done in a dedicated server and copied to Cloudshell server)

## Getting the files

1. Obtain the following MongoDB official files and place them in a temporary folder (referred to as “Downloads” in this guide) on the Cloudshell server:
- [mongodb-windows-x86_64-4.4.22.zip](https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-4.4.22.zip)
- [mongodb-windows-x86_64-5.0.18.zip](https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-5.0.18.zip)
- [mongodb-windows-x86_64-6.0.6.zip](https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-6.0.6.zip)
- MongoDB shell: [mongosh-1.9.0-win32-x64.zip](https://downloads.mongodb.com/compass/mongosh-1.9.0-win32-x64.zip)

2. Enter the Cloudshell server and extract all files.

## Upgrade from 4.2 to 4.4

1. Start the MongoDB shell.
- Navigate to `Downloads\mongosh-1.9.0-win32-x64\bin`
- Double click the `mongosh.exe` executable.
- Follow the instructions to connect to “localhost” (press enter).

2. Validate dependencies by running in the shell:
```js
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
// Expected response: { version: '4.2' }, ok: 1
```

3. Get reservation count for reference after upgrade:
- Switch to the Quali database:
```js
use Quali
db.Reservation.countDocuments()
```

4. Open **Task Manager > Services**.
5. Stop the **Quali Server** process.
6. Shut down MongoDB by running:
```js
use admin
db.shutdownServer()
// Expected response: MongoNetworkError: connection 3 to 127.0.0.1:27017 closed
// Then close the shell window
```

7. Navigate to the downloaded 4.4 bin folder in File Explorer:
```plaintext
Downloads\mongodb-win32-x86_64-windows-4.4.22\bin
```

8. In a separate File Explorer window, open the MongoDB installation's bin folder:
```plaintext
C:\Program Files\MongoDB\Server\4.2\bin
```
9. Delete the mongod.exe file from C:\Program Files\MongoDB\Server\4.2\bin.
10. Copy the new mongod.exe file from the 4.4\bin folder to C:\Program Files\MongoDB\Server\4.2\bin.
11. Open **Task Manager > Services**.
12. Start the **MongoDB** service.
13. Start the **MongoDB** shell and validate the version:
```js
db.version()
```
14. (Optional) Start the **Quali Server** process and check sandboxes.
15. Stop **Quali Server** (if running).
16. Update MongoDB capabilities:
```js
db.adminCommand({ setFeatureCompatibilityVersion: "4.4" })
```
## Upgrade from 4.4 to 5.0
1. Start the MongoDB shell.
- Navigate to `Downloads\mongosh-1.9.0-win32-x64\bin`
- Double click the `mongosh.exe` executable.
- Follow the instructions to connect to “localhost” (press enter).
2. Validate dependencies by running in the shell:
```js
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
// Expected response: { version: '4.4' }, ok: 1
```
3. Open **Task Manager > Services**.
4. Stop the **Quali Server** process.
5. Shut down MongoDB by running:
```js
use admin
db.shutdownServer()
// response should look like: MongoNetworkError: connection 5 to 127.0.0.1:27017 closed
// close the shell window
```
6. Enter the downloaded 5.0 bin folder in File Explorer:
```js
Downloads\mongodb-win32-x86_64-windows-5.0.18\bin
```
7. In a different File Explorer, open the bin folder of MongoDB installation:
```js
C:\Program Files\MongoDB\Server\4.2\bin
```
8. Delete the mongod.exe file in C:\\Program Files\\MongoDB\\Server\\4.2\\bin.
9. Copy the new mongod.exe file from the 5.0.18\\bin folder to C:\\Program Files\\MongoDB\\Server\\4.2\\bin.
10. Open **Task Manager > Services**.
11. Start the **MongoDB** service.
12. Start the **MongoDB** shell.
- Validate version:
```js
db.version()
```
- Validate reservations are still there:
```js
use Quali
db.Reservation.countDocuments()
```
13. (Optional) Start the **Quali Server** process and enter the **Sandboxes** dashboard in CloudShell Portal.
14. Stop **Quali Server** (if running).
15. Update MongoDB capabilities:
```js
db.adminCommand({ setFeatureCompatibilityVersion: "5.0" })
```
## Upgrade from 5.0 to 6.0
1. Start the MongoDB shell.
- Navigate to `Downloads\mongosh-1.9.0-win32-x64\bin`
- Double click the `mongosh.exe` executable.
- Follow the instructions to connect to “localhost” (press enter).
2. Validate dependencies by running in the shell:
```js
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
// Expected response: { version: '5.0' }, ok: 1
```
3. Open **Task Manager > Services**.
4. Stop the **Quali Server** process (if running).
:::warning
From this step, there are differences from previous upgrade flows.
:::
5. Shut down **mongoDB** by running:
- Run
```js
db.adminCommand( { shutdown: 1 } )
// response should look like: MongoNetworkError: connection 5 to 127.0.0.1:27017 closed
// close the shell window
```
6. Ensure that the 5.0-series binaries are in your System PATH. To confirm your binary version, run the following command:
- Open command line window.
- Run
```js
mongod --version
```
- If 'mongod' is not recognized, add the bin folder to the system path:
- Open **Environment Variables**.
- Under **System Variables**, locate and select the **Path**.
- Click **Edit**.
- Click **New**.
- Enter `C:\Program Files\MongoDB\Server\4.2\bin`.
- Click **OK** in all windows.
- Open a new command line window and retest.
7. Enter the downloaded 6.0 bin folder in File Explorer:
```plaintext
Downloads\mongodb-win32-x86_64-windows-6.0.6\bin
```
8. In a different file explorer, open the bin folder of mongoDB installation:
```plaintext
C:\Program Files\MongoDB\Server\4.2\bin
```
9. Delete the `mongod.exe` file from `C:\Program Files\MongoDB\Server\4.2\bin`.
10. Copy the new `mongod.exe` file from the `6.0.6\bin` folder to `C:\Program Files\MongoDB\Server\4.2\bin`.
11. Open **Task Manager > Services**.
12. Start the **MongoDB** service.
13. Start the **MongoDB** shell.
- Validate version:
```js
db.version()
```
- Validate reservations are still there:
```js
use Quali
db.Reservation.countDocuments()
```
14. (Optional) Start **Quali Server** and enter the **Sandboxes** dashboard in CloudShell Portal.
15. Stop **Quali Server** (if running).
16. Update **MongoDB** capabilities:
```js
db.adminCommand( { setFeatureCompatibilityVersion: "6.0" } )
```
## Related Topics
- [Select the Database Type](https://help.quali.com/Online%20Help/0.0/Portal/Content/IG/Complete%20Installation/slct-db-typ.htm)
- [Best Practices for MongoDB](https://help.quali.com/Online%20Help/0.0/Portal/Content/IG/Appendices/mongoDB-best-prctc.htm)
94 changes: 92 additions & 2 deletions docs/portal/blueprints/creating-blueprints/abstract-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,96 @@
sidebar_position: 7
---

# Abstract Resources
# Add Abstract Resources

WIP
This article explains how to create abstract resources.
:::note
Abstract resources can be saved as templates, which can be easily added to any blueprint, just like any specific resource. Abstract templates are created and managed by the administrator in the Inventory dashboard, in the Abstract Templates page.
:::

## Creating abstract resources

You can use abstract resources in your blueprint in the following ways:
<details>
<summary>To add an abstract resource template from the Inventory</summary>

1. Click the **Abstract** button in the toolbar.

The **Add Abstract Template** pane is displayed, listing all the resource templates in the system.

2. To find the resource template, use the **Families** and **Models** groupings on the left side of the pane and/or search for the resource template by name.
:::note
Only families of existing resources are displayed.
:::
3. Drag and drop the relevant template to the diagram to add it to the blueprint.
</details>

<details>
<summary>To create a new abstract resource</summary>

1. In the blueprint diagram, click the **Blueprint** menu and select the **Create Abstract Resource** option.

The **Create Abstract Resource** dialog box is displayed.

2. Select the resource family. Only families of existing resources are displayed.
:::tip
Resources that have a "CS\_" prefix are based on 2nd Gen Shells.
:::
![](/Images/CloudShell-Portal/Lab-Management/Working-with-Resources/AbstractResTypeSelection.png)

An empty abstract resource definition dialog box is displayed.
:::note
The **Matches** section in the top right of the dialog box indicates how many resources satisfy the new abstract resource requirements (at the moment, the only requirement is the selected resource type).
:::
3. Enter a **Name** for the abstract resource.
:::note
The resource's name has a limit of 100 characters and can only contain alpha-numeric characters, spaces, and the following characters: | . - \_ \] \[
:::
4. There are three types of resource requirements you can add: **Models** define the model of the resource, **Attributes** define attributes of the resource, and **Sub-resources** are resources within the resource (such as ports). For additional information, see [Defining Requirements](https://help.quali.com/Online%20Help/0.0/Portal/Content/CSP/INVN/Abst-Rsrc-Tmplt-Sttngs.htm#Defining).
:::note Special considerations:

- For resources based on a 1st Gen Shell, when creating the abstract resource from an existing resource and no model is selected, the Attributes drop down displays all attributes that are shared among the resource’s family and models.
- For resources based on a 2nd Gen Shell, only the family’s attributes are displayed, as each model’s attributes have a namespace that is unique to that model.

Therefore, if you want to define an abstract resource based on attributes without limiting it to a specific model, either use family-level attributes or use custom attributes, which can be associated with multiple models. To learn how to create and associate custom attributes with your Shell, see the CloudShell Dev Guide's [Deploying to Production](https://help.quali.com/Online%20Help/0.0/Portal/Content/DevGuide/Shells/Deploying-to-Production.htm).
:::
5. **Additional Information** inputs are inputs that aren't mandatory. Use these to prompt the user for inputs that drive provisioning or provide general information about the resource. For additional information, see [Defining Additional Info](https://help.quali.com/Online%20Help/0.0/Portal/Content/CSP/INVN/Abst-Rsrc-Tmplt-Sttngs.htm#Addition).
6. Click **Save Changes**.

The new abstract resource is displayed in the diagram.

Reserving the blueprint will automatically pick a match for it based on resource availability.
</details>
<details>
<summary>To replace an existing resource with an abstract resource</summary>

This action changes a specific resource in the diagram into an abstract resource, while retaining the original resource's settings, family, model and attribute values.

1. In the blueprint diagram, hover over a resource and select the **Replace With Abstract** option.

![](/Images/CloudShell-Portal/Lab-Management/Working-with-Resources/ReplaceWithAbstract_355x141.png)

The resource becomes an abstract resource with the same structure and attributes as the resource it replaced.
:::tip
Consider changing the abstract's settings so as not to limit resource selection. For example, removing unneeded attribute values.
:::
2. Edit the abstract resource as necessary - see [Abstract Resource Settings](https://help.quali.com/Online%20Help/0.0/Portal/Content/CSP/INVN/Abst-Rsrc-Tmplt-Sttngs.htm).
3. Save the abstract resource.
</details>

<details>
<summary>To duplicate an existing abstract resource or template</summary>

The quickest way to create a copy or a variation of an existing abstract resource or template is simply to duplicate it.

1. In the blueprint diagram, hover over an abstract resource and select **Duplicate**.

The new abstract resource is added to the blueprint with the same settings as the original.

2. Edit the abstract resource as necessary - see [Abstract Resource Settings](https://help.quali.com/Online%20Help/0.0/Portal/Content/CSP/INVN/Abst-Rsrc-Tmplt-Sttngs.htm).
3. Save the abstract resource.
</details>

## Related Topics

- [Blueprint Workspace](https://help.quali.com/Online%20Help/0.0/Portal/Content/CSP/LAB-MNG/Blprnt-Brws-Wrkspc.htm)
Loading

0 comments on commit 9395356

Please sign in to comment.