 Diego ensures the correct number of instances are running in Diego cells by attempting to keep the correct number of instances running. This is done to avoid network failures and crashes.
\nTAS for VMs uses the Tanzu Platform for Cloud Foundry to manage app containers. Tanzu Platform for Cloud Foundry components assume app scheduling and management responsibility from the Cloud Controller.
Tanzu Platform for Cloud Foundry is a self-healing container management system that attempts to keep the correct number of instances running in Diego cells to avoid network failures and crashes. Tanzu Platform for Cloud Foundry schedules and runs Tasks and Long-Running Processes (LRP). For more information about Tasks and LRPs, see How the Tanzu Platform for Cloud Foundry Auction Allocates Jobs.
You can submit, update, and retrieve the desired number of Tasks and LRPs using the Bulletin Board System (BBS) API. For more information, see the BBS Server repository on GitHub.
Learning how Tanzu Platform for Cloud Foundry runs an app
The following sections describe how Tanzu Platform for Cloud Foundry handles a request to run an app. This is only one of the processes that happen in Tanzu Platform for Cloud Foundry. For example, running an app assumes the app has already been staged.
For more information about the staging process, see How Apps are Staged.
The following illustrations and descriptions do not include all of the components of Tanzu Platform for Cloud Foundry. For information about each component, see Tanzu Platform for Cloud Foundry Components.
The architecture discussed in the following steps includes the following high level blocks:
* api - cloud_controller_ng
* scheduler - auctioneer
* tanzu-api - bbs
* pxc-mysql - bbs db
* tanzu-cell - rep/executor, garden, loggregator-agent, route-emitter
* singleton-blobstore - droplets
* doppler - doppler
* log-api - traffic-controller
* gorouter - gorouter
Note
The images below are based on the VM names in an open-source deployment of Cloud Foundry Application Runtime. In TAS for VMs, the processes interact in the same way, but are on different VMs. Correct VM names for each process are in the components sections of this topic.
Step 
<|system|>\nYou are a copywriter. Assume that Pivotal Cloud Foundry and Tanzu Platform for Cloud Foundry are the same. Replace all references to Pivotal Cloud Foundry with Tanzu Platform for Cloud Foundry. Using this context,  Diego ensures the correct number of instances are running in Diego cells by attempting to keep the correct number of instances running. This is done to avoid network failures and crashes.<|end|>\n<|user|>\nTAS for VMs uses the Diego system to manage app containers. Diego components assume app scheduling and management responsibility from the Cloud Controller.
Diego is a self-healing container management system that attempts to keep the correct number of instances running in Diego cells to avoid network failures and crashes. Diego schedules and runs Tasks and Long-Running Processes (LRP). For more information about Tasks and LRPs, see How the Diego Auction Allocates Jobs.
You can submit, update, and retrieve the desired number of Tasks and LRPs using the Bulletin Board System (BBS) API. For more information, see the BBS Server repository on GitHub.
Learning how Diego runs an app
The following sections describe how Diego handles a request to run an app. This is only one of the processes that happen in Diego. For example, running an app assumes the app has already been staged.
For more information about the staging process, see How Apps are Staged.
The following illustrations and descriptions do not include all of the components of Diego. For information about each Diego component, see Diego Components.
The architecture discussed in the following steps includes the following high level blocks:
* api - cloud_controller_ng
* scheduler - auctioneer
* diego-api - bbs
* pxc-mysql - bbs db
* diego-cell - rep/executor, garden, loggregator-agent, route-emitter
* singleton-blobstore - droplets
* doppler - doppler
* log-api - traffic-controller
* gorouter - gorouter
Note
The images below are based on the VM names in an open-source deployment of Cloud Foundry Application Runtime. In TAS for VMs, the processes interact in the same way, but are on different VMs. Correct VM names for each process are in the components sections of this topic.
Step 1: Receiving the request to run an app
Cloud Controller passes requests to run apps to the Diego BBS, which stores information about the request in its database.

Step 2: Passing the request to the auctioneer process
The BBS contacts the Auctioneer to create an auction based on the desired resources for the app. It references the information stored in its database.

Step 3: Performing the auction
Through an auction, the Auctioneer finds a Diego Cell to run the app on. The Rep job on the Diego Cell accepts the auction request.

Step 4: Creating the container and running the app
The in process Executor creates a Garden container in the Diego Cell. Garden downloads the droplet that resulted from the staging process and runs the app in the container.

Step 5: Emitting a route for the app
The route-emitter process emits a route registration message to Gorouter for the new app running on the Diego Cell.

Step 6: Sending logs to the Loggregator
Loggregator agent forwards app logs, errors, and metrics to the TAS for VMs Loggregator.
For more information, see App Logging in TAS for VMs.

Diego components
The following table describes the jobs that are part of the TAS for VMs Diego BOSH release.

Job:
auctioneer
VM:
diego_brain
Function:
•	Distributes work through auction to Cell Reps over SSL/TLS. For more information, see How the Diego Auction Allocates Jobs.
	•	Maintains a lock in Locket to ensure only one auctioneer handles auctions at a time.

Job:
bbs
VM:
diego_database
Function: 
•	Maintains a real-time representation of the state of the Diego cluster, including desired LRPs, running LRPs, and in-flight Tasks.
	•	Provides an RPC-style API over HTTP to Diego Core components for external clients as well as internal clients, including the SSH Proxy and Route Emitter.
	•	Ensures consistency and fault tolerance for Tasks and LRPs by comparing desired state with actual state.
	•	Keeps DesiredLRP and ActualLRP counts synchronized. If the DesiredLRP count exceeds the ActualLRP count, requests a start auction from the Auctioneer. If the ActualLRP count exceeds the DesiredLRP count, sends a stop message to the Rep on the Diego Cell hosting an instance\n<|end|>\n<|copywriter|>\n\nTAS for VMs uses the Tanzu Platform for Cloud Foundry to manage app containers. Tanzu Platform for Cloud Foundry components assume app scheduling and management responsibility from the Cloud Controller.
Tanzu Platform for Cloud Foundry is a self-healing container management system that attempts to keep the correct number of instances running in Diego cells to avoid network failures and crashes. Tanzu Platform for Cloud Foundry schedules and runs Tasks and Long-Running Processes (LRP). For more information about Tasks and LRPs, see How the Tanzu Platform for Cloud Foundry Auction Allocates Jobs.
You can submit, update, and retrieve the desired number of Tasks and LRPs using the Bulletin Board System (BBS) API. For more information, see the BBS Server repository on GitHub.
Learning how Tanzu Platform for Cloud Foundry runs an app
The following sections describe how Tanzu Platform for Cloud Foundry handles a request to run an app. This is only one of the processes that happen in Tanzu Platform for Cloud Foundry. For example, running an app assumes the app has already been staged.
For more information about the staging process, see How Apps are Staged.
The following illustrations and descriptions do not include all of the components of Tanzu Platform for Cloud Foundry. For information about each component, see Tanzu Platform for Cloud Foundry Components.
The architecture discussed in the following steps includes the following high level blocks:
* api - cloud_controller_ng
* scheduler - auctioneer
* tanzu-api - bbs
* pxc-mysql - bbs db
* tanzu-cell - rep/executor, garden, loggregator-agent, route-emitter
* singleton-blobstore - droplets
* doppler - doppler
* log-api - traffic-controller
* gorouter - gorouter
Note
The images below are based on the VM names in an open-source deployment of Cloud Foundry Application Runtime. In TAS for VMs, the processes interact in the same way, but are on different VMs. Correct VM names for each process are in the components sections of this topic.
Step 