Information
We are currently investigating an issue with the editor of some pages. Please save your work and avoid to create new pages until this banner is gone.
...
The cycle for a dev environment with virtual machine: build→ provision→destroy
Let's follow an example. Let's say that:
Code Block | ||||
---|---|---|---|---|
| ||||
vagrant --acs_repo=/home/pburgos/Development/Repositories/bitbucket/almasw --acs_binary=/home/pburgos/.acsenv/versions/COMMON-2020JUN/dist --acs_working=/home/pburgos/.acsenv/versions/COMMON-2020JUN/working up acs01 |
This command will retrieve Centos7 box, and configure the mount points as nfs shares. It will ask for the administrator password to setup the NFS.
If a public_ip was specified for the machine in boxes_config.yml, then the user will be prompted to select the network interface to bridge to:
Code Block | ||
---|---|---|
| ||
vagrant --acs_repo=/Users/pburgos/Development/Repositories/bitbucket/almasw --acs_binary=/Users/pburgos/.acsenv/versions/COMMON-2020JUN/dist --acs_working=/Users/pburgos/.acsenv/versions/COMMON-2020JUN/working up acs01
Bringing machine 'acs01' up with 'virtualbox' provider...
==> acs01: Importing base box 'centos/7'...
==> acs01: Matching MAC address for NAT networking...
==> acs01: Setting the name of the VM: ansible_acsenv_acs01_1595780860590_42357
==> acs01: Clearing any previously set network interfaces...
==> acs01: Available bridged network interfaces:
1) en3: Thunderbolt Ethernet
2) en0: Wi-Fi (AirPort)
3) en1: Thunderbolt 1
4) en2: Thunderbolt 2
5) bridge0
6) awdl0
==> acs01: When choosing an interface, it is usually the one that is
==> acs01: being used to connect to the internet.
==> acs01:
acs01: Which interface should the network bridge to? 1
==> acs01: Preparing network interfaces based on configuration...
acs01: Adapter 1: nat
acs01: Adapter 2: hostonly
acs01: Adapter 3: bridged
==> acs01: Forwarding ports...
acs01: 22 (guest) => 2222 (host) (adapter 1)
==> acs01: Running 'pre-boot' VM customizations...
==> acs01: Booting VM...
==> acs01: Waiting for machine to boot. This may take a few minutes...
acs01: SSH address: 127.0.0.1:2222
acs01: SSH username: vagrant
acs01: SSH auth method: private key
acs01:
acs01: Vagrant insecure key detected. Vagrant will automatically replace
acs01: this with a newly generated keypair for better security.
acs01:
acs01: Inserting generated public key within guest...
acs01: Removing insecure key from the guest if it's present...
acs01: Key inserted! Disconnecting and reconnecting using new SSH key...
==> acs01: Machine booted and ready!
==> acs01: Checking for guest additions in VM...
acs01: No guest additions were detected on the base box for this VM! Guest
acs01: additions are required for forwarded ports, shared folders, host only
acs01: networking, and more. If SSH fails on this machine, please install
acs01: the guest additions and repackage the box to continue.
acs01:
acs01: This is not an error message; everything may continue to work properly,
acs01: in which case you may ignore this message.
==> acs01: Setting hostname...
==> acs01: Configuring and enabling network interfaces...
==> acs01: Rsyncing folder: /Users/pburgos/ansible_acsenv/ => /vagrant
==> acs01: Exporting NFS shared folders...
==> acs01: Preparing to edit /etc/exports. Administrator privileges will be required...
The nfsd service does not appear to be running.
Starting the nfsd service
==> acs01: Mounting NFS shared folders... |
You can destroy you VM to create a new one. These can happed when a different acs_binaries is needed.
Let's say I want to destroy acs01. First I verified the status of that machine
Code Block |
---|
❯ vagrant status
Current machine states:
acs01 running (virtualbox)
acs02 not created (virtualbox) |
To destroy acs01 VM we issue:
Code Block |
---|
❯ vagrant destroy acs01 acs01: Are you sure you want to destroy the 'acs01' VM? [y/N] y ==> acs01: Forcing shutdown of VM... ==> acs01: Destroying VM and associated drives... ==> acs01: Pruning invalid NFS exports. Administrator privileges will be required... Password: |
Let's verified it was destroyed:
Code Block |
---|
❯ vagrant status acs01
Current machine states:
acs01 not created (virtualbox)
|
Great!
Once the
❯ vagrant status acs01
Current machine states:
acs01 not created (virtualbox)
❯ vagrant status acs01
Current machine states:
acs01 not created (virtualbox)