Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type DeviceManager ¶
type DeviceManager interface { // NewDevice retrieves the device if the device is already assigned. // Otherwise it creates a new device with next available device name // and mark it as unassigned device. NewDevice(instance *types.Instance, volumeID string, likelyBadNames map[string]struct{}) (device *Device, err error) // GetDevice returns the device already assigned to the volume. GetDevice(instance *types.Instance, volumeID string) (device *Device, err error) }
func NewDeviceManager ¶
func NewDeviceManager() DeviceManager
type ExistingNames ¶
ExistingNames is a map of assigned device names. Presence of a key with a device name in the map means that the device is allocated. Value is irrelevant and can be used for anything that NameAllocator user wants.
type NameAllocator ¶
type NameAllocator interface {
GetNext(existingNames ExistingNames, likelyBadNames map[string]struct{}) (name string, err error)
}
On AWS, we should assign new (not yet used) device names to attached volumes. If we reuse a previously used name, we may get the volume "attaching" forever, see https://aws.amazon.com/premiumsupport/knowledge-center/ebs-stuck-attaching/. NameAllocator finds available device name, taking into account already assigned device names from ExistingNames map. It tries to find the next device name to the previously assigned one (from previous NameAllocator call), so all available device names are used eventually and it minimizes device name reuse.