> For the complete documentation index, see [llms.txt](https://docs.duplocloud.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duplocloud.com/docs/automation-platform/overview-2/use-cases/hosts-vms/shared-hosts.md).

# Shared Hosts

Shared Hosts allow workloads to run on the same set of virtual machines (VMs), making better use of resources across multiple Tenants. DuploCloud supports Services, Jobs, and CronJobs on Shared Hosts in Azure, providing flexibility for running long-running services, batch jobs, and scheduled tasks.

DuploCloud supports Shared Hosts for:

* Services
* Jobs
* CronJobs

## Configuring Tenants to Allow Host Sharing

To enable Host sharing, configure one Tenant to share its Hosts, and another Tenant to run K8s Pods on any Host.

### **Enabling a Tenant to Share its Hosts**

1. In the DuploCloud Portal, go to **Administrator** → **Tenant**.
2. From the Tenant list box, select the Tenant that will share its Host.
3. Click the **Settings** tab.
4. Click **Add**. The **Add Tenant Feature** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fq9cX9NVMUQL9JkOWuD5W%2Fimage.png?alt=media&amp;token=be23fde6-59d8-4cb0-95e5-42fbcb43367c" alt="" width="455"><figcaption><p><strong>Add Tenant Feature</strong> pane</p></figcaption></figure></div>
5. From the **Select Feature** list, select **Allow hosts to run K8S pods from other tenants**.
6. Select **Enable**, then click **Add**. This Tenant's Hosts (Azure VMs) can now run Pods from other Tenants.

### **Enabling a Tenant to Run Pods on Shared Hosts**

1. In the DuploCloud Portal, go to **Administrator** → **Tenant**.
2. Select the Tenant that will run Pods on the shared Host.
3. Click the **Settings** tab.
4. Click **Add**. The **Add Tenant Feature** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FlgXqdzL1y1Rr2oRZMpLT%2Fimage.png?alt=media&amp;token=ed1fd174-fee1-495e-90b0-f4e7d807b9de" alt="" width="455"><figcaption><p><strong>Add Tenant Feature</strong> pane</p></figcaption></figure></div>
5. From the **Select Feature** list, select **Enable option to run K8S pods on any host**.
6. Select **Enable**, then click **Add**. This Tenant can now run Pods on other Tenant's Hosts.

## Creating Services, Jobs, and CronJobs on Shared Hosts

After configuring Tenant settings to allow Host sharing, create the resources you want to run on the Shared Hosts.

### **Creating a Service to Run on a Shared Host**

1. From the Tenant list, select the Tenant that will run Pods on the Shared Host.
2. Go to **Kubernetes → Services**.
3. Click **Add**. The **Add Service** page displays.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FZU6MUdOZruGmUOqduAkk%2FScreenshot%20(153).png?alt=media&amp;token=acf11c3f-8d96-4254-b4c9-ac406cb9186d" alt=""><figcaption><p>The <strong>Add Service</strong> page</p></figcaption></figure>
4. Fill in the **Service Name**, **Cloud**, **Platform**, and **Docker Image** fields. Click **Next**.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fw55l14oQgHi2yVrIlwp7%2FScreenshot%20(154).png?alt=media&amp;token=e0630bc8-b85b-47cd-92a8-bf9a91d0cac1" alt=""><figcaption><p>The <strong>Add Service</strong> <strong>Advanced Options</strong> page</p></figcaption></figure>
5. Enable **Run on Any Host**.
6. Click **Create**. A Service running on the shared Host is created.

### **Creating a Job or CronJob to Run on a Shared Host**

Before creating a Kubernetes Job or CronJob to run on a Shared Host, [configure Tenant settings to allow Host sharing](/docs/automation-platform/overview/use-cases/hosts-vms/adding-shared-hosts.md#configuring-tenants-to-allow-host-sharing).

Once Host sharing is enabled:

1. Follow the steps in the DuploCloud documentation to [create a Kubernetes Job](/docs/automation-platform/kubernetes-overview/jobs.md#creating-a-kubernetes-job-in-the-duplocloud-portal) or [create a Kubernetes CronJob](/docs/automation-platform/kubernetes-overview/cronjobs.md#creating-a-kubernetes-cronjob-in-the-duplocloud-portal).
2. On the **Add Kubernetes Job** or **Add Kubernetes CronJob** page, enable the **Run on Any Host** option.
3. Click **Create** to deploy the Job or CronJob on a Shared Host.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.duplocloud.com/docs/automation-platform/overview-2/use-cases/hosts-vms/shared-hosts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
