Documentation ¶
Overview ¶
Package migrate provides functionality to migrate servers that have been provisioned by the OpenStack Compute service.
Example of Migrate Server (migrate Action)
serverID := "b16ba811-199d-4ffd-8839-ba96c1185a67" err := migrate.Migrate(computeClient, serverID).ExtractErr() if err != nil { panic(err) }
Example of Live-Migrate Server (os-migrateLive Action)
serverID := "b16ba811-199d-4ffd-8839-ba96c1185a67" host := "01c0cadef72d47e28a672a76060d492c" blockMigration := false migrationOpts := migrate.LiveMigrateOpts{ Host: &host, BlockMigration: &blockMigration, } err := migrate.LiveMigrate(computeClient, serverID, migrationOpts).ExtractErr() if err != nil { panic(err) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List returns a Pager that allows you to iterate over a collection of Migrations.
Types ¶
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult is the response from a Delete operation. Call its ExtractErr to determine if the request succeeded or failed.
func Delete ¶
func Delete(client *gophercloud.ServiceClient, serverID, migrationID string) (r DeleteResult)
Delete deletes a migration action.
type ListOpts ¶
type ListOpts struct { // Limit is the amount of containers to retrieve. // New in version 2.59 Limit int `q:"limit"` // Marker The ID of the last-seen item. Use the limit parameter to make an initial limited request and use the // ID of the last-seen item from the response as the marker parameter value in a subsequent limited request. // New in version 2.59 Marker string `q:"marker"` // Hidden The ‘hidden’ setting of migration to filter. The ‘hidden’ flag is set if the value is 1. // The ‘hidden’ flag is not set if the value is 0. But the ‘hidden’ setting of migration is always 0, so this parameter is useless to filter migrations. Hidden int `q:"hidden"` // Host The source/destination compute node of migration to filter. Host string `q:"host"` // MigrationType The type of migration to filter. Valid values are: evacuation,live-migration, migration, resize MigrationType string `q:"migration_type"` // Status The status of migration to filter. Status string `q:"status"` // ChangesSince filters the response by a date and time stamp when the migration last changed. New in version 2.59 ChangesSince string `q:"changes-since"` // ChangesBefore Filters the response by a date and time stamp when the migration last changed. New in version 2.66 ChangesBefore string `q:"changes-before "` // UserID Filter the migrations by the given user ID. New in version 2.80 UserID string `q:"user_id"` // ProjectID Filter the migrations by the given project ID. New in version 2.80 ProjectID string `q:"project_id"` }
ListOpts provides options to filter the List results.
func (ListOpts) ToContainerListQuery ¶
ToContainerListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request
type LiveMigrateOpts ¶
type LiveMigrateOpts struct { // The host to which to migrate the server. // If this parameter is None, the scheduler chooses a host. Host *string `json:"host"` // Set to True to migrate local disks by using block migration. // If the source or destination host uses shared storage and you set // this value to True, the live migration fails. BlockMigration *bool `json:"block_migration,omitempty"` // Set to True to enable over commit when the destination host is checked // for available disk space. Set to False to disable over commit. This setting // affects only the libvirt virt driver. DiskOverCommit *bool `json:"disk_over_commit,omitempty"` }
LiveMigrateOpts specifies parameters of live migrate action.
func (LiveMigrateOpts) ToLiveMigrateMap ¶
func (opts LiveMigrateOpts) ToLiveMigrateMap() (map[string]interface{}, error)
ToLiveMigrateMap constructs a request body from LiveMigrateOpts.
type LiveMigrateOptsBuilder ¶
LiveMigrateOptsBuilder allows extensions to add additional parameters to the LiveMigrate request.
type MigrateOpts ¶
type MigrateOpts struct { // The host to which to migrate the server. // If this parameter is None, the scheduler chooses a host. // Migrate Server (migrate Action) (v2.56) Host *string `json:"host"` }
MigrateOpts specifies parameters of live migrate action.
func (MigrateOpts) ToMigrateMap ¶
func (opts MigrateOpts) ToMigrateMap() (map[string]interface{}, error)
ToMigrateMap constructs a request body from MigrateOpts.
type MigrateOptsBuilder ¶
MigrateOptsBuilder allows extensions to add additional parameters to the Migrate request.
type MigrateResult ¶
type MigrateResult struct {
gophercloud.ErrResult
}
MigrateResult is the response from a Migrate operation. Call its ExtractErr method to determine if the request suceeded or failed.
func LiveMigrate ¶
func LiveMigrate(client *gophercloud.ServiceClient, id string, opts LiveMigrateOptsBuilder) (r MigrateResult)
LiveMigrate will initiate a live-migration (without rebooting) of the instance to another host.
func Migrate ¶
func Migrate(client *gophercloud.ServiceClient, id string, opts MigrateOptsBuilder) (r MigrateResult)
Migrate will initiate a migration of the instance to another host.
type Migration ¶
type Migration struct { // ID The ID of the server migration. ID int `json:"id"` // CreatedAt The date and time when the resource was created. CreatedAt string `json:"created_at"` // DestCompute The target compute for a migration. DestCompute string `json:"dest_compute"` // DestHost The target node for a migration. DestHost string `json:"dest_host"` // InstanceUUID The UUID of the server. InstanceUUID string `json:"instance_uuid"` // NewInstanceTypeID In resize case, the flavor ID for resizing the server. // In the other cases, this parameter is same as the flavor ID of the server when the migration was started. NewInstanceTypeID int `json:"new_instance_type_id"` // OldInstanceTypeID The flavor ID of the server when the migration was started. OldInstanceTypeID int `json:"old_instance_type_id"` // SourceCompute The source compute for a migration. SourceCompute string `json:"source_compute"` // SourceNode The source node for a migration. SourceNode string `json:"source_node"` // Status The current status of the migration. Status string `json:"status"` // UpdatedAt The date and time when the resource was updated. UpdatedAt string `json:"updated_at"` // MigrationType The type of the server migration. This is one of live-migration, migration, resize and evacuation. MigrationType string `json:"migration_type"` // Links Links to the migration. This parameter is returned if the migration type is live-migration and the // migration status is one of queued, preparing, running and post-migrating. Links interface{} `json:"links"` // Uuid The UUID of the migration. Uuid string `json:"uuid"` // MigrationsLinks Links pertaining to the migration. This parameter is returned when paging and more data is available. MigrationsLinks interface{} `json:"migrations_links"` // UserID The ID of the user which initiated the server migration. The value may be null for older migration records. UserID string `json:"user_id"` // ProjectID The ID of the project which initiated the server migration. The value may be null for older migration records. ProjectID string `json:"project_id"` }
func ExtractMigration ¶
func ExtractMigration(r pagination.Page) ([]Migration, error)
ExtractMigration interprets a page of results as a slice of Migration.
type MigrationsPage ¶
type MigrationsPage struct {
pagination.LinkedPageBase
}
MigrationsPage stores a single page of all Network results from a List call.
func (MigrationsPage) IsEmpty ¶
func (page MigrationsPage) IsEmpty() (bool, error)
IsEmpty determines whether or not a NetworkPage is empty.
func (MigrationsPage) NextPageURL ¶
func (page MigrationsPage) NextPageURL() (string, error)
NextPageURL extracts the "next" link from the links section of the result.