Hot plugging is the addition of a component to a running computer system without significant interruption to the operation of the system. Hot plugging a device does not require a restart of the system. This is especially useful for systems that must always stay running, such as a server.
Common examples of hot-pluggable devices include hard disk drives (HDDs) or solid-state drives (SSDs) which can be added to a storage system; or USB (Universal Serial Bus) devices, mice, keyboards or printers that can be added to a personal computer.
Hot plugging is not the same as hot swapping a component into a running computer system. Hot swapping involves the replacement of a component. Hot plugging is the addition or removal of a component that serves to expand the system.
The defining characteristic of hot plugging is that the system is not interrupted. The word hot refers to the fact that a machine is running and still hot when a device is being plugged in. The opposite of hot plugging is cold plugging, in which the device is interrupted or powered off.
How does hot plugging work?
Hot plugging may involve some administrative action on the part of the user. For example, if the user is plugging a new hard drive in, the system will require the user to mount it after installation. The removal of the hard drive likewise requires the user to eject it. Many devices are designed to be hot plugged without much thought to the mechanics of it on the part of the user, like HDMI (High-Defintion Multimedia Interface) cords and USBs. However, other larger-scale devices or less ubiquitous technologies require the user to know if it is hot-plug capable, as not every device is. For example, an integrated drive electronics (IDE) storage interface is not a hot-pluggable device, and has largely been replaced by serial advanced technology attachment (SATA) drives, which are.
To hot plug this safely, the device must be designed to protect against electric shocks that may occur from connecting two charged devices. To mitigate this, devices may have a staggered pin design at the point of connection, to ensure the circuit is connected in the right order. The receiving device may also have some sort of shield or covering plate to keep components from generating static when touching each other and, subsequently, shorting out. Without protection, electrical shock can damage the component, the computer, the user or all three. Additionally, a mechanism must be in place in the computer's operating system (OS) and the device to recognize the removal or addition of a device. This mechanism often takes the form of a driver.
Which devices can hot plug safely?
Any device that can be connected to a running computer and begin operating immediately is a device that can be hot plugged.
A common example device that can hot plug safely is one with a USB connection. A mouse, printer, portable hard drive and keyboard are all examples of devices, or peripherals, that use a USB connection and, therefore, can be hot plugged safely. A power supply can also usually be hot plugged into a computer system with no problems. Another common hot-pluggable connection is HDMI, which has a hot plug-detect mechanism to notify the other device that its being connected to. Other examples include FireWire and some SCSI (Small Computer Systems Interface) devices.
Many modern server and mainframe components can be hot plugged as well, such as peripheral component interconnect express (PCIe) and SATA drives.
Hot plugging vs. hot swapping
Hot plugging and hot swapping are often treated as interchangeable terms, but there is a difference. Hot plugging is the attachment of a system component while the system is running. Hot swapping is the replacement of a component while the computer is running. They are often mistakenly used for each other because they both refer to the addition or subtraction of removable media from uninterrupted systems -- in other words, adding or removing components to a computer without impacting its operation.
Hot swapping is more useful when a part breaks down and needs to be replaced to maintain a working system. Hot plugging is more useful for attaching expansions to a system, like a device that offers extra data storage, or linking to another attached computer system for the purpose of data synchronization.
Hot swapping may also refer to the practice of altering a program's running code without stopping the execution of the program. One example of this -- hot plugging in software -- is VMware's vSphere hot plug function, where the user can add memory or CPU (central processing unit) to their virtual machine (VM) by enabling the feature. CPU and memory are traditionally only cold-pluggable/swappable, but virtualization makes it possible through software.
Potential hot plugging issues
Problems can arise when hot plugging devices that were not designed for it. This can cause electrical issues, permanently damaging the component or injuring the user. Sometimes, devices that were designed to be hot plugged malfunction and users report hardware failure after hot plugging another component. As consumer technology advances, more products are designed to be hot plugged without a second thought, but using older technology with it can sometimes cause an unexpected reaction. Although this is reasonably unlikely, cold swapping is usually a safer option.