add support for eagerly zeroed / scrubbed disks
This commit is contained in:
parent
5a87760702
commit
6c749eecf7
|
@ -53,6 +53,7 @@ type NIC struct {
|
|||
|
||||
type CreateConfig struct {
|
||||
DiskThinProvisioned bool
|
||||
DiskEagerlyScrub bool
|
||||
DiskControllerType string // example: "scsi", "pvscsi"
|
||||
DiskSize int64
|
||||
|
||||
|
@ -503,6 +504,7 @@ func addDisk(_ *Driver, devices object.VirtualDeviceList, config *CreateConfig)
|
|||
Backing: &types.VirtualDiskFlatVer2BackingInfo{
|
||||
DiskMode: string(types.VirtualDiskModePersistent),
|
||||
ThinProvisioned: types.NewBool(config.DiskThinProvisioned),
|
||||
EagerlyScrub: types.NewBool(config.DiskEagerlyScrub),
|
||||
},
|
||||
},
|
||||
CapacityInKB: config.DiskSize * 1024,
|
||||
|
|
|
@ -42,6 +42,8 @@ type CreateConfig struct {
|
|||
DiskSize int64 `mapstructure:"disk_size"`
|
||||
// Enable VMDK thin provisioning for VM. Defaults to `false`.
|
||||
DiskThinProvisioned bool `mapstructure:"disk_thin_provisioned"`
|
||||
// Enable VMDK eager scrubbing for VM. Defaults to `false`.
|
||||
DiskEagerlyScrub bool `mapstructure:"disk_eagerly_scrub"`
|
||||
// Set network VM will be connected to.
|
||||
Network string `mapstructure:"network"`
|
||||
// Set VM network card type. Example `vmxnet3`.
|
||||
|
@ -115,6 +117,7 @@ func (s *StepCreateVM) Run(_ context.Context, state multistep.StateBag) multiste
|
|||
|
||||
vm, err = d.CreateVM(&driver.CreateConfig{
|
||||
DiskThinProvisioned: s.Config.DiskThinProvisioned,
|
||||
DiskEagerlyScrub: s.Config.DiskEagerlyScrub,
|
||||
DiskControllerType: s.Config.DiskControllerType,
|
||||
DiskSize: s.Config.DiskSize,
|
||||
Name: s.Location.VMName,
|
||||
|
|
Loading…
Reference in New Issue