vania-janet/multiturn-rag-retrieval-data huggingface dataset:
If you don't specify this option, the PV defaults to ext4. When the wrong fsType is defined, then the PV creation succeeds, but the mounting of the PV to a pod fails. To retrieve your volume details, run ibmcloud sl block volume-list to get the volume ID, then run ibmcloud sl block volume-detail <volume_ID> to get the details of your volume.

Lun
: Enter the LUN ID of your block storage volume. To retrieve your volume details, run ibmcloud sl block volume-list to get the volume ID, then run ibmcloud sl block volume-detail <volume_ID> to get the details of your volume.

TargetPortal
: Enter the IP address of your block storage. To retrieve the TargetPortal parameter, run ibmcloud sl block volume-list to get the volume ID, then run ibmcloud sl block volume-detail <volume_ID> and make a note of the Target IP in the output.

VolumeId
: Enter the ID of your block storage. To retrieve your volume details, run ibmcloud sl block volume-list.

volumeName
: Enter the same value as your PV name. For example, block-storage-pv.
5. Create the PV in your cluster.

oc apply -f pv.yaml
6. Verify that the PV is created.

oc get pv
7. Create another configuration file to create your PVC. In order for the PVC to match the PV that you created earlier, you must choose the same value for storage and accessMode. The storage-class field must be an empty string. If any of these fields don't match the PV, then a new PV is created automatically instead.

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: block-storage-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "20Gi"
storageClassName: ""
8. Create your PVC.

oc apply -f static-pvc.yaml
Verify that the static route is created. In the output, check the node_status for each worker node where you create the static route.

kubectl get staticroute <route_name> -o yaml

Example output

apiVersion: static-route.ibm.com/v1
kind: StaticRoute
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: 
{"apiVersion":"static-route.ibm.com/v1","kind":"StaticRoute","metadata":{"annotations":{},"name":"mystaticroute"},"spec":{"selectors":[{"key":"kubernetes.io/arch","operator":"In","values":"amd64"]}],"subnet":"10.94.227.46/24"}}
creationTimestamp: "2020-05-20T16:43:12Z"
finalizers:
- finalizer.static-route.ibm.com
generation: 1
name: mystaticroute
resourceVersion: "3753886"
selfLink: /apis/static-route.ibm.com/v1/staticroutes/mystaticroute
uid: f284359f-9d13-4e27-9d3a-8fb38cbc7a5c
spec:
selectors:
- key: kubernetes.io/arch
operator: In
values:
- amd64
subnet: 10.94.227.46/24
status:
nodeStatus:
- error: ""
hostname: 10.94.227.19
state:
gateway: 10.94.227.1
selectors:
- key: kubernetes.io/arch
operator: In
values:
- amd64
subnet: 10.94.227.46/24
- error: ""
For each zone in which you plan to create subnets, create one or more address prefixes. The address prefixes must be within one of the following ranges: 10.0.0.0 - 10.255.255.255, 172.17.0.0 - 172.17.255.255, 172.21.0.0 - 172.31.255.255, 192.168.0.0 - 192.168.254.255.



3. Create subnets that use your address prefixes.



1. From the [VPC subnet dashboard](https://cloud.ibm.com/vpc/network/subnets), click Create.
2. Enter a name for your subnet and select the name of your classic access VPC.
3. Select the location and zone where you want to create the subnet.
4. Select the address prefix that you created for this zone.
5. Specify the number of IP addresses to create. VPC subnets provide IP addresses for your worker nodes and load balancer services in the cluster, so [create a VPC subnet with enough IP addresses](https://cloud.ibm.com/docs/openshift?topic=openshift-vpc-subnetsvpc_basics_subnets), such as 256. You can't change the number of IPs that a VPC subnet has later.
6. To run default Red Hat OpenShift components such as the web console or OperatorHub, and to allow your cluster to access public endpoints such as a public URL of another app or an IBM Cloud service that supports public cloud service endpoints only, you must attach a public gateway to your subnet.
7. Click Create subnet.



4. Use the subnets to [create a cluster](https://cloud.ibm.com/docs/openshift?topic=openshift-cluster-create-vpc-gen2). Do not delete the subnets that you attach to your cluster during cluster creation or when you add worker nodes in a zone.
"created_by": "iam-ServiceId-222b47ab-b08e-42c3acb8",
"creation_date": "2022-06-30T21:04:15.143896Z",
"description": "Test lock for secret in the custom secret group.",
"last_update_date": "2022-06-30T21:31:19.343086Z",
"name": "lock-for-app-1",
"secret_group_id": "d2e98a96-18ed-fb22",
"secret_id": "c86946e6-b392-2613-15095b3",
"secret_version_alias": "current",
"secret_version_id": "ad6aa6d9-b43c-4bc3-52e64"
}
],
"locks_total": 1
},
"warnings": null
}







 Unlock a secret 

