You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/highly-available-nfs-workload-on-hpe-greenlake-for-private-cloud-enterprise-using-serviceguard-for-linux.md
+26-19Lines changed: 26 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,15 +40,14 @@ Ansible Automation Platform is an end-to-end automation platform to configure sy
40
40
The first step is to create a virtual machine that can act as a Jump Host and where you will execute your code. Virtual machines created in later steps will be reachable from your Jump Host if you configure your networking infrastructure appropriately.
41
41
You can create a virtual machine in the Virtual Machines service of HPE GreenLake for Private Cloud Enterprise as follows:
42
42
43
-
1. Log into HPE GreenLake Central by navigating to https://client.greenlake.hpe.com
44
-
2. Launch the Virtual Machines Service Console
45
-
3. Select Provisioning --> Instances and create a Linux-based virtual machine using whichever VM (Virtual Machine) image, Plan, and the network you find most suitable.
43
+
1. Log into **HPE GreenLake Central** by navigating to https://client.greenlake.hpe.com
44
+
2. Launch the **Virtual Machines Service Console**
45
+
3. Select **Provisioning --> Instances** and create a Linux-based virtual machine using whichever VM (Virtual Machine) image, Plan, and the network you find most suitable.
46
46
4. (optional) Configure your virtual machine so you can access your GitHub or other code repository.
47
-
5. Log into your virtual machine and install Terraform: Hashi Corp has provided a useful [tutorial ](<1. https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli>)on how to do this for various distributions of Linux
48
-
6. Verify the installation:
49
-
a. Execute this command: `terraform --help`
47
+
5. Log into your virtual machine and install Terraform: Hashi Corp has provided a useful [tutorial](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli) on how to do this for various distributions of Linux
48
+
6. Verify the installation by executing this command: `terraform --help`
50
49
51
-
At this point, you are ready to start building your infrastructure description file.
50
+
At this point, you are ready to start building your infrastructure description file.
52
51
53
52
## Building a Terraform configuration file from scratch
54
53
@@ -74,7 +73,8 @@ terraform {
74
73
75
74
You can find out more about the HPE GreenLake Terraform provider from its [Terraform Registry page](https://registry.terraform.io/providers/HPE/hpegl/latest). This page also provides a link to the GitHub repository corresponding to this provider.
76
75
The docs folder is your best source of information for using the different data sources and resources provided by the provider. If you navigate to the resources section, you will see that one resource you can configure with this provider is a VM instance. This article will focus on this resource.
77
-
Note: Because this is open source, do not hesitate to open issues, or even a pull request, if you identify an issue.
76
+
77
+
***Note:*** Because this is open source, do not hesitate to open issues, or even a pull request, if you identify an issue.
78
78
79
79
### Setting up the Terraform provider
80
80
@@ -91,7 +91,9 @@ provider "hpegl" {
91
91
```
92
92
93
93
The rest (such as tenant id, user id and user secret key) can be placed in a RC file, which you can source before running your Terraform command.
94
-
You can find your location and your space name from the HPE GreenLake for Private Cloud Enterprise Overview. In the example shown below, FTC06 is our location:
94
+
You can find your location and your space name from the HPE GreenLake for Private Cloud Enterprise Overview.
95
+
96
+
In the example shown below, FTC06 is our location:
95
97
96
98

97
99
@@ -101,7 +103,7 @@ In the capture below, Default is the space you will use for your work with Terra
101
103
102
104
## Setting up API Client access
103
105
104
-
Next, you need to create a new API Client access dedicated to Terraform. You can do this from the HPE GreenLake console under your settings icon, select User Management and then the API Clients tab.
106
+
Next, you need to create a new API Client access dedicated to Terraform. You can do this from the HPE GreenLake console under your settings icon, select **User Management** and then the **API Clients** tab.
105
107
106
108

107
109
@@ -126,14 +128,19 @@ And execute it on your machine to set these environment variables.
126
128
Once your API Client has been created, you need to assign a Role and a Space. You can assign a Role and a Space by clicking on your new API Client and then clicking the Create Assignment button.
127
129
Since intent is to use this API Client to create resources in the Virtual Machines Service, we need to assign an appropriate Virtual Machines Role. Choose a Role like ‘Private Cloud Tenant Contributor’ and choose the same Space as used earlier, I.e., ‘Default.’
128
130
129
-
Note: More details on HPE GreenLake user roles can be found in the HPE GreenLake documentation.
131
+
***Note:*** More details on HPE GreenLake user roles can be found in the [HPE GreenLake documentation](https://support.hpe.com/hpesc/public/docDisplay?docId=a00120892en_us).
130
132
131
133
### Set API Client Usernames and Passwords
132
134
133
135
When a user creates virtual machines using the HPE GreenLake for Private Cloud Enterprise: Virtual Machines user interface, they first set the Linux and Windows username and password. Once this is done, any virtual machines subsequently created by that user will inherit these credentials. The user can later use these credentials to log into these virtual machines.
136
+
134
137
API Clients which are used to create virtual machines can also set Linux and Windows username and password values. Since the API Client does not use the HPE GreenLake for Private Cloud Enterprise: Virtual Machines user interface, this must be done via an API call.
135
-
Here is a sample script which reads the VM_USERNAME and VM_PASSWORD environment variables and uses the values for Linux and Windows username and password for the API Client. The script assumes a Location value of ‘FTC06’ and Space value of ‘Default’.
136
-
To execute this script, first set appropriate values for the VM_USERNAME and VM_PASSWORD environment variables. Next, execute the resource file, which was created earlier, which sets the HPEGL\*\* environment variables for your API Client. Finally, execute the script below.
138
+
139
+
Here is a sample script which reads the VM\_USERNAME and VM\_PASSWORD environment variables and uses the values for Linux and Windows username and password for the API Client. The script assumes a Location value of ‘FTC06’ and Space value of ‘Default’.
140
+
141
+
To execute this script, first set appropriate values for the VM\_USERNAME and VM\_PASSWORD environment variables. Next, execute the resource file, which was created earlier, which sets the HPEGL\*\* environment variables for your API Client.
142
+
143
+
Finally, execute the script below:
137
144
138
145
```shell
139
146
#!/bin/bash
@@ -191,7 +198,7 @@ Your next step with the TF file is to query the HPE GreenLake provider to collec
191
198
192
199
• Folder Code
193
200
194
-
For this, you will use the Terraform data statements. For example, the following statement retrieves the Cloud ID and stores it (in variable called cloud), which we can later retrieve using: data.hpegl_vmass_cloud.cloud.id
201
+
For this, you will use the Terraform data statements. For example, the following statement retrieves the Cloud ID and stores it (in variable called cloud), which we can later retrieve using: data.hpegl\_vmass\_cloud.cloud.id
3 VMs need to be created to setup SGLX. 2 VMs will be used to create Serviceguard for Linux nodes where the NFS service will be up and running. The third VM will act as a quorum server for the Serviceguard cluster to ensure that split brain of the cluster does not impact the availability of the monitored workload.
326
333
327
-
**Note:** You can get information about each of the resource statements supported by the hpegl provider from [GitHub](https://github.com/hpe/terraform-provider-hpegl/tree/main/docs/resources).
334
+
***Note:*** You can get information about each of the resource statements supported by the hpegl provider from [GitHub](https://github.com/hpe/terraform-provider-hpegl/tree/main/docs/resources).
328
335
329
-
**Note:** An existing Serviceguard Quorum Server in your environment can be used instead of provisioning a third VM, provided the Quorum Server is reachable to the 2 VM’s that were created.
336
+
***Note:*** An existing Serviceguard Quorum Server in your environment can be used instead of provisioning a third VM, provided the Quorum Server is reachable to the 2 VM’s that were created.
330
337
331
338
### Terraform init
332
339
@@ -349,7 +356,7 @@ terraform apply
349
356
350
357
This will rerun the plan command, then prompt you to confirm before it starts building what is in the plan. Here is some sample output from the `terraform apply` command:
351
358
352
-
```
359
+
```markdown
353
360
Do you want to perform these actions?
354
361
Terraform will perform the actions described above.
355
362
Only 'yes' will be accepted to approve.
@@ -554,7 +561,7 @@ Serviceguard for Linux Flex Storage Add-on is a software-based, shared-nothing,
554
561
555
562
## Configuring LVM
556
563
557
-
Once data replication is configured on the nodes, you can configure LVM on top of the DRBD disk /dev/drbd0. The following Ansible snippet can be used to configure the LVM volume group named nfsvg and logical volume names nfsvol of size 45GB.
564
+
Once data replication is configured on the nodes, you can configure LVM on top of the DRBD disk _/dev/drbd0_. The following Ansible snippet can be used to configure the LVM volume group named nfsvg and logical volume names nfsvol of size 45GB.
558
565
559
566
```yaml
560
567
---
@@ -760,4 +767,4 @@ In this blog, you learned how to use platforms like Terraform and Ansible to eas
760
767
761
768
Serviceguard for Linux has high availability and disaster recovery solutions available for various applications such as SAP, Oracle, SQL Server On Linux, EDB Postgres, etc. For more information regarding these solutions you can refer to the HPE Serviceguard for Linux operational guide for workloads and solutions available at https://www.hpe.com/info/linux-serviceguard-docs
762
769
763
-
Check back on the HPE Developer Community blog for more articles on HPE GreenLake for Private Cloud.
770
+
Check back on the [HPE Developer Community blog](https://developer.hpe.com/blog) for more articles on HPE GreenLake for Private Cloud.
0 commit comments