vagrant-subutai 7.0.6 → 7.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6eb73b6420f3706a1cb5a525a7bbc9c7c8d2172
4
- data.tar.gz: e8d087dbc65c5268fc8d796f18bf685d9f527adc
3
+ metadata.gz: 467222653b28e1075f3be05f29f5c776ebbc94c3
4
+ data.tar.gz: c4f0d411f13d3966fe3c3767f407a5da49f5e396
5
5
  SHA512:
6
- metadata.gz: 1188edc48a875437c0c0f82b92ece3f66e6cd55f8401d76f9c4228f8041a507e42f17f9ffb7db68e6816abc36e76af13e725a2ea6597595eb5efb5fa19ddf152
7
- data.tar.gz: 95fbb84d529ae8b01b6ede8c7ddee1f99e72859cd0a43e1723c1a678d768f893ba39cbf0f9b542fc922ceffe48ab4fce341a820f7011e6fe92544b4899ad0994
6
+ metadata.gz: c1d8525a0ddd562de79aeeced18d0e36e0be384babd1bf62e6b75a73815ca301e8241b578ab7dce0dda74499bb57fd11e96e2134a25f26daabc1b7e59d7c2a8c
7
+ data.tar.gz: e3f6a4d91dffa70e84bbc0bdedaa78d36dbd8c258a2b9fa30bc29809aec60f7315c6ea000126bc46a1fb9b065515dfd985f0bc65ffbe1540e7ba93ec9dbed650
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 7.0.7 (November 07, 2018)
2
+
3
+ BUG FIXES:
4
+ - [Parallels] Fixed bug with disability of creating virtual disk. #135
5
+ - Fixed bug with white space in home directory path results in VM storage growth script failures. #129
6
+
7
+ FEATURES:
8
+ - [configuration] Implemented LIBVIRT_POOL configuration parameter. #127
9
+ - [configuration] Implemented APT_PROXY_URL configuration parameter
10
+
1
11
  ## 7.0.6 (October 17, 2018)
2
12
 
3
13
  BUG FIXES:
@@ -1,4 +1,5 @@
1
1
  require_relative '../vagrant-subutai'
2
+ require 'pathname'
2
3
 
3
4
 
4
5
  module VagrantSubutai
@@ -38,19 +39,43 @@ module VagrantSubutai
38
39
  # and any shared folders or networks are already setup.
39
40
  #
40
41
  # No return value is expected.
41
- def provision
42
+ # Create virtual disk for hyperv
43
+ def hyperv
42
44
  has_grow, grow_by = SubutaiDisk.has_grow
43
45
  file_disk = SubutaiDisk.file_path(grow_by, "hyper_v")
46
+ disk_path = Pathname.new file_disk
44
47
 
45
- unless File.exist?(file_disk)
48
+ unless disk_path.exist?
46
49
  Put.warn SubutaiDisk.message(grow_by)
47
50
 
48
51
  if has_grow
49
- if SubutaiDisk.hyperv_create_disk(grow_by, file_disk)
50
- SubutaiDisk.save_path(SubutaiDisk.port, file_disk)
52
+ if SubutaiDisk.hyperv_create_disk(grow_by, disk_path.to_s)
53
+ SubutaiDisk.save_path(SubutaiDisk.port, disk_path.to_s)
51
54
  SubutaiDisk.save_conf(grow_by)
52
55
  end
53
56
  end
57
+ else
58
+ Put.error "Disk file already exist in #{file_disk}"
59
+ end
60
+ end
61
+
62
+ # Create virtual disk for parallels
63
+ def parallels
64
+ has_grow, grow_by = SubutaiDisk.has_grow
65
+
66
+ if has_grow
67
+ if SubutaiDisk.parallels_create_disk(grow_by)
68
+ Put.warn SubutaiDisk.message(grow_by)
69
+ SubutaiDisk.save_conf(grow_by)
70
+ end
71
+ end
72
+ end
73
+
74
+ def provision
75
+ if SubutaiConfig.provider == :hyper_v
76
+ hyperv
77
+ elsif SubutaiConfig.provider == :parallels
78
+ parallels
54
79
  end
55
80
  end
56
81
 