Use the following commands to remove one or more locks on the current version of a secret.

Remove locks on a secret in the default secret group.

vault write [-format=FORMAT] ibmcloud/SECRET_TYPE/locks/SECRET_ID/unlock locks=LOCK_NAME locks=LOCK_NAME

Remove locks on a secret in a custom secret group.

vault write [-format=FORMAT] ibmcloud/SECRET_TYPE/locks/groups/SECRET_GROUP_ID/SECRET_ID/unlock locks=LOCK_NAME locks=LOCK_NAME



 Prerequisites 

You need the [Writer service role](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-iam) or higher to create secret locks.





 Command options 

-format
: Prints the output in the format that you specify. Valid formats are table, json, and yaml. The default is table. You can also set the output format by using the VAULT_FORMAT environment variable.





 Examples
GUID: ebad3176-8a1a-41f2-a803-217621bf6309
Location: global
State: active
Type: service_instance
Sub Type:
Allow Cleanup: false
Locked: false
Created at: 2021-12-27T07:57:56Z
Updated at: 2021-12-27T07:57:58Z
Last Operation:
Status create succeeded
Message Completed create instance operation
Show more
5. Configure the CRN by copying the value of ID from the response the of Cloud Object Storage creation call in the previous step:

Action
: Enter:

ibmcloud cos config crn
Resource Instance ID CRN: ID

Parameter values:



* ID: The value of ID from the response the of Cloud Object Storage creation call



Example
: Enter:

ibmcloud cos config crn
Resource Instance ID CRN: crn:v1:bluemix:public:cloud-object-storage:global:a/867d444f64594fd68c7ebf4baf8f6c90:ebad3176-8a1a-41f2-a803-217621bf6309::
6. Create a Cloud Object Storage bucket:

Action
: Enter:

ibmcloud cos bucket-create --bucket BUCKET_NAME [--class CLASS_NAME] [--ibm-service-instance-id ID] [--region REGION] [--output FORMAT]

Parameter values:



* BUCKET_NAME: Any name of your choice
* ID: The value of GUID from the response the of Cloud Object Storage creation call
* REGION: The IBM Cloud region in which the Cloud Object Storage instance was created
* FORMAT: Output format can be JSON or text.



