You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
So perhaps Disk should be an interface, instead of a struct? Then you can have a LinuxDisk, which has all this stuff, and the interface would just specify IsEphemeral() (bool, error), and return an error in the non-linux case.
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.
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:
I decided to write things down (in this issue) for the moment and table it until the IsEphemeral is actually requested.
Links:
The text was updated successfully, but these errors were encountered: