// SetMemory sets the virtual machine memory allocation
SetMemory sets the virtual machine memory allocation
// SetMemory sets the virtual machine memory allocation
func (v *VirtualMachine) SetMemory(memoryMB int64) error {
	memorySettingsResults, err := v.activeSettingsData.Get("associators_", nil, MemorySettingDataClass)
	if err != nil {
		return errors.Wrap(err, "getting MemorySettingDataClass")
	}
	memorySettings, err := memorySettingsResults.ItemAtIndex(0)
	if err != nil {
		return errors.Wrap(err, "ItemAtIndex")
	}
	if err := memorySettings.Set("Limit", memoryMB); err != nil {
		return errors.Wrap(err, "Limit")
	}
	if err := memorySettings.Set("Reservation", memoryMB); err != nil {
		return errors.Wrap(err, "Reservation")
	}
	if err := memorySettings.Set("VirtualQuantity", memoryMB); err != nil {
		return errors.Wrap(err, "VirtualQuantity")
	}
	memText, err := memorySettings.GetText(1)
	if err != nil {
		return errors.Wrap(err, "Failed to get VM instance XML")
	}
	return v.modifyResourceSettings([]string{memText})
}
func ( v * VirtualMachine ) SetMemory ( memoryMB int64 ) error { memorySettingsResults , err := v . activeSettingsData . Get ( " " , nil , MemorySettingDataClass ) if err != nil { return errors . Wrap ( err , " " ) } memorySettings , err := memorySettingsResults . ItemAtIndex ( 0 ) if err != nil { return errors . Wrap ( err , " " ) } if err := memorySettings . Set ( " " , memoryMB ) ; err != nil { return errors . Wrap ( err , " " ) } if err := memorySettings . Set ( " " , memoryMB ) ; err != nil { return errors . Wrap ( err , " " ) } if err := memorySettings . Set ( " " , memoryMB ) ; err != nil { return errors . Wrap ( err , " " ) } memText , err := memorySettings . GetText ( 1 ) if err != nil { return errors . Wrap ( err , " " ) } return v . modifyResourceSettings ( [ ] string { memText } ) }
SetMemory sets the virtual machine memory allocation
SetMemory sets the virtual machine memory allocation