Documentation
¶
Index ¶
- Constants
- func BoolMap(src map[string]bool) map[string]*bool
- func BoolPtr(v bool) *bool
- func BoolSlice(src []bool) []*bool
- func BoolValue(v *bool) bool
- func BoolValueMap(src map[string]*bool) map[string]bool
- func BoolValueSlice(src []*bool) []bool
- func BuildReference(uuid, kind string) *v3.Reference
- func BuildReferenceValue(uuid, kind string) *v3.ReferenceValues
- func Float64Map(src map[string]float64) map[string]*float64
- func Float64Ptr(v float64) *float64
- func Float64Slice(src []float64) []*float64
- func Float64Value(v *float64) float64
- func Float64ValueMap(src map[string]*float64) map[string]float64
- func Float64ValueSlice(src []*float64) []float64
- func Int64Map(src map[string]int64) map[string]*int64
- func Int64Ptr(v int64) *int64
- func Int64Slice(src []int64) []*int64
- func Int64Value(v *int64) int64
- func Int64ValueMap(src map[string]*int64) map[string]int64
- func Int64ValueSlice(src []*int64) []int64
- func IntMap(src map[string]int) map[string]*int
- func IntPtr(v int) *int
- func IntSlice(src []int) []*int
- func IntValue(v *int) int
- func IntValueMap(src map[string]*int) map[string]int
- func IntValueSlice(src []*int) []int
- func MillisecondsTimeValue(v *int64) time.Time
- func SecondsTimeValue(v *int64) time.Time
- func StringMap(src map[string]string) map[string]*string
- func StringPtr(v string) *string
- func StringSlice(src []string) []*string
- func StringValue(v *string) string
- func StringValueMap(src map[string]*string) map[string]string
- func StringValueSlice(src []*string) []string
- func Time(v time.Time) *time.Time
- func TimeMap(src map[string]time.Time) map[string]*time.Time
- func TimeSlice(src []time.Time) []*time.Time
- func TimeUnixMilli(t time.Time) int64
- func TimeValue(v *time.Time) time.Time
- func TimeValueMap(src map[string]*time.Time) map[string]time.Time
- func TimeValueSlice(src []*time.Time) []time.Time
- type Artifact
- type Builder
- type Category
- type ClusterConfig
- type Config
- type Driver
- type FlatCategory
- type FlatClusterConfig
- type FlatConfig
- type FlatVmConfig
- type FlatVmDisk
- type FlatVmNIC
- type NutanixDriver
- func (d *NutanixDriver) Create(req *v3.VMIntentInput) (*nutanixInstance, error)
- func (d *NutanixDriver) CreateRequest(vm VmConfig) (*v3.VMIntentInput, error)
- func (d *NutanixDriver) Delete(vmUUID string) error
- func (d *NutanixDriver) DeleteImage(imageUUID string) error
- func (d *NutanixDriver) GetHost(hostUUID string) (*nutanixHost, error)
- func (d *NutanixDriver) GetImage(imagename string) (*nutanixImage, error)
- func (d *NutanixDriver) GetVM(vmUUID string) (*nutanixInstance, error)
- func (d *NutanixDriver) PowerOff(vmUUID string) error
- func (d *NutanixDriver) SaveVMDisk(diskUUID string, index int, imageCategories []Category) (*nutanixImage, error)
- func (d *NutanixDriver) UploadImage(imagePath string, sourceType string, imageType string, vm VmConfig) (*nutanixImage, error)
- func (d *NutanixDriver) WaitForShutdown(vmUUID string, cancelCh <-chan struct{}) bool
- type StepShutdown
- type VmConfig
- type VmDisk
- type VmNIC
Constants ¶
const ( // NutanixIdentifierBootTypeLegacy is a resource identifier identifying the legacy boot type for virtual machines. NutanixIdentifierBootTypeLegacy string = "legacy" // NutanixIdentifierBootTypeUEFI is a resource identifier identifying the UEFI boot type for virtual machines. NutanixIdentifierBootTypeUEFI string = "uefi" )
const BuilderId = "packer.nutanix"
Variables ¶
This section is empty.
Functions ¶
func BoolValue ¶
BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.
func BoolValueMap ¶
BoolValueMap converts a string map of bool pointers into a string map of bool values
func BoolValueSlice ¶
BoolValueSlice converts a slice of bool pointers into a slice of bool values
func BuildReference ¶
BuildReference create reference from defined object
func BuildReferenceValue ¶ added in v0.1.1
func BuildReferenceValue(uuid, kind string) *v3.ReferenceValues
BuildReferenceValue create referencevalue from defined object
func Float64Map ¶
Float64Map converts a string map of float64 values into a string map of float64 pointers
func Float64Ptr ¶
Float64Ptr returns a pointer to the float64 value passed in.
func Float64Slice ¶
Float64Slice converts a slice of float64 values into a slice of float64 pointers
func Float64Value ¶
Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.
func Float64ValueMap ¶
Float64ValueMap converts a string map of float64 pointers into a string map of float64 values
func Float64ValueSlice ¶
Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values
func Int64Slice ¶
Int64Slice converts a slice of int64 values into a slice of int64 pointers
func Int64Value ¶
Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.
func Int64ValueMap ¶
Int64ValueMap converts a string map of int64 pointers into a string map of int64 values
func Int64ValueSlice ¶
Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values
func IntValueMap ¶
IntValueMap converts a string map of int pointers into a string map of int values
func IntValueSlice ¶
IntValueSlice converts a slice of int pointers into a slice of int values
func MillisecondsTimeValue ¶
MillisecondsTimeValue converts an int64 pointer to a time.Time value representing milliseconds sinch Epoch or time.Time{} if the pointer is nil.
func SecondsTimeValue ¶
SecondsTimeValue converts an int64 pointer to a time.Time value representing seconds since Epoch or time.Time{} if the pointer is nil.
func StringMap ¶
StringMap converts a string map of string values into a string map of string pointers
func StringSlice ¶
StringSlice converts a slice of string values into a slice of string pointers
func StringValue ¶
StringValue returns the value of the string pointer passed in or "" if the pointer is nil.
func StringValueMap ¶
StringValueMap converts a string map of string pointers into a string map of string values
func StringValueSlice ¶
StringValueSlice converts a slice of string pointers into a slice of string values
func TimeMap ¶
TimeMap converts a string map of time.Time values into a string map of time.Time pointers
func TimeUnixMilli ¶
TimeUnixMilli returns a Unix timestamp in milliseconds from "January 1, 1970 UTC". The result is undefined if the Unix time cannot be represented by an int64. Which includes calling TimeUnixMilli on a zero Time is undefined.
This utility is useful for service API's such as CloudWatch Logs which require their unix time values to be in milliseconds.
See Go stdlib https://golang.org/pkg/time/#Time.UnixNano for more information.
func TimeValue ¶
TimeValue returns the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.
func TimeValueMap ¶
TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values
Types ¶
type Artifact ¶
Artifact contains the unique keys for the nutanix artifact produced from Packer
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder - struct for building nutanix-builder
func (*Builder) ConfigSpec ¶
func (b *Builder) ConfigSpec() hcldec.ObjectSpec
type Category ¶ added in v0.6.0
type Category struct {
Key string `mapstructure:"key" json:"key" required:"false"`
Value string `mapstructure:"value" json:"value" required:"false"`
}
func (*Category) FlatMapstructure ¶ added in v0.6.0
FlatMapstructure returns a new FlatCategory. FlatCategory is an auto-generated flat version of Category. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type ClusterConfig ¶
type ClusterConfig struct {
Username string `mapstructure:"nutanix_username" required:"false"`
Password string `mapstructure:"nutanix_password" required:"false"`
Insecure bool `mapstructure:"nutanix_insecure" required:"false"`
Endpoint string `mapstructure:"nutanix_endpoint" required:"true"`
Port int32 `mapstructure:"nutanix_port" required:"false"`
}
func (*ClusterConfig) FlatMapstructure ¶
func (*ClusterConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatClusterConfig. FlatClusterConfig is an auto-generated flat version of ClusterConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type Config ¶
type Config struct {
common.PackerConfig `mapstructure:",squash"`
CommConfig communicator.Config `mapstructure:",squash"`
commonsteps.CDConfig `mapstructure:",squash"`
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
ClusterConfig `mapstructure:",squash"`
VmConfig `mapstructure:",squash"`
ForceDeregister bool `mapstructure:"force_deregister" json:"force_deregister" required:"false"`
ImageDescription string `mapstructure:"image_description" json:"image_description" required:"false"`
ImageCategories []Category `mapstructure:"image_categories" required:"false"`
ImageDelete bool `mapstructure:"image_delete" json:"image_delete" required:"false"`
WaitTimeout time.Duration `mapstructure:"ip_wait_timeout" json:"ip_wait_timeout" required:"false"`
// contains filtered or unexported fields
}
func (*Config) FlatMapstructure ¶
FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type Driver ¶
type Driver interface {
CreateRequest(VmConfig) (*v3.VMIntentInput, error)
Create(*v3.VMIntentInput) (*nutanixInstance, error)
Delete(string) error
GetVM(string) (*nutanixInstance, error)
//GetImage(string) (*nutanixImage, error)
GetHost(string) (*nutanixHost, error)
PowerOff(string) error
UploadImage(string, string, string, VmConfig) (*nutanixImage, error)
DeleteImage(string) error
GetImage(string) (*nutanixImage, error)
SaveVMDisk(string, int, []Category) (*nutanixImage, error)
WaitForShutdown(string, <-chan struct{}) bool
}
A driver is able to talk to Nutanix PrismCentral and perform certain operations with it.
type FlatCategory ¶ added in v0.6.0
type FlatCategory struct {
Key *string `mapstructure:"key" json:"key" required:"false" cty:"key" hcl:"key"`
Value *string `mapstructure:"value" json:"value" required:"false" cty:"value" hcl:"value"`
}
FlatCategory is an auto-generated flat version of Category. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatClusterConfig ¶
type FlatClusterConfig struct {
Username *string `mapstructure:"nutanix_username" required:"false" cty:"nutanix_username" hcl:"nutanix_username"`
Password *string `mapstructure:"nutanix_password" required:"false" cty:"nutanix_password" hcl:"nutanix_password"`
Insecure *bool `mapstructure:"nutanix_insecure" required:"false" cty:"nutanix_insecure" hcl:"nutanix_insecure"`
Endpoint *string `mapstructure:"nutanix_endpoint" required:"true" cty:"nutanix_endpoint" hcl:"nutanix_endpoint"`
Port *int32 `mapstructure:"nutanix_port" required:"false" cty:"nutanix_port" hcl:"nutanix_port"`
}
FlatClusterConfig is an auto-generated flat version of ClusterConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatConfig ¶
type FlatConfig struct {
PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"`
PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"`
SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"`
SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"`
SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"`
SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"`
SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"`
SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"`
SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"`
SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"`
SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"`
SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"`
SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"`
SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"`
SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"`
SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"`
SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"`
SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"`
SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"`
SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"`
SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"`
SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"`
SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"`
SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"`
SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"`
SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"`
SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"`
SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"`
SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"`
SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"`
SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"`
SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"`
SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"`
SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"`
SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"`
SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"`
SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"`
SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"`
SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"`
SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"`
WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"`
WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"`
WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"`
WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"`
WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"`
WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"`
WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"`
WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"`
WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"`
CDFiles []string `mapstructure:"cd_files" cty:"cd_files" hcl:"cd_files"`
CDContent map[string]string `mapstructure:"cd_content" cty:"cd_content" hcl:"cd_content"`
CDLabel *string `mapstructure:"cd_label" cty:"cd_label" hcl:"cd_label"`
ShutdownCommand *string `mapstructure:"shutdown_command" required:"false" cty:"shutdown_command" hcl:"shutdown_command"`
ShutdownTimeout *string `mapstructure:"shutdown_timeout" required:"false" cty:"shutdown_timeout" hcl:"shutdown_timeout"`
Username *string `mapstructure:"nutanix_username" required:"false" cty:"nutanix_username" hcl:"nutanix_username"`
Password *string `mapstructure:"nutanix_password" required:"false" cty:"nutanix_password" hcl:"nutanix_password"`
Insecure *bool `mapstructure:"nutanix_insecure" required:"false" cty:"nutanix_insecure" hcl:"nutanix_insecure"`
Endpoint *string `mapstructure:"nutanix_endpoint" required:"true" cty:"nutanix_endpoint" hcl:"nutanix_endpoint"`
Port *int32 `mapstructure:"nutanix_port" required:"false" cty:"nutanix_port" hcl:"nutanix_port"`
VMName *string `mapstructure:"vm_name" json:"vm_name" required:"false" cty:"vm_name" hcl:"vm_name"`
OSType *string `mapstructure:"os_type" json:"os_type" required:"true" cty:"os_type" hcl:"os_type"`
BootType *string `mapstructure:"boot_type" json:"boot_type" required:"false" cty:"boot_type" hcl:"boot_type"`
VmDisks []FlatVmDisk `mapstructure:"vm_disks" cty:"vm_disks" hcl:"vm_disks"`
VmNICs []FlatVmNIC `mapstructure:"vm_nics" cty:"vm_nics" hcl:"vm_nics"`
ImageName *string `mapstructure:"image_name" json:"image_name" required:"false" cty:"image_name" hcl:"image_name"`
ClusterUUID *string `mapstructure:"cluster_uuid" json:"cluster_uuid" required:"false" cty:"cluster_uuid" hcl:"cluster_uuid"`
ClusterName *string `mapstructure:"cluster_name" json:"cluster_name" required:"false" cty:"cluster_name" hcl:"cluster_name"`
CPU *int64 `mapstructure:"cpu" json:"cpu" required:"false" cty:"cpu" hcl:"cpu"`
MemoryMB *int64 `mapstructure:"memory_mb" json:"memory_mb" required:"false" cty:"memory_mb" hcl:"memory_mb"`
UserData *string `mapstructure:"user_data" json:"user_data" required:"false" cty:"user_data" hcl:"user_data"`
VMCategories []FlatCategory `mapstructure:"vm_categories" required:"false" cty:"vm_categories" hcl:"vm_categories"`
ForceDeregister *bool `mapstructure:"force_deregister" json:"force_deregister" required:"false" cty:"force_deregister" hcl:"force_deregister"`
ImageDescription *string `mapstructure:"image_description" json:"image_description" required:"false" cty:"image_description" hcl:"image_description"`
ImageCategories []FlatCategory `mapstructure:"image_categories" required:"false" cty:"image_categories" hcl:"image_categories"`
ImageDelete *bool `mapstructure:"image_delete" json:"image_delete" required:"false" cty:"image_delete" hcl:"image_delete"`
WaitTimeout *string `mapstructure:"ip_wait_timeout" json:"ip_wait_timeout" required:"false" cty:"ip_wait_timeout" hcl:"ip_wait_timeout"`
}
FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatVmConfig ¶
type FlatVmConfig struct {
VMName *string `mapstructure:"vm_name" json:"vm_name" required:"false" cty:"vm_name" hcl:"vm_name"`
OSType *string `mapstructure:"os_type" json:"os_type" required:"true" cty:"os_type" hcl:"os_type"`
BootType *string `mapstructure:"boot_type" json:"boot_type" required:"false" cty:"boot_type" hcl:"boot_type"`
VmDisks []FlatVmDisk `mapstructure:"vm_disks" cty:"vm_disks" hcl:"vm_disks"`
VmNICs []FlatVmNIC `mapstructure:"vm_nics" cty:"vm_nics" hcl:"vm_nics"`
ImageName *string `mapstructure:"image_name" json:"image_name" required:"false" cty:"image_name" hcl:"image_name"`
ClusterUUID *string `mapstructure:"cluster_uuid" json:"cluster_uuid" required:"false" cty:"cluster_uuid" hcl:"cluster_uuid"`
ClusterName *string `mapstructure:"cluster_name" json:"cluster_name" required:"false" cty:"cluster_name" hcl:"cluster_name"`
CPU *int64 `mapstructure:"cpu" json:"cpu" required:"false" cty:"cpu" hcl:"cpu"`
MemoryMB *int64 `mapstructure:"memory_mb" json:"memory_mb" required:"false" cty:"memory_mb" hcl:"memory_mb"`
UserData *string `mapstructure:"user_data" json:"user_data" required:"false" cty:"user_data" hcl:"user_data"`
VMCategories []FlatCategory `mapstructure:"vm_categories" required:"false" cty:"vm_categories" hcl:"vm_categories"`
}
FlatVmConfig is an auto-generated flat version of VmConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatVmDisk ¶
type FlatVmDisk struct {
ImageType *string `mapstructure:"image_type" json:"image_type" required:"false" cty:"image_type" hcl:"image_type"`
SourceImageName *string `mapstructure:"source_image_name" json:"source_image_name" required:"false" cty:"source_image_name" hcl:"source_image_name"`
SourceImageUUID *string `mapstructure:"source_image_uuid" json:"source_image_uuid" required:"false" cty:"source_image_uuid" hcl:"source_image_uuid"`
SourceImageURI *string `mapstructure:"source_image_uri" json:"source_image_uri" required:"false" cty:"source_image_uri" hcl:"source_image_uri"`
DiskSizeGB *int64 `mapstructure:"disk_size_gb" json:"disk_size_gb" required:"false" cty:"disk_size_gb" hcl:"disk_size_gb"`
}
FlatVmDisk is an auto-generated flat version of VmDisk. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatVmNIC ¶
type FlatVmNIC struct {
SubnetName *string `mapstructure:"subnet_name" json:"subnet_name" required:"false" cty:"subnet_name" hcl:"subnet_name"`
SubnetUUID *string `mapstructure:"subnet_uuid" json:"subnet_uuid" required:"false" cty:"subnet_uuid" hcl:"subnet_uuid"`
}
FlatVmNIC is an auto-generated flat version of VmNIC. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type NutanixDriver ¶
type NutanixDriver struct {
Config Config
ClusterConfig ClusterConfig
// contains filtered or unexported fields
}
func (*NutanixDriver) Create ¶
func (d *NutanixDriver) Create(req *v3.VMIntentInput) (*nutanixInstance, error)
func (*NutanixDriver) CreateRequest ¶
func (d *NutanixDriver) CreateRequest(vm VmConfig) (*v3.VMIntentInput, error)
func (*NutanixDriver) Delete ¶
func (d *NutanixDriver) Delete(vmUUID string) error
func (*NutanixDriver) DeleteImage ¶
func (d *NutanixDriver) DeleteImage(imageUUID string) error
func (*NutanixDriver) GetHost ¶
func (d *NutanixDriver) GetHost(hostUUID string) (*nutanixHost, error)
func (*NutanixDriver) GetImage ¶ added in v0.3.0
func (d *NutanixDriver) GetImage(imagename string) (*nutanixImage, error)
func (*NutanixDriver) GetVM ¶
func (d *NutanixDriver) GetVM(vmUUID string) (*nutanixInstance, error)
func (*NutanixDriver) PowerOff ¶
func (d *NutanixDriver) PowerOff(vmUUID string) error
func (*NutanixDriver) SaveVMDisk ¶
func (d *NutanixDriver) SaveVMDisk(diskUUID string, index int, imageCategories []Category) (*nutanixImage, error)
func (*NutanixDriver) UploadImage ¶
func (d *NutanixDriver) UploadImage(imagePath string, sourceType string, imageType string, vm VmConfig) (*nutanixImage, error)
UploadImage (string, VmConfig) (*nutanixImage, error)
func (*NutanixDriver) WaitForShutdown ¶
func (d *NutanixDriver) WaitForShutdown(vmUUID string, cancelCh <-chan struct{}) bool
type StepShutdown ¶
This step shuts down the machine. It first attempts to do so gracefully, but ultimately forcefully shuts it down if that fails.
Uses:
communicator packersdk.Communicator driver Driver ui packersdk.Ui vmName string
Produces:
<nothing>
func (*StepShutdown) Cleanup ¶
func (s *StepShutdown) Cleanup(state multistep.StateBag)
func (*StepShutdown) Run ¶
func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type VmConfig ¶
type VmConfig struct {
VMName string `mapstructure:"vm_name" json:"vm_name" required:"false"`
OSType string `mapstructure:"os_type" json:"os_type" required:"true"`
BootType string `mapstructure:"boot_type" json:"boot_type" required:"false"`
VmDisks []VmDisk `mapstructure:"vm_disks"`
VmNICs []VmNIC `mapstructure:"vm_nics"`
ImageName string `mapstructure:"image_name" json:"image_name" required:"false"`
ClusterUUID string `mapstructure:"cluster_uuid" json:"cluster_uuid" required:"false"`
ClusterName string `mapstructure:"cluster_name" json:"cluster_name" required:"false"`
CPU int64 `mapstructure:"cpu" json:"cpu" required:"false"`
MemoryMB int64 `mapstructure:"memory_mb" json:"memory_mb" required:"false"`
UserData string `mapstructure:"user_data" json:"user_data" required:"false"`
VMCategories []Category `mapstructure:"vm_categories" required:"false"`
}
func (*VmConfig) FlatMapstructure ¶
FlatMapstructure returns a new FlatVmConfig. FlatVmConfig is an auto-generated flat version of VmConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type VmDisk ¶
type VmDisk struct {
ImageType string `mapstructure:"image_type" json:"image_type" required:"false"`
SourceImageName string `mapstructure:"source_image_name" json:"source_image_name" required:"false"`
SourceImageUUID string `mapstructure:"source_image_uuid" json:"source_image_uuid" required:"false"`
SourceImageURI string `mapstructure:"source_image_uri" json:"source_image_uri" required:"false"`
DiskSizeGB int64 `mapstructure:"disk_size_gb" json:"disk_size_gb" required:"false"`
}