Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vrk@zen:~/vagrant/laxrac$ vagrant validate
- Vagrantfile validated successfully.
- vrk@zen:~/vagrant/laxrac$ vagrant up
- Bringing machine 'laxrac1' up with 'virtualbox' provider...
- Bringing machine 'laxrac2' up with 'virtualbox' provider...
- ==> laxrac1: Importing base box 'rhel7_20201117'...
- ==> laxrac1: Matching MAC address for NAT networking...
- ==> laxrac1: Setting the name of the VM: laxrac1
- ==> laxrac1: Clearing any previously set network interfaces...
- ==> laxrac1: Preparing network interfaces based on configuration...
- laxrac1: Adapter 1: nat
- ==> laxrac1: Forwarding ports...
- laxrac1: 22 (guest) => 2222 (host) (adapter 1)
- ==> laxrac1: Running 'pre-boot' VM customizations...
- ==> laxrac1: Booting VM...
- ==> laxrac1: Waiting for machine to boot. This may take a few minutes...
- laxrac1: SSH address: 127.0.0.1:2222
- laxrac1: SSH username: vagrant
- laxrac1: SSH auth method: private key
- laxrac1:
- laxrac1: Vagrant insecure key detected. Vagrant will automatically replace
- laxrac1: this with a newly generated keypair for better security.
- laxrac1:
- laxrac1: Inserting generated public key within guest...
- laxrac1: Removing insecure key from the guest if it's present...
- laxrac1: Key inserted! Disconnecting and reconnecting using new SSH key...
- ==> laxrac1: Machine booted and ready!
- ==> laxrac1: Checking for guest additions in VM...
- ==> laxrac1: Setting hostname...
- ==> laxrac2: Importing base box 'rhel7_20201117'...
- ==> laxrac2: Matching MAC address for NAT networking...
- ==> laxrac2: Setting the name of the VM: laxrac2
- ==> laxrac2: Fixed port collision for 22 => 2222. Now on port 2200.
- ==> laxrac2: Clearing any previously set network interfaces...
- ==> laxrac2: Preparing network interfaces based on configuration...
- laxrac2: Adapter 1: nat
- ==> laxrac2: Forwarding ports...
- laxrac2: 22 (guest) => 2200 (host) (adapter 1)
- ==> laxrac2: Running 'pre-boot' VM customizations...
- A customization command failed:
- ["createhd", "--filename", "/home/vrk/virtualboxes/shared_disks/laxrac_asm_disk1.vdi", "--size", 16384, "--format", "VDI", "--variant", "Fixed"]
- The following error was experienced:
- #<Vagrant::Errors::VBoxManageError: There was an error while executing `VBoxManage`, a CLI used by Vagrant
- for controlling VirtualBox. The command and stderr is shown below.
- Command: ["createhd", "--filename", "/home/vrk/virtualboxes/shared_disks/laxrac_asm_disk1.vdi", "--size", "16384", "--format", "VDI", "--variant", "Fixed"]
- Stderr: 0%...
- Progress state: VBOX_E_FILE_ERROR
- VBoxManage: error: Failed to create medium
- VBoxManage: error: Could not create the medium storage unit '/home/vrk/virtualboxes/shared_disks/laxrac_asm_disk1.vdi'.
- VBoxManage: error: VDI: cannot create image '/home/vrk/virtualboxes/shared_disks/laxrac_asm_disk1.vdi' (VERR_ALREADY_EXISTS)
- VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
- VBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg*)" at line 510 of file VBoxManageDisk.cpp
- >
- Please fix this customization and try again.
- vrk@zen:~/vagrant/laxrac$ ls -ltr /home/vrk/virtualboxes/shared_disks/laxrac_asm_disk*
- -rw------- 1 vrk vrk 17181966336 Nov 19 12:59 /home/vrk/virtualboxes/shared_disks/laxrac_asm_disk4.vdi
- -rw------- 1 vrk vrk 17181966336 Nov 19 12:59 /home/vrk/virtualboxes/shared_disks/laxrac_asm_disk5.vdi
- -rw------- 1 vrk vrk 17181966336 Nov 19 12:59 /home/vrk/virtualboxes/shared_disks/laxrac_asm_disk6.vdi
- -rw------- 1 vrk vrk 17181966336 Nov 19 12:59 /home/vrk/virtualboxes/shared_disks/laxrac_asm_disk1.vdi
- -rw------- 1 vrk vrk 17181966336 Nov 19 12:59 /home/vrk/virtualboxes/shared_disks/laxrac_asm_disk3.vdi
- -rw------- 1 vrk vrk 17181966336 Nov 19 12:59 /home/vrk/virtualboxes/shared_disks/laxrac_asm_disk2.vdi
- vrk@zen:~/vagrant/laxrac$ cat Vagrantfile
- # encoding: utf-8
- # -*- mode: ruby -*-
- # vi: set ft=ruby :
- # -- define the number of nodes to spin --
- N=2
- cname="laxrac"
- Vagrant.configure("2") do |config|
- #Iterate over the nodes
- (1..N).each do |node_id|
- nid=(node_id)
- nodename=("#{cname}#{nid}")
- config.vm.define "#{cname}#{nid}" do |node|
- node.vm.box = "rhel7_20201117"
- node.vm.hostname = "#{nodename}"
- node.vm.synced_folder ".", "/vagrant", disabled:true
- node.vm.provider :virtualbox do |v|
- v.memory = 4096
- v.cpus = 2
- v.name = "#{nodename}"
- (1..6).each do |dnum|
- asmdisk = ("/home/vrk/virtualboxes/shared_disks/#{cname}_asm_disk#{dnum}.vdi")
- unless File.exist?("#{asmdisk}")
- v.customize ['createhd', '--filename', ("#{asmdisk}") , '--size', 16384, '--format', 'VDI', '--variant', 'Fixed']
- end
- v.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', ("#{dnum}"), '--device', 0, '--type', 'hdd', '--medium', ("#{asmdisk}"), '--mtype', 'shareable', '--nonrotational', 'on']
- end # eof dnum
- end # eof v
- end # eof node
- end # eof node_id
- end # eof config
- vrk@zen:~/vagrant/laxrac$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement