rexray

package module
v0.1.150418 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

README

RexRay

Overview

RexRay is a Go package for guest storage introspection that is meant to provide visibility and management of external/underlying storage that is attached via methods specified in drivers. This storage can be from a specific storage platform in addition to being provided by virtual infrastructure.

The driver to be used is automatically detected or hints can be provided. Drivers are then intialized to retrieve guest identifiers and further information from other platforms that are relevant to storage management.

State

Currently it has view only capabilities. Working on more drivers, and actual management capabilities.

Features

  • Visibility
  • Management
  • Disk Provision
  • Disk Snapshot/Unsnapshot
  • Disk Attach/Detach

Environment Variables

REXRAY_DEBUG - show debug messages
REXRAY_STORAGEDRIVERS - only do checks using these drivers
AWS_ACCESS_KEY - (AWS)
AWS_SECRET_KEY - (AWS)
OS_AUTH_URL - (RACKSPACE)
OS_USERNAME - (RACKSPACE)
OS_PASSWORD - (RACKSPACE)

Storage Drivers - Examples

  • AWS
  • RackSpace
  • ..more to come

Storage Driver - Interface

These represent the methods that should be available from storage drivers.

type Driver interface {
  GetBlockDeviceMapping() (interface{}, error)
	GetInstance() (interface{}, error)
	GetVolume(string, string) (interface{}, error)
	GetVolumeAttach(string, string) (interface{}, error)
	GetSnapshot(string, string, string) (interface{}, error)
	CreateSnapshot(bool, string, string, string) (interface{}, error)
	RemoveSnapshot(string) error
	CreateVolume(bool, string, string, string, string, int64, int64) (interface{}, error)
	RemoveVolume(string) error
	GetDeviceNextAvailable() (string, error)
	AttachVolume(bool, string, string) (interface{}, error)
	DetachVolume(bool, string, string) error
}
Get all block devices

The following examples assumes that you have passed proper environment variables based on the guest instance.

Get Local Instance
instance, err := driver.GetInstance()
if err != nil {
  log.Fatalf("Error: %s", err)
}
Get All Block Devices
allBlockDevices, err := rexray.GetBlockDeviceMapping()
if err != nil {
  log.Fatalf("Error: %s", err)
}

Licensing

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Support

Please file bugs and issues at the Github issues page. For more general discussions you can contact the EMC Code team at Google Groups or tagged with EMC on Stackoverflow.com. The code and documentation are released with no warranties or SLAs and are intended to be supported through a community driven process.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDriverBlockDeviceDiscovery = errors.New("Driver Block Device discovery failed")
	ErrDriverInstanceDiscovery    = errors.New("Driver Instance discovery failed")
	ErrDriverVolumeDiscovery      = errors.New("Driver Volume discovery failed")
	ErrDriverSnapshotDiscovery    = errors.New("Driver Snapshot discovery failed")
	ErrMultipleDriversDetected    = errors.New("Multiple drivers detected, must declare with driver with env of REXRAY_STORAGEDRIVER=")
)

Functions

func AttachVolume

func AttachVolume(runAsync bool, volumeID string, instanceID string) ([]*storagedriver.VolumeAttachment, error)

func CreateSnapshot

func CreateSnapshot(runAsync bool, snapshotName, volumeID, description string) ([]*storagedriver.Snapshot, error)

func CreateVolume

func CreateVolume(runAsync bool, volumeName string, volumeID, snapshotID string, volumeType string, IOPS int64, size int64) (*storagedriver.Volume, error)

func DetachVolume

func DetachVolume(runAsync bool, volumeID string, instanceID string) error

func GetBlockDeviceMapping

func GetBlockDeviceMapping() ([]*storagedriver.BlockDevice, error)

GetBlockDeviceMapping performs storage introspection and returns a listing of block devices from the guest

func GetInstance

func GetInstance() ([]*storagedriver.Instance, error)

func GetSnapshot

func GetSnapshot(volumeID, snapshotID, snapshotName string) ([]*storagedriver.Snapshot, error)

func GetVolume

func GetVolume(volumeID, volumeName string) ([]*storagedriver.Volume, error)

func RemoveSnapshot

func RemoveSnapshot(snapshotID string) error

func RemoveVolume

func RemoveVolume(volumeID string) error

Types

This section is empty.

Directories

Path Synopsis
ec2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL