github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/storage/blockdevice.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package storage
     5  
     6  // BlockDevice describes a block device discovered on a machine.
     7  type BlockDevice struct {
     8  	// DeviceName is the block device's OS-specific name (e.g. "sdb").
     9  	DeviceName string `yaml:"devicename,omitempty"`
    10  
    11  	// DeviceLinks is a collection of symlinks to the block device
    12  	// that the OS maintains (e.g. "/dev/disk/by-id/..."). Storage
    13  	// provisioners can match volume attachments to device links if
    14  	// they know ahead of time how the OS will name them.
    15  	DeviceLinks []string `yaml:"devicelinks,omitempty"`
    16  
    17  	// Label is the label for the filesystem on the block device.
    18  	//
    19  	// This will be empty if the block device does not have a filesystem,
    20  	// or if the filesystem is not yet known to Juju.
    21  	Label string `yaml:"label,omitempty"`
    22  
    23  	// UUID is a unique identifier for the filesystem on the block device.
    24  	//
    25  	// This will be empty if the block device does not have a filesystem,
    26  	// or if the filesystem is not yet known to Juju.
    27  	//
    28  	// The UUID format is not necessarily uniform; for example, LVM UUIDs
    29  	// differ in format to the standard v4 UUIDs.
    30  	UUID string `yaml:"uuid,omitempty"`
    31  
    32  	// HardwareId is the block device's hardware ID, which is composed of
    33  	// a serial number, vendor and model name. Not all block devices have
    34  	// these properties, so HardwareId may be empty. This is used to identify
    35  	// a block device if it is available, in preference to UUID or device
    36  	// name, as the hardware ID is immutable.
    37  	HardwareId string `yaml:"hardwareid,omitempty"`
    38  
    39  	// BusAddress is the bus address: where the block device is attached
    40  	// to the machine. This is currently only populated for disks attached
    41  	// to the SCSI bus.
    42  	//
    43  	// The format for this is <bus>@<bus-specific-address> as according to
    44  	// "lshw -businfo". For example, for a SCSI disk with Host=1, Bus=2,
    45  	// Target=3, Lun=4, we populate this field with "scsi@1:2.3.4".
    46  	BusAddress string `yaml:"busaddress,omitempty"`
    47  
    48  	// Size is the size of the block device, in MiB.
    49  	Size uint64 `yaml:"size"`
    50  
    51  	// FilesystemType is the type of the filesystem present on the block
    52  	// device, if any.
    53  	FilesystemType string `yaml:"fstype,omitempty"`
    54  
    55  	// InUse indicates that the block device is in use (e.g. mounted).
    56  	InUse bool `yaml:"inuse"`
    57  
    58  	// MountPoint is the path at which the block devices is mounted.
    59  	MountPoint string `yaml:"mountpoint,omitempty"`
    60  }