Skip to content

need to identify "Ephemeral" / Temporary disks #77

@smoser

Description

@smoser

Ephemeral disks (aka Temporary or Resource Disks) are typically local disks to a cloud instance. They have lower reliability than other disks. users of disko would like to be able to know if a disk is Ephemeral so they can make decisions on how to use it.

Attached is an example diff I came up with that adds Properties to the Disk. One of the properties is 'Ephemeral'. ephemeral-as-properties.diff.txt.

@tych0 suggested that I just add an 'IsEphemeral()' method on the Disk type. The thing I didn't like about that was that the implementation supporting Azure looked like below, which was very linux specific, but the Disk is (ignoring UdevInfo) not linux-specific.

// IsEphemeral - is this an Ephemeral Disk (aka Resource or Temporary Disk or Instance Store)
func (d *Disk) IsEphemeral() bool {
        rx := regexp.MustCompile(`.*/VMBUS:\d\d/00000000-0001-\d{4}-\d{4}-\d{12}/host.*`)
        return rx.MatchString(d.UdevInfo.SysPath)
}

Second, when I looked at support EC2 (#76) a IsEphemeral implementation would be EC2 and linux specific and require hitting the HTTP metadata service.

My feeling was to instead just add Properties or something to that effect that would be correctly populated in Scan() and then not have to deal with a cache. Unfortunately as it is right now, I don't know what other kinds of Properties I'd have.

IsEphemeral would just look like:

func (d *Disk) IsEphemeral() bool {
    for _, p := range(d.Properties) {
        if p == Ephemeral { return true ; }
    }
    return false
}

I decided to write things down (in this issue) for the moment and table it until the IsEphemeral is actually requested.

Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions