package disk

import "github.com/vmware/govmomi/cli/disk"

Index

Types

type Manager

type Manager struct {
	Client              *vim25.Client
	Datastore           *object.Datastore
	ObjectManager       *vslm.ObjectManager
	GlobalObjectManager *vslm.GlobalObjectManager
}

Manager provides a layer for switching between Virtual Storage Object Manager (VSOM) and Virtual Storage Lifecycle Manager (VSLM). The majority of VSOM methods require a Datastore param, and most VSLM methods do not as it uses the "Global Catalog". VSOM was introduced in vSphere 6.5 (11/2016) and VSLM in vSphere 6.7 U2 (04/2019). The govc disk commands were introduced prior to 6.7 U2 and continue to use VSOM when an optional Datastore (-ds flag) is provided. Otherwise, VSLM global methods are used when a Datastore is not specified. Also note that VSOM methods can be used when connected directly to an ESX hosts, but VSLM global methods require vCenter. A disk managed by these methods are also known as a "First Class Disk" (FCD).

func NewManager

func NewManager(ctx context.Context, c *vim25.Client, ds *object.Datastore) (*Manager, error)

func NewManagerFromFlag

func NewManagerFromFlag(ctx context.Context, cmd *flags.DatastoreFlag) (*Manager, error)

func (*Manager) AttachDisk

func (m *Manager) AttachDisk(ctx context.Context, vm *object.VirtualMachine, id string) error

func (*Manager) AttachTag

func (m *Manager) AttachTag(ctx context.Context, id string, tag types.VslmTagEntry) error

func (*Manager) CreateDisk

func (m *Manager) CreateDisk(ctx context.Context, spec types.VslmCreateSpec) (*types.VStorageObject, error)

func (*Manager) CreateSnapshot

func (m *Manager) CreateSnapshot(ctx context.Context, id, desc string) (types.ID, error)

func (*Manager) Delete

func (m *Manager) Delete(ctx context.Context, id string) error

func (*Manager) DeleteSnapshot

func (m *Manager) DeleteSnapshot(ctx context.Context, id, sid string) error

func (*Manager) DetachTag

func (m *Manager) DetachTag(ctx context.Context, id string, tag types.VslmTagEntry) error

func (*Manager) List

func (*Manager) ListAttachedObjects

func (m *Manager) ListAttachedObjects(ctx context.Context, category, tag string) ([]types.ID, error)

func (*Manager) ListAttachedTags

func (m *Manager) ListAttachedTags(ctx context.Context, id string) ([]types.VslmTagEntry, error)

func (*Manager) ReconcileDatastoreInventory

func (m *Manager) ReconcileDatastoreInventory(ctx context.Context) error

func (*Manager) RegisterDisk

func (m *Manager) RegisterDisk(ctx context.Context, path, name string) (*types.VStorageObject, error)

func (*Manager) Retrieve

func (m *Manager) Retrieve(ctx context.Context, id string) (*types.VStorageObject, error)

func (*Manager) RetrieveSnapshotInfo

type VStorageObject

type VStorageObject struct {
	types.VStorageObject
	Tags []types.VslmTagEntry `json:"tags"`
}

Source Files

attach.go create.go detach.go ls.go manager.go register.go rm.go tags.go

Directories

PathSynopsis
cli/disk/metadata
cli/disk/snapshot
Version
v0.48.1 (latest)
Published
Feb 11, 2025
Platform
linux/amd64
Imports
20 packages
Last checked
2 months ago

Tools for package owners.