Example
: Enter:
Create virtual machines to serve as the hosts for your Satellite location resources, including the control plane and any Red Hat OpenShift clusters that you want to create. The following command creates 6 VMs at the [minimum host requirements](https://cloud.ibm.com/docs/satellite?topic=satellite-host-reqs) for compute, disks, and image. The VMs are created in the resource group and network security group that you previously created. For more information, see the [Azure CLI documentation](https://docs.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latestaz_vm_create).



* Create Red Hat Enterprise Linux hosts

az vm create --name <vm_name> --resource-group RESOURCE-GROUP --admin-user USERNAME --admin-password PASSWORD --image RedHat:RHEL:7-LVM:latest --nsg <network_security_group> --os-disk-name DISK_NAME --os-disk-size-gb 128 --size Standard_D4s_v3 --count 6 --custom-data FILEPATH_TO_HOST_REGISTRATION_SCRIPT
* Create Red Hat CoreOS hosts

az vm create --name VM --resource-group RESOURCE-GROUP --image RHCOS-IMAGE --admin-username USERNAME --admin-password PASSWORD--size Standard_B8ms --data-disk-sizes-gb 100 --custom-data FILEPATH-IGNITION-SCRIPT-LOCATION --os-disk-size-gb 100 --public-ip-sku Standard --generate-ssh-keys



If you don't want to pass the --custom-data command option during VM creation, you can run the host registration script on each VM after provisioning.
7. Wait for the instances to create. During the creation of your instance, the script runs automatically. This process takes a few minutes to complete.
8. Monitor the progress of the registration script.



1. Get the public IP address of one of your instances.
First, create a root key from a [base64 value](https://cloud.ibm.com/docs/cli?topic=cli-key-protect-cli-referencekp-key-create-example-3) or an [imported token](https://cloud.ibm.com/docs/cli?topic=cli-key-protect-cli-referencekp-key-create-example-4).

 create a random, base64-encoded, 32-byte key material
$ KEY_MATERIAL=$(openssl rand -base64 32)

 create a root key from a base64-encoded value
$ ibmcloud kp key create my-base64-root-key -k $KEY_MATERIAL

Creating key: 'my-base64-root-key', in instance: '390086ac-76fa-4094-8cf3-c0829bd69526'...
OK
Key ID Key Name
e55f86ab-6984-4594-ad23-3024f6440a58 my-base64-root-key

 create a new key material
$ NEW_KEY_MATERIAL=$(openssl rand -base64 32)

 rotate the key
$ ibmcloud kp key rotate e55f86ab-6984-4594-ad23-3024f6440a58 -k $NEW_KEY_MATERIAL

Rotating root key...
OK

 the key was created from a key material, NOT providing a new key material will fail
$ ibmcloud kp key rotate e55f86ab-6984-4594-ad23-3024f6440a58

Rotating root key...
FAILED





 Example 3 

This examples shows how to...



1. Create a root key
2. Create a data encryption key (DEK), this is the plaintext
3. Wrap the DEK with the root key, this creates a ciphertext
4. Rotate the root key
5.
Actions that generate events for block storage resources

 Resource Action Description 

 volume is.volume.volume.create Volume was created 
 volume is.volume.volume.update Volume was updated 
 volume is.volume.volume.delete Volume was deleted 
 volume is.volume.volume.read One or more volumes were retrieved 
 volume is.volume.volume.operate Volume ID was specified 



An event does not contain a volume name if no information is available at the time of the event. For example, when you make a request to create a volume but do not provide a volume name, the information is not available and does not appear in the event.





 Snapshots events 

The following table lists the actions that are related to snapshots resources and the generation of events.



Table 23. Actions that generate events for snapshot resources

 Resource Action Description 

 snapshot is.snapshot.snapshot.create Snapshot creation process started 
 snapshot is.snapshot.snapshot.capture Volume data was captured 
 snapshot is.snapshot.snapshot.update Snapshot was updated 
 snapshot is.snapshot.snapshot.delete Snapshot was deleted 
 snapshot is.snapshot.snapshot.read One or more snapshots were retrieved 
 snapshot is.snapshot.snapshot.restore Volume was restored from a snapshot 
 snapshot is.snapshot.snapshot.operate Source snapshot ID was specified 







 File storage events 

The following table lists the actions that are related to file share resources and the generation of events.

IBM Cloud® File Storage for VPC is available for customers with special approval to preview this service in the Frankfurt, London, Madrid, Dallas, Toronto, Washington, Sao Paulo, Sydney, Osaka, and Tokyo regions. Contact your IBM Sales representative if you are interested in getting access.



Table 24. Actions that generate events for file storage resources

 Resource Action Description 

 shares is.share.share.create File share was created 
 shares is.share.share.read One or more file shares were retrieved 
 shares is.share.share.update File share was updated 
 shares is.share.share.delete File share was deleted 
 shares is.share.share.split Replication relationship is removed between two file shares
Step 2 - create an import token, which is required to restore the key, and restore the key

 NOTE: "kp key restore" requires an import token to complete the process,
 if you follow this example, the previously created import token may still
 exist and the example works; otherwise, if the import token has expired then
 you need to create a new import token prior to restoring the key

 create an import token that expires in 5 minutes and allows 10 retrievals
$ ibmcloud kp import-token create -e 300 -m 10

Created Expires Max Retrievals Remaining Retrievals
2020-06-18 12:30:54 +0000 UTC 2020-06-18 12:35:54 +0000 UTC 10 10

 extract the nonce that was created by the "kp import-token create" command
$ NONCE=$(ibmcloud kp import-token show | jq -r '.["nonce"]')

$ echo $NONCE

N3x8F0ihAZ51nj6M

 extract the public key that was created by the "kp import-token create" command
$ PUBLIC_KEY=$(ibmcloud kp import-token show | jq -r '.["payload"]')

$ echo $PUBLIC_KEY

LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0t ...<redacted>... QyBLRVktLS0tLQo=

 encrypt the key material using the public key
$ ibmcloud kp import-token key-encrypt -k $KEY_MATERIAL -p $PUBLIC_KEY

Encrypted Key
Ch7hcsT1EOfSdghjOHKAemBZuzDoqJoH ...<redacted>... F4p/mkGT/EQJS5o=

 capture the encrypted key material
$ ENCRYPTED_KEY=Ch7hcsT1EOfSdghjOHKAemBZuzDoqJoH ...<redacted>...
Snapshot The snapshot (backup) that was created when the backup job finishes. Click the name to see the details in the side panel. 
 Source Source volume from which the backup was created. Click the volume name to see its details. 







 View snapshots that were created by a backup job in the UI 

From the list of backup jobs, click the name of a snapshot. A side panel provides snapshot details (Table 2).



Table 2. Snapshot details side panel

 Field Description 

 Status The status of the snapshot, such as Stable. For a list of snapshot statuses, see [Snapshot statuses](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-manage&interface=uisnapshots-vpc-status). 
 Name The name of the backup policy that created the snapshot. You can change the backup policy settings by clicking the pencil icon. For more information, see [Managing backup policies](https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-manage). 
 Tags User tags inherited from the source volume when the snapshot was created. Click the pencil icon to more user tags. 
 ID GUID of the snapshot. 
 Bootable It indicates whether the snapshot was created from a boot volume. 
 CRN Cloud resource name of the snapshot. 
 Created Date and time of when that the snapshot resource creation process started. 
 Captured The date and time of when this snapshot was taken. If the field is empty, then the snapshot is not yet captured or the snapshot was created before this feature was introduced (January 2022). 
 Size Size in GBs of the snapshot, it is inherited from the source volume. 
 Source Volume Source volume from which the first snapshot was taken. Click the link for volume details. If the volume was deleted, the name appears without a link. 
 Encryption Either provider-managed or customer-managed. 









 View backup jobs from the CLI 

You can view a list of backup jobs by specifying the ID or name of the backup policy.
For more information about creating VPC resources, see [Getting started with Virtual Private Cloud (VPC)](https://cloud.ibm.com/docs/vpc?topic=vpc-getting-started).
2. You set up your [API environment](https://cloud.ibm.com/docs/vpc?topic=vpc-set-up-environmentapi-prerequisites-setup) and initialized all the variables needed.



You can also create a VPN gateway and add VPN connections by using the UI. For instructions, see [Creating a VPN gateway using the UI](https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-create-gatewayvpn-create-ui).



 Step 1. Create a VPN gateway in the first VPC 

The VPN gateway is created in the zone that is associated with the subnet you select. For best performance, create the VPN gateway in a subnet without any other VPC resources to ensure that enough private IPs are available for the gateway. A VPN gateway needs 8 private IP addresses to accommodate high availability and rolling upgrades.

The VPN gateway can connect only to virtual server instances in the zone it is deployed. Instances in other zones can't use this VPN gateway to communicate with the other network. For zone fault tolerance, deploy one VPN gateway per zone.

Find the Subnet ID by using the get subnet command then populate the variable:

export SubnetId1=<your_subnet_id>

The following command deploys the VPN gateway in the Default resource group.

curl -X POST "$vpc_api_endpoint/v1/vpn_gateways?version=$api_version&generation=2" -H "Authorization: $iam_token" -d '{
"name": "vpn-gateway-1",
"subnet": {
"id": "'$SubnetId1'"
}
}'

Sample output:

{
For more information, see the [Terraform documentation](https://www.terraform.io/docs/language/index.html).



Dynamic rules are created by setting conditions that must be matched by the data that is configured within the IdP and passed in with a user's federated ID during login. You can add more than one condition for a rule. All conditions set in the rule must be met for a user to be added to an access group.

To create a rule by using Terraform, follow these steps:



1. Create an argument in your main.tf file. The following example creates a new dynamic rule for an access group by using the ibm_iam_access_group_dynamic_rule resource, where name is a unique name to identify the dynamic rule.

resource "ibm_iam_access_group_dynamic_rule" "rule1" {
name = "newrule"
access_group_id = "AccessGroupId-dsnd4bvsaf"
expiration = 4
identity_provider = "test-idp.com"
conditions {
claim = "blueGroups"
operator = "CONTAINS"
value = ""test-bluegroup-saml""
}
}

For more information, see the argument reference details in the [Terraform documentation](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_access_group_dynamic_rule) page.
2. After you finish building your configuration file, initialize the Terraform CLI. For more information, see [Initializing Working Directories](https://www.terraform.io/cli/init).

terraform init
3. Provision the resources from the main.tf file. For more information, see [Provisioning Infrastructure with Terraform](https://www.terraform.io/cli/run).



1. Run terraform plan to generate a Terraform execution plan to preview the proposed actions.

terraform plan
2.
* UI
* CLI
* API
* Terraform







 Creating resources 

A

resourceis anything that you can create from the catalog that is managed by and contained within a resource group. You can create and manage resources by going to your [resource list](https://cloud.ibm.com/resources) in the IBM Cloud® console or by using the command-line interface (CLI).

Services that are managed by using IBM Cloud [Identity and Access Management (IAM) access control](https://cloud.ibm.com/docs/account?topic=account-userroles) and belong to a resource group have several benefits. Because resource groups are not scoped by location, you can create apps and services from different locations in the same resource group. You can also use fine-grained access control down to an individual instance within a resource group.



 Required access for creating resources 

For users in your account to be able to create resources from the catalog and assign them to a resource group, they must be assigned two access policies:



* A policy with viewer role or higher on the resources group itself
* A policy with editor role or higher on the service in the account







 Creating resources in the console 

Use the following steps to create a resource in the console:



1. From your dashboard, click View resources within the Resources summary widget.
2. Click Create resource. From here, you are directed to the catalog. You can search the products or filter based on a specific category, provider, pricing plan, type of compliance, or release type. Examples of resources include apps, service instances, container clusters, storage volumes, virtual servers, and software.



After you create the resource, it is displayed in your list of resources on the Resource list page.





 Creating resources by using the CLI 

You can create a resource by using the IBM Cloud® Command Line Interface. For detailed information about working with resources, see [Working with resources and resource groups](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_commands_resource).



1. Log in, and select the account.

ibmcloud login
2.
Step 3: Create your function 

Create the Function from the funhello.js file.

ibmcloud ce fn create --name funhello --runtime nodejs-18 --build-source funhello.js

Command output

Preparing function 'funhello' for build push...
Creating function 'funhello'...
Packaging files to upload from source path 'hello.js'...
Submitting build run 'funhello-run-230623-090738611'...
Creating image 'private.stg.icr.io/ce--8a6a0-13c66hbi3rhz/function-funhello:230623-1407-s8kzr'...
Waiting for build run to complete...
Build run status: 'Running'
Build run completed successfully.
Run 'ibmcloud ce buildrun get -n funhello-run-230623-090738611' to check the build run status.
Waiting for function 'funhello' to become ready...
Function 'funhello' is ready.
OK
Run 'ibmcloud ce function get -n funhello' to see more details.

https://funhello.13c66hbi3rhz.us-south.codeengine.appdomain.cloud

After the Function invocation URL becomes available, use the following command to find information about the Function.

ibmcloud ce fn get -n funhello

Let's take a deeper look at the previous function create command. Notice that the output of the function create command provides information about the progression of the build run before the function is created and deployed.



1. Code Engine receives a request to create an function from source code.
2. Code Engine checks for an IAM service ID and API key that is associated with the selected project. This service ID must be authorized to read and write to IBM Cloud Container Registry. If no service ID exists, Code Engine creates one for you.
.then((data) => {
if (data != null && data.Contents != null) {
for (var i = 0; i < data.Contents.length; i++) {
var itemKey = data.Contents[i].Key;
var itemSize = data.Contents[i].Size;
console.log(Item: ${itemKey} (${itemSize} bytes).)
}
logDone();
}
})
.catch(logError);
}

// Retrieve a particular item from the bucket
function getItem(bucketName, itemName) {
console.log(Retrieving item from bucket: ${bucketName}, key: ${itemName});
return cos.getObject({
Bucket: bucketName,
Key: itemName
}).promise()
.then((data) => {
if (data != null) {
console.log('File Contents: ' + Buffer.from(data.Body).toString());
logDone();
}
})
.catch(logError);
}

// Create new bucket
function createBucket(bucketName) {
console.log(Creating new bucket: ${bucketName});
return cos.createBucket({
Bucket: bucketName,
CreateBucketConfiguration: {
LocationConstraint: COS_STORAGE_CLASS
},
}).promise()
.then((() => {
console.log(Bucket: ${bucketName} created!);
logDone();
}))
.catch(logError);
}

// Create new text file
function createTextFile(bucketName, itemName, fileText) {
console.log(Creating new item: ${itemName});
return cos.putObject({
Bucket: bucketName,
Key: itemName,