@@ -1,17 +1,18 @@
1
1
  param (
2
2
  [string]$VmId = $(throw "-VmId is required."),
3
- [string]$DiskPath = $(throw "-DiskPath is required."),
3
+ [System.IO.DirectoryInfo]$DiskPath = $(throw "-DiskPath is required."),
4
4
  [Int32]$DiskSize = $(throw "-DiskSize is required.")
5
5
  )
6
6
 
7
7
  try {
8
8
  $vm = Get-VM -Id $VmId -ErrorAction "stop"
9
+ Write-Output $DiskPath.FullName
9
10
 
10
11
  # create new disk
11
12
  # converting GB to Byte
12
- NEW-VHD -Dynamic $DiskPath -SizeBytes $($DiskSize*1073741824)
13
+ NEW-VHD -Dynamic $DiskPath.FullName -SizeBytes $($DiskSize*1073741824)
13
14
  # attach new disk to VM
14
- ADD-VMHardDiskDrive -vmname $vm.Name -path $DiskPath -ControllerType SCSI
15
+ ADD-VMHardDiskDrive -vmname $vm.Name -path $DiskPath.FullName -ControllerType SCSI
15
16
  }
16
17
  catch {
17
18
  Write-Error-Message "Failed to create disk or attach to VM "
@@ -35,6 +35,7 @@ module SubutaiConfig
35
35
  SUBUTAI_MAN_TMPL
36
36
  APT_PROXY_URL
37
37
  PROVISION
38
+ BLUEPRINT_NO_AUTO
38
39
  BRIDGE
39
40
  AUTHORIZED_KEYS
40
41
  PASSWORD_OVERRIDE
@@ -47,6 +48,7 @@ module SubutaiConfig
47
48
  USER_VARIABLES
48
49
  BAZAAR_EMAIL
49
50
  BAZAAR_PASSWORD
51
+ BAZAAR_NO_AUTO
50
52
  SUBUTAI_DISK_PATH
51
53
  LIBVIRT_USER
52
54
  LIBVIRT_HOST
@@ -54,7 +56,6 @@ module SubutaiConfig
54
56
  LIBVIRT_MACVTAP
55
57
  LIBVIRT_NO_BRIDGE
56
58
  LIBVIRT_POOL
57
- BAZAAR_NO_AUTO
58
59
  SUBUTAI_DISK
59
60
  BRIDGE_VIRTUALBOX
60
61
  BRIDGE_PARALLELS
@@ -108,6 +109,7 @@ module SubutaiConfig
108
109
  BAZAAR_NO_AUTO: false, # PeerOs automatic registration to Bazaar (turn on(false), turn off(true))
109
110
  PROVISION: true, # to provision or not to
110
111
  LIBVIRT_POOL: 'default', # Libvirt pool name
112
+ BLUEPRINT_NO_AUTO: false, # Auto provision blueprints if present
111
113
 
112
114
  # Configuration parameters below have not been implemented
113
115
  SUBUTAI_DESKTOP: false, # install desktop with tray and p2p client
@@ -366,11 +368,16 @@ module SubutaiConfig
366
368
  end
367
369
 
368
370
  def self.machine_id(provider)
371
+ id = nil
372
+
369
373
  case provider
370
374
  when :hyper_v
371
- id = PARENT_DIR+'/machines/default/hyperv/id'
372
- File.read(id) if File.exist?(id)
375
+ id = File.join(PARENT_DIR, 'machines/default/hyperv/id')
376
+ when :parallels
377
+ id = File.join(PARENT_DIR, 'machines/default/parallels/id')
373
378
  end
379
+
380
+ File.read(id) if File.exist?(id)
374
381
  end
375
382
 
376
383
  # Loads the generated and user configuration from YAML files
@@ -1,5 +1,6 @@
1
1
  require_relative 'subutai_config'
2
2
  require_relative '../../../lib/vagrant-subutai/util/powershell'
3
+ require_relative '../../../lib/vagrant-subutai/util/terminal'
3
4
 
4
5
  # For managing VM disks
5
6
  module SubutaiDisk
@@ -89,7 +90,19 @@ module SubutaiDisk
89
90
  Put.error("[FAILED] Disk Creation. Not found machine id")
90
91
  false
91
92
  else
92
- VagrantSubutai::Util::Powershell.execute(script, "-VmId", id, "-DiskPath", file_disk, "-DiskSize", "#{vmware_size(grow_by)}")
93
+ VagrantSubutai::Util::Powershell.execute(script, "-VmId", id, "-DiskPath", "'#{file_disk}'", "-DiskSize", "#{vmware_size(grow_by)}")
94
+ end
95
+ end
96
+
97
+ def self.parallels_create_disk(grow_by)
98
+ id = SubutaiConfig.machine_id(:parallels)
99
+
100
+ if id.nil?
101
+ Put.error("[FAILED] Disk Creation. Not found machine id")
102
+ false
103
+ else
104
+ # prlctl set ec45bf0c-1d1e-44c0-b5b8-6d80623b8364 --device-add=hdd --size=4092 # in megabytes
105
+ VagrantSubutai::Util::Terminal.execute_cmd("prlctl", "set", id, "--device-add=hdd", "--size=#{SubutaiDisk.size(grow_by)}")
93
106
  end
94
107
  end
95
108
 
@@ -120,7 +133,7 @@ module SubutaiDisk
120
133
  end
121
134
 
122
135
  def self.message(grow_by)
123
- "==> default: Disk size configured to #{SubutaiConfig.get(:DISK_SIZE)}GB, increasing 100GB default by #{grow_by}GB."
136
+ "==> default: Disk size configured to #{SubutaiConfig.get(:DISK_SIZE)}GB, increasing #{SubutaiConfig.get(:DISK_SIZE) - grow_by}GB default by #{grow_by}GB."
124
137
  end
125
138
 
126
139
  # Gives disk file name
@@ -29,6 +29,8 @@ module SubutaiValidation
29
29
  "USER_VARIABLES": :json_object,
30
30
  "BAZAAR_EMAIL": :string,
31
31
  "BAZAAR_PASSWORD": :string,
32
+ "BAZAAR_NO_AUTO": :bool,
33
+ "BLUEPRINT_NO_AUTO": :bool,
32
34
  "SUBUTAI_DISK_PATH": :path,
33
35
  "LIBVIRT_USER": :string,
34
36
  "LIBVIRT_HOST": :string,
@@ -36,7 +38,6 @@ module SubutaiValidation
36
38
  "LIBVIRT_PORT": :int,
37
39
  "LIBVIRT_MACVTAP": :bool,
38
40
  "LIBVIRT_NO_BRIDGE": :bool,
39
- "BAZAAR_NO_AUTO": :bool,
40
41
  "BRIDGE_VIRTUALBOX": :string,
41
42
  "BRIDGE_PARALLELS": :string,
42
43
  "BRIDGE_VMWARE": :string,
@@ -39,18 +39,20 @@ module VagrantSubutai
39
39
  #
40
40
  # No return value is expected.
41
41
  def provision
42
- # If Subutai.json exist
43
- if File.exist?("#{Dir.pwd}/#{Configs::Blueprint::FILE_NAME}")
44
- subutai_cli = Commands.new(ARGV, @machine.env)
45
- ip = subutai_cli.info(Configs::VagrantCommand::ARG_IP_ADDR)
46
-
47
- if ip.nil?
48
- STDOUT.puts 'We can\'t detect your PeerOS ip address!'
49
- exit
50
- end
51
- url = "https://#{ip}:#{Configs::SubutaiConsoleAPI::PORT}"
42
+ unless SubutaiConfig.get(:BLUEPRINT_NO_AUTO)
43
+ # If Subutai.json exist
44
+ if File.exist?(File.join(Dir.pwd, Configs::Blueprint::FILE_NAME))
45
+ subutai_cli = Commands.new(ARGV, @machine.env)
46
+ ip = subutai_cli.info(Configs::VagrantCommand::ARG_IP_ADDR)
47
+
48
+ if ip.nil?
49
+ STDOUT.puts 'We can\'t detect your PeerOS ip address!'
50
+ exit
51
+ end
52
+ url = "https://#{ip}:#{Configs::SubutaiConsoleAPI::PORT}"
52
53
 
53
- subutai_cli.blueprint(url, 1)
54
+ subutai_cli.blueprint(url, 1)
55
+ end
54
56
  end
55
57
  end
56
58
 
@@ -1,3 +1,3 @@
1
1
  module VagrantSubutai
2
- VERSION = '7.0.6'
2
+ VERSION = '7.0.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-subutai
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.6
4
+ version: 7.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subutai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-17 00:00:00.000000000 Z
11
+ date: 2018-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler