BUG: Moved source for attaching disk from config.rb to import.rb which makes it much more stable when halting and uping the vm several times.
IMPR: Implemented all I18n messages in English for this feature.
FEAT: Improved the documentation and added an example.
IMPR: Now the size of a new disk is specified in MB instead GB as wished in https://github.com/hashicorp/vagrant/pull/6321#issuecomment-179687930.
MISC: Got this working on creating a new machine. Seems to be problems when halting and up'ing the machine again. It says it can't attach the disk again. Perhaps it was better having this code in import_vm.ps1 anyway?
MISC: Lots of puts for debug purposes.
Prior to this commit, the run trigger option wouldn't catch for failures
outside of the #Subprocess.execute raising exceptions. This commit fixes
that by inspecting the exit code result of the subprocess and using the
new `exit_codes` option to determine how to move forward with the
trigger.
`suspend` action is not listed, even though it can be used and it works.
```
$ vagrant --version
Vagrant 2.1.1
```
```
config.trigger.before [:suspend] do |trigger|
trigger.name = "Before suspend"
trigger.run = {inline: "..."}
end
````
- Fix#9796: Failing installation on bionic (18.04 LTS)
- Remove support for precise (12.04 LTS), which is out of public support
(On this version, the package python-software-properties contained
the add-apt-repository tool)
- Reduce the number of SSH calls, and avoid unnecessary apt-get calls.
The command should be stand-alone, not part of a "sentence":
```
Enable-WindowsOptionalFeature : A positional parameter cannot be found that accepts argument '.'.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Enable-WindowsOptionalFeature], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
```
- Remove undesired blank characters
- The examples attached to a specific option must be concise
- The original example is a tip for a non-standard use case
I either got:
`syntax error, unexpected ':', expecting '}` or `wrong number of arguments (given 1, expected 0) (ArgumentError)` until I added the `=` in.
To allow users to continue to use the community plugin, this commit adds
a switch that will not load the core trigger feature if it detects the
community plugin is installed. It also allows the user to disable the
warning so they can continue to use the plugin without extra output.