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 +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/vagrant-subutai/create_disk.rb +29 -4
- data/lib/vagrant-subutai/packer/script/create_disk_and_attach.ps1 +4 -3
- data/lib/vagrant-subutai/packer/subutai_config.rb +10 -3
- data/lib/vagrant-subutai/packer/subutai_disk.rb +15 -2
- data/lib/vagrant-subutai/packer/subutai_validation.rb +2 -1
- data/lib/vagrant-subutai/provisioner.rb +13 -11
- data/lib/vagrant-subutai/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 467222653b28e1075f3be05f29f5c776ebbc94c3
|
4
|
+
data.tar.gz: c4f0d411f13d3966fe3c3767f407a5da49f5e396
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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,
|
50
|
-
SubutaiDisk.save_path(SubutaiDisk.port,
|
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
|
-
[
|
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
|
372
|
-
|
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
|
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
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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
|
-
|
54
|
+
subutai_cli.blueprint(url, 1)
|
55
|
+
end
|
54
56
|
end
|
55
57
|
end
|
56
58
|
|
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.
|
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-
|
11
|
+
date: 2018-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|