containers they implement. Hypothetically, you could implement other types of
tasks such as virtual machine tasks or non-containerized process tasks. The
scheduler and orchestrator are agnostic about the type of the task. However, the
current version of Docker only supports container tasks.
The diagram below shows how Swarm mode accepts service create requests and
schedules tasks to worker nodes.

### Pending services
A service may be configured in such a way that no node currently in the
swarm can run its tasks. In this case, the service remains in state `pending`.
Here are a few examples of when a service might remain in state `pending`.
> [!TIP]
> If your only intention is to prevent a service from
> being deployed, scale the service to 0 instead of trying to configure it in
> such a way that it remains in `pending`.
- If all nodes are paused or drained, and you create a service, it is
pending until a node becomes available. In reality, the first node to become
available gets all of the tasks, so this is not a good thing to do in a
production environment.
- You can reserve a specific amount of memory for a service. If no node in the
swarm has the required amount of memory, the service remains in a pending
state until a node is available which can run its tasks. If you specify a very
large value, such as 500 GB, the task stays pending forever, unless you
really have a node which can satisfy it.
- You can impose placement constraints on the service, and the constraints may
not be able to be honored at a given time.
This behavior illustrates that the requirements and configuration of your tasks
are not tightly tied to the current state of the swarm. As the administrator of
a swarm, you declare the desired state of your swarm, and the manager works with
the nodes in the swarm to create that state. You do not need to micro-manage the
tasks on the swarm.
## Replicated and global services
There are two types of service deployments, replicated and global.
For a replicated service, you specify the number of identical tasks you want to
run. For example, you decide to deploy an HTTP service with three replicas, each
serving the same content.
A global service is a service that runs one task on every node. There is no
pre-specified number of tasks. Each time you add a node to the swarm, the
orchestrator creates a task and the scheduler assigns the task to the new node.
Good candidates for global services are monitoring agents, anti-virus scanners
or other types of containers that you want to run on every node in the swarm.
The diagram below shows a three-service replica in gray and a global service
in black.

## Learn more
* Read about how Swarm mode [nodes](nodes.md) work.
* Learn how [PKI](pki.md) works in Swarm mode.