A vmr environment consist of a
directory and a template file call
A vmr object contains information to create and modify an vmr environment. Once the environment created and initialized the vmr object became optional and only the working directory and the Vagrantfile are the managers.
vmrCreate() function create a vmr object using
* name : the box name (from vmrList())
* provider: the provider name (from vmrList())
* version: (optional by default latest version is use)
* provider.options: specific provider options (vignette n°5)
Set the working directory to a vmr environment who was already initialized.
setwd("path/to/my/vmr/environment/") <- vmrLoad() vmr_env vmr_env
Initialize a vmr environment will create a Vagrantfile template into the working directory and download the box associated.
The box download can be long depending of the box size and network bandwide. The box is save in vagrant environment (“~/.vagrant.d/”).
# created or loaded object vmr_env # force.vagrantfile will override existing Vagrantfile template <- vmrInitEnv(vmr_env, force.vagrantfile=TRUE)vmr_env
To remove any file created, boxes downloaded and provider instance run this commands:
<- vmrLoad() vmr_env # provider cleaning vmrDestroy(vmr_env$id) # box cleaning vmrLocalBoxRemove(vmr_env$box, provider = vmr_env$provider, version = vmr_env$version) # remove the working directory
Several functions need and can modify a vmr object to add
options to the environment.
vmrInitEnv() have to be recall at vmr object modification.
It’s possible to upgrade an environment to use the latest box version.
This functions manage the environment instance.
They have to be call in vmr environment (working directory), with no arguments.
# Get environment status vmrStatus() # Start a provider instance vmrStart() # Save state and stop provider instance vmrSuspend() # Resume a saved provider instance vmrResume() # Stop a provider instance vmrStop() # Remove a provider instance vmrDestroy()
Manage provider instance with snapshot.
# Take a snapshot vmrTakeSnapshot("my snapshot") # resume a snapshot vmrRestoreSnapshot("my snapshot") # list snapshots vmrListSnapshot()