vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Run the below command to see the instance(pod) count incrementing as part of the autoscaling.

ibmcloud code-engine application get -n frontend

By default, the maximum number of requests that can be processed concurrently per instance is 10 leading to autoscaling and this value can be changed using --concurrency or -cn flag with application update command.
4. If you didn't want to allow as many as 10 instances to be created, you can adjust the max scale to be a lower number. While your serverless application can easily scale up, you may depend on a downstream service such as a SQL DB that can only handle a limited number of connections or another rate limited API. Let's try limiting the number of instances for this frontend application.

ibmcloud code-engine application update --name frontend --max-scale 5
5. Once load generation is stopped, wait for a few minutes to see the instances terminating, eventually scaling down to zero instances.
6. Again, navigate to the [load generator URL](https://load.fun.cloud.ibm.com/) and paste the frontend application URL from the step above. Run the ibmcloud code-engine application get -n frontend command to see the instance count increasing to 5.

Expected Output:

Name Revision Running Status Restarts Age
frontend-00002-deployment-77d5fbfb5d-7zpfl frontend-00002 3/3 Running 0 70s
frontend-00002-deployment-77d5fbfb5d-kv6rn frontend-00002 3/3 Running 0 69s
frontend-00002-deployment-77d5fbfb5d-mhlwn frontend-00002 3/3 Running 0 68s
frontend-00002-deployment-77d5fbfb5d-qkjmd frontend-00002 3/3 Running 0 67s
frontend-00002-deployment-77d5fbfb5d-zpr9n frontend-00002 3/3 Running 0 85s







 Deploy a backend application and test the connection 



1.
* BI.S4.H2.3000 (boot only)







 Storage specifications 

The following dual-socket servers are available in the Appliance delivery model for SAP HANA, with preconfigured disk storage.

These Profiles do not use any Network Block or File storage options that are mounted to the Bare Metal server. These Profiles use only Local SSD Storage devices that are physically attached through a RAID Controller inside the server.



 BI.S3.H2.192 Appliance 

Link to Profile: [BI.S3.H2.192 Appliance](https://cloud.ibm.com/gen1/infrastructure/provision/bm?imageItemId=13475&packageId=1045&presetId=823)



 Physical Disk and RAID Configuration 



 RAID Components Drives Array Total Capacity 

 RAID 1 2x 960 GB 5100 hdd0, hdd1 RAID1-A 960 GB 
 RAID 1 2x 960 GB 5100 hdd2, hdd3 RAID1-B 960 GB 
 Global hot spare 1x 960 GB 5100 hdd4 







 Disk mount points and Partitions 



 Array Partition Name Size (GB) 

 RAID1-A /dev/sda 
 /dev/sda1 /boot 50 
 /dev/sda2 / 150 
 /dev/sda3 /usr/sap 150 
 /dev/sda4 /hana/log 
 RAID1-B /dev/sdb 
 /dev/sdb1 /hana/shared 250 
 /dev/sdb2 /hana/data remaining capacity 









 BI.S3.H2.384 Appliance 

Link to Profile: [BI.S3.H2.384 Appliance](https://cloud.ibm.com/gen1/infrastructure/provision/bm?imageItemId=13475&packageId=1045&presetId=825)



 Physical Disk and RAID Configuration 



 RAID Components Drives Array Total Capacity 

 RAID 1 2x 960 GB 5100 hdd0, hdd1 RAID1-A 960 GB 
 RAID 10 4x 960 GB 5100 hdd2, hdd3, hdd4, hdd5 RAID1-B 1920 GB
Your selection is the location for all virtual server instances that you provision within this reserved capacity. 
 Pod Select the pod specific to your location. 
 Profile Select from popular profiles or all available vCPU and RAM combinations of SAN-backed storage (balanced, memory, or compute). Note: You cannot combine different profile sizes within the set of virtual server instances that are assigned to this capacity or change them later. The set of virtual server instances you reserve must be the same size. 







 Provisioning reserved instances 

After you provision your reserved capacity, it's time to provision your reserved virtual server instances. Reserved virtual server instances can be provisioned at any time during the contract term because your capacity is guaranteed. Complete the following steps to provision your reserved instances.



1. Open the [reserved virtual server instance](https://cloud.ibm.com/gen1/infrastructure/provision/vs?guestType=reserved&cm_sp=Cloud-Product-_-OnPageNav-IBMCloudPlatform_IBMVirtualMachines-_-VSI_Prod_Midpage) page from the catalog.
2. To provision a reserved virtual server instance, enter or select the following information:





Table 2. Reserved instances provisioning selections

 Field Value 

 Name A name is required for your reserved virtual server instance. 
 Billing Select either hourly or monthly billing. 
 Reserved Capacity Select your reserved capacity or select New Capacity + to provision extra reserved capacity. 
 Add-ons Choose any extra storage, network, or software. 







 Next steps 

After your virtual server is provisioned and available to use, you can configure your virtual servers by using the IBM Cloud console or SoftLayer API. For more information, see [Configuring virtual servers](https://cloud.ibm.com/docs/virtual-servers?topic=virtual-servers-configuring-virtual-serversconfiguring-virtual-servers).

If you have questions about reserved capacity and instances, see [FAQs: Reserved capacity and instances](https://cloud.ibm.com/docs/virtual-servers?topic=virtual-servers-faqs-reserved-capacity-and-instancesfaqs-reserved-capacity-and-instances).
Because this option is using IaaS or CaaS - similar considerations apply as in columns (4) and (5). Some resources can be idle, and autoscaling helps to eliminate idle resources. A number of running instances must always be present, and are likely to be used at less than 50% of their capacity. Stopped instances do not cost anything. Similar to column (3) Some resources can be idle, but autoscaling is not supported. Some number of running instances must always be present, and are likely to be used at less than 50% of their capacity. Stopped instances can incur the cost of storage. 
 Maturity Early maturity Early maturity Early maturity Moderate maturity Highly mature 
 Resource limits [Some limits exist](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-limits) Depends on allocated resources No No No 
 Latency for rarely used services Rare requests can initially see several seconds response time, but remain in MS range for subsequent requests. Depends Low Low Low - assuming the system has enough resources. 
 Best type of application Event processing, IoT, Mobile backend, microservices. Definitely not for monolithic applications. See [use cases](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-use_cases). Same as column (1), but when user wants to run on non-IBM Cloud or run on premises. Web applications with 24x7 workload load, stateful services that need to keep the connection open for long periods of time. Can be used to run microservices or monolithic applications. Ideal for microservices applications. Traditional enterprise applications that are migrated from on premises to the cloud. Ideal for monolithic applications. 
 Charging granularity and billing [Per blocks of 100 milliseconds](https://cloud.ibm.com/functions/learn/pricing) Depends on implementation - If IaaS or CaaS are used, then similar considerations apply - See columns (4) and (5). Usually charged per hour (rarely per minute) for bundle of resources (CPU + memory + some disk space). Similar to column (3).
Always On availability groups are leveraged in the Dual AZ and the Dual MZR deployment patterns. SQL Server Always On availability groups support both synchronous and asynchronous commit modes:



* Synchronous - The primary replica commits database transactions after the changes are committed, or written to the log of the secondary replica. Using this mode, you can perform planned manual failover and automatic failover if the replicas synchronized. This mode is best suited for instances in the same AZ or MZR.
* Asynchronous - The primary replica commits database transactions without waiting for the secondary replica, therefore, this modes is better suited for instances in different MZRs, or between an AZ and on-premise.



* Log shipping - Log shipping automatically sends transaction log backups from a primary database instance to one or more secondary databases instances. To enable log shipping, SQL Server Agent jobs are used to automate the process of backing up, copying, and applying the transaction log backups. Log shipping provides high availability by allowing secondary instances to be manually promoted if the primary instance fails. The secondary instances can also be used as read only copies of the primary instances to reduce load on the primary instance if needed. This guide does not discuss log shipping, however, this can be configured on IBM Cloud VPC if required.
* Database mirroring - Database mirroring creates a read-only copy of the primary database on a separate instance. Microsoft plans to remove support of database mirroring in future versions of SQL Server, therefore, investigate the usage of Always On availability groups. This guide does not discuss database mirroring.
* Always On Failover Cluster Instances - SQL Server Always On Failover Cluster Instances (FCIs) use Windows Server Failover Clustering (WSFC) to provide high availability at the server instance level. An FCI is a single instance of SQL Server, deployed across WSFC nodes. FCIs require shared storage that all WSFC nodes can access. This guide does not discuss Always On Failover Cluster Instances.







 About Microsoft storage spaces 

The Microsoft SQL on VPC deployment patterns leverage Microsoft Storage Spaces. Storage Spaces is a technology in Windows Server that is conceptually similar to RAID, and is implemented in the operating system.
For example, to use two dedicated cores per member, use "members_cpu_allocation_count":"2". If omitted, the default value "Shared CPU" uses compute resources on shared hosts.
* service-endpoints - The [Service Endpoints](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-service-endpoints) supported on your deployment, public or private. A MongoDB deployment cannot have both public and private endpoints simultaneously. This parameter cannot be changed after provisioning.

In the CLI, service-endpoints is a flag, not a parameter.







 Provisioning with Terraform 

Use Terraform to manage your infrastructure through the [ibm_database Resource for Terraform](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/database) supports provisioning Cloud Databases deployments.
For orchestration of larger packages that you want to run in your Kubernetes clusters, consider using a package manager such as [Helm](https://helm.sh/).







 What about serverless apps? 

You can run serverless apps and jobs through the [IBM Cloud Code Engine](https://cloud.ibm.com/docs/codeengine?topic=codeengine-getting-started) service. Code Engine can also build your images for you. Code Engine is designed so that you don't need to interact with the underlying technology it is built upon. However, if you have existing tooling that is based upon Kubernetes or Knative, you can still use it with Code Engine. For more information, see [Using Kubernetes to interact with your application](https://cloud.ibm.com/docs/codeengine?topic=codeengine-kubernetes).





 I already have an app. How can I migrate it to IBM Cloud Kubernetes Service? 

You can take some general steps to containerize your app as follows.



1. Use the [Twelve-Factor App](https://12factor.net/) as a guide for isolating dependencies, separating processes into separate services, and reducing the statefulness of your app as much as possible.
2. Find an appropriate base image to use. You can use publicly available images from [Docker Hub](https://hub.docker.com/), [public IBM images](https://cloud.ibm.com/docs/Registry?topic=Registry-public_imagespublic_images), or build and manage your own in your private IBM Cloud Container Registry.
3. Add to your Docker image only what is necessary to run the app.
4. Instead of relying on local storage, plan to use persistent storage or cloud database-as-a-service solutions to back up your app's data.
5. Over time, refactor your app processes into microservices.



For more, see the following tutorials.
Based on the target utilization metrics that you define, the instance group can dynamically add or remove instances to achieve your specified instance availability.



 Manual scaling 



1. To check static scaling method, navigate to the Settings tab of your Schematics workspace to see that the step3_is_dynamic variable is set to false.
2. Update the step3_instance_count variable to 2 and Save the setting.
3. Apply the plan to see the additional two instances (one frontend VSI and one backend VSI) provisioned.
4. Under Memberships tab of your frontend [instance group](https://cloud.ibm.com/vpc-ext/autoscale/groups), you should now see 2 instances.
5. Navigate to the browser showing the frontend app and either click on the Refresh button or submit a new balance multiple times to see the details of the frontend VSI and backend VSI serving the request. You should see two of the four VSIs serving your request.



You can check the logs and monitor your load balancers later in the tutorial.





 Automatic scaling 



1. To switch to dynamic scaling method, set the step3_is_dynamic variable to true, Save the setting and Apply the plan. This setting adds an instance group manager and an instance group manager policy to the existing instance group thus switching the instance group scaling method from static to dynamic.

Zoom

![Scale instances](https://cloud.ibm.com/docs-content/v1/content/f84e2238288b7f0355715a4c355609ce7ac48fb0/solution-tutorials/images/solution62-vpc-scaling-dedicated/autoscale.svg)

Scale instances
2. To check the autoscaling capabilities, you can use a load generator to generate load against your application.



1. Navigate to the [load generator URL](https://load.fun.cloud.ibm.com/).This load generator will simulate about 300 clients hitting the frontend API for 30 seconds.
2.
FAQs: Dedicated hosts and instances 



 What is a dedicated host? 

IBM Cloud® dedicated hosts are physical servers that are committed to a group of users. Dedicated hosts offer virtual server provisioning capacity and maximum placement control.





 What are the benefits of using dedicated hosts over dedicated instances? 

Both offerings are guaranteed single tenancy. Dedicated hosts provide the flexibility to specify on which host to provision dedicated host instances, and these other benefits:



* Control over which IBM Cloud data center the server is placed
* Ability to manage your servers as workload requirements change; for example, migrate virtual servers between your dedicated hosts on the same POD







 Can I keep my existing dedicated instances or do I need to set up a dedicated host and dedicated host instances? 

Yes, you can keep your existing dedicated instances.





 Can I interchange provisioning of dedicated instances (auto–assigned) and dedicated host instances? 

No. Existing auto-assigned dedicated instances cannot be reprovisioned on dedicated hosts. If you require virtual server placement, you need to provision them on dedicated hosts as dedicated host instances.





 What type of server, virtual or bare metal, supports the dedicated host offering? 

The offering is supported on virtual servers; IBM Cloud does have a bare metal offering. The differences between virtual hosts and bare metal servers are the time to provision and virtualization management.





 What is the provisioning lifecycle of a dedicated host? 

Dedicated hosts are allocated to users when provisioned. They persist to the account until it is reclaimed. Dedicated hosts are offered in only on-demand pricing, hourly or monthly, so when reclaimed, billing models charge as either hourly or monthly IBM Cloud offerings.





 How is the dedicated host offering billed? 

You can purchase dedicated hosts on-demand with hourly or monthly billing. Hourly only hosts allow only hourly instances to be provisioned; monthly only hosts allow provisioning of monthly and hourly instances. Pricing for dedicated hosts includes core, RAM, local SSD storage, and network port speeds. Premium operating systems, storage area network (SAN) storage, and software add-on prices and licensing are charged based on the instance deployed—hourly or monthly—on the dedicated host. The same pricing model as IBM Cloud public and dedicated instances is followed for these items.
Creating instances for a high availability cluster on IBM® Power® Systems Virtual Server 

Use the following information and procedures to help you create Power Systems Virtual Server instances that are needed for a high availability cluster implementation.



 Overview 

You can find the following information in the proceeding sections.



* [Creating the Power Systems Virtual Server workspace in IBM Cloud®](https://cloud.ibm.com/docs/sap?topic=sap-ha-vsiha-vsi-create-workspace) After the workspace is created, you can create and configure virtual server instances, network resources, and storage volumes.
* [Creating a Service ID API Key in IBM Cloud®](https://cloud.ibm.com/docs/sap?topic=sap-ha-vsiha-vsi-create-service-id) For monitoring and management, the fencing agent authenticates to the Power Systems Virtual Server API by using the Service API key.







 Prerequisites 



* An [IBM Cloud®account](https://cloud.ibm.com/docs/account?topic=account-account-getting-started).
* [Setting up an enterprise account](https://cloud.ibm.com/docs/account?topic=account-enterprise-tutorial) guides you creating an enterprise and managing your account.







 Creating the workspace 

A workspace is the environment that acts as folder for all the Power Systems Virtual Server resources in a specific geographic region. These resources include computing, network, and storage volumes. Resources cannot be moved or shared between different workspaces. Each workspace is tied to a single data center.

Log in into [Power Systems Virtual Server](https://cloud.ibm.com/power/overview) in IBM Cloud®.



1. Select Workspaces in the navigation bar and press Create to open the Create workspace menu.
2. Enter the Workspace name and select a Resource group according to the intended assignment of the cluster resources.
3. Select the Region where you want the resources to deploy.
4. Add any User tags and Access management tags according to your policies.
5. Click Create to initiate the workspace.







 Creating subnets
The source server does need some free space to do an image capture of the server. In addition, RMM does require SSH (port 22) reachability to both server and target to perform the migration. The CPU consumption for image capture and copying to the target is minimal.
* Can RackWare RMM create the target virtual server instance?

Yes. With RMM Auto-Provision feature, you can create the target virtual server instance. For more information, see ["Bare metal to virtual server migration on a private network with RMM": option 2 of Step 1: Set up and provision VPC and virtual server instance](https://cloud.ibm.com/docs/cloud-infrastructure?topic=cloud-infrastructure-pv-migration-private-networkset-up-provision-vpc-vsi).



Cloud Shell



* What type of shell does Cloud Shell use?

IBM Cloud Shell uses a Red Hat® Linux® bash shell.
* What tools and plug-ins are included in Cloud Shell?

IBM Cloud Shell includes all available IBM Cloud CLI plug-ins and dozens of tools, packages, and runtimes. For the full list, see [Installed plug-ins and tools](https://cloud.ibm.com/docs/cloud-shell?topic=cloud-shell-plugins-tools).
* What browsers does Cloud Shell support?

To work in Cloud Shell, you need to use one of the IBM Cloud supported browsers. For more information, see [What are the IBM Cloud prerequisites?](https://cloud.ibm.com/docs/overview?topic=overview-prereqs-platform). If you use a browser that is not supported, you might see blank screens or other display problems when you use Cloud Shell.
* How do I copy and paste text in Cloud Shell?

To copy text in Cloud Shell, select the text that you want to copy, and then do one of the following:



* In your browser menu, click Edit, and then click Copy or Paste.
* For macOS, use the keyboard shortcuts Cmd+C and Cmd+V.
* ibmcloud is bare-metal-server-create --name my-server-name --zone us-east-1 --profile bmx2d-24x384 --image ibm-esxi-7-byol-amd64-1 --keys my-sshkey-1,my-sshkey-2 --pnic-subnet my-subnet Create a bare metal server with name support for image, keys and subnet
* ibmcloud is bare-metal-server-create --name my-server-name2 --zone us-east-1 --profile bmx2d-24x384 --image cfdaf1a0-5350-4350-fcbc-97173b510844 --keys 7ab1ee27-564c-4730-a1ad-9b9466589250,9727e31a-74d4-45cd-8f39-1ef7484b5f3e --pnic-subnet bdea9c01-ada2-46ba-a314-4b3240477a5f --pnic-name eth0 --pnic-rip-address 46.9.49.11 --pnic-sgs c791f26f-4cf1-4bbf-be0e-72d7cb87133e,fefc8362-93c2-4f3d-90d4-82c56cce787e --pnic-allowed-vlans 1,2,3,4 --pnic-ein true --pnic-ais true Create a bare metal server with specified primary network interface configuration.
What's the maximum number of compute instances I can associate with my load balancer? 

While trying to create a load balancer service, you can configure up to 10 compute instances as back-end servers. You can define additional servers after the load balancer is created. The maximum number of back-end members allowed is 50.





 Can my back-end compute instances sit on a subnet different from the load balancer's subnet? 

Yes, the load balancer and the compute instances that are connected to the load balancer can be in different subnets, but VLAN spanning must be enabled for the load balancer to communicate and forward requests to the compute instance. For more information, see [VLAN spanning](https://cloud.ibm.com/docs/vlans?topic=vlans-vlan-spanning).





 What are the default settings and allowed values for various health check options? 

The default settings and allowed values are as follows.



* Health check interval - Default is 5 seconds, range is 2 – 60 seconds
* Health check response timeout - Default is 2 seconds, range is 1 – 59 seconds
* Max retry attempts - Default is two retry attempts, and the range is 1 - 10 retries



The health check response timeout value must always be less than the health check interval value.





 Can I use compute instances residing in remote data centers with this service? 

It is recommended that your load balancer service and your compute instances reside locally within the same data center. The load balancer service’s UI does not show compute instances from other remote data centers. However, the UI includes compute instances from other data centers within the same city (for example, data centers whose names share the first three letters, such as DALxx). You can use the API interface to add compute instances from any remote data center.





 Which TLS version is supported by SSL offload? 

The IBM Cloud Load Balancer service supports TLS 1.2 with SSL termination.

The following list details the supported ciphers (listed in order of precedence):



* ECDHE-RSA-AES256-GCM-SHA384
* ECDHE-RSA-AES256-SHA384