vagrant-vmware-desktop 3.0.1 → 3.0.3
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/lib/vagrant-vmware-desktop/action/base_mac_to_ip.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/boot.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/check_existing_network.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/check_vmware.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/checkpoint.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/clear_shared_folders.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/common.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/compatibility.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/created.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/destroy.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/discard_suspended_state.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/export.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/fix_old_machine_id.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/forward_ports.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/halt.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/import.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/machine_lock.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/message_already_running.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/message_not_created.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/message_not_running.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/network.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/package_vagrantfile.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/prepare_forwarded_port_collision_params.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/prepare_nfs_settings.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/prepare_synced_folder_cleanup.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/prune_forwarded_ports.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/prune_nfs_exports.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/running.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/set_display_name.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/share_folders.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/snapshot_delete.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/snapshot_restore.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/snapshot_save.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/suspend.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/suspended.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/vmx_modify.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/wait_for_address.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/wait_for_communicator_compat.rb +3 -0
- data/lib/vagrant-vmware-desktop/action/wait_for_vmx_halt.rb +3 -0
- data/lib/vagrant-vmware-desktop/action.rb +3 -0
- data/lib/vagrant-vmware-desktop/cap/disk.rb +3 -0
- data/lib/vagrant-vmware-desktop/cap/provider.rb +3 -0
- data/lib/vagrant-vmware-desktop/cap/snapshot.rb +3 -0
- data/lib/vagrant-vmware-desktop/checkpoint_client.rb +3 -0
- data/lib/vagrant-vmware-desktop/config.rb +3 -0
- data/lib/vagrant-vmware-desktop/constants.rb +3 -0
- data/lib/vagrant-vmware-desktop/driver/base.rb +69 -9
- data/lib/vagrant-vmware-desktop/driver.rb +3 -0
- data/lib/vagrant-vmware-desktop/errors.rb +3 -0
- data/lib/vagrant-vmware-desktop/guest_cap/linux/mount_vmware_shared_folder.rb +3 -0
- data/lib/vagrant-vmware-desktop/guest_cap/linux/verify_vmware_hgfs.rb +3 -0
- data/lib/vagrant-vmware-desktop/helper/lock.rb +3 -0
- data/lib/vagrant-vmware-desktop/helper/routing_table.rb +3 -0
- data/lib/vagrant-vmware-desktop/helper/vagrant_utility.rb +3 -0
- data/lib/vagrant-vmware-desktop/plugin.rb +3 -0
- data/lib/vagrant-vmware-desktop/provider.rb +3 -0
- data/lib/vagrant-vmware-desktop/setup_plugin.rb +3 -0
- data/lib/vagrant-vmware-desktop/synced_folder.rb +3 -0
- data/lib/vagrant-vmware-desktop.rb +3 -0
- data/locales/en.yml +21 -6
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3275e668f048933faaa0b580297af432a0d64c88c0f810ba268cf010b5cf5fe
|
|
4
|
+
data.tar.gz: 72947322a3dbd3acd97879175f958b820c93df2bcbc683006888346c75c4262f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4a440f8e4e435ae93631aec1f91991079ac0247ed8506f009c915df69cf6c99fc9d11cfcb3d7d51fe0cd4de27f3e2c86c6a3957442cf7234e2b569a3523fcdc
|
|
7
|
+
data.tar.gz: ede75391f769645cc913e409042bd80c92718ec54f402af530974561f6bae90e9277152b9a8426df30d89d395e8171d3f93afe0278291c0b1299080f7d0b544a
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
|
2
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
|
|
1
4
|
require "fileutils"
|
|
2
5
|
require "ipaddr"
|
|
3
6
|
require "pathname"
|
|
@@ -18,9 +21,16 @@ module HashiCorp
|
|
|
18
21
|
# some shared common helpers.
|
|
19
22
|
class Base
|
|
20
23
|
|
|
24
|
+
SOURCE_VMXPATH_FILE_NAME = "source-vmx"
|
|
25
|
+
SOURCE_SNAPSHOT_FILE_NAME = "source-snapshot"
|
|
26
|
+
|
|
21
27
|
# Default NAT device when detection is unavailable
|
|
22
28
|
DEFAULT_NAT_DEVICE = "vmnet8".freeze
|
|
23
29
|
|
|
30
|
+
# Default NIC device when setting up network
|
|
31
|
+
DEFAULT_NIC_DEVICE="e1000e".freeze
|
|
32
|
+
|
|
33
|
+
# Number of bytes in disk sector
|
|
24
34
|
SECTOR_TO_BYTES = 512.freeze
|
|
25
35
|
|
|
26
36
|
# Vagrant utility version requirement which must be satisfied to properly
|
|
@@ -170,6 +180,34 @@ module HashiCorp
|
|
|
170
180
|
end
|
|
171
181
|
end
|
|
172
182
|
|
|
183
|
+
# Product type value used by vmrun based on platform and license
|
|
184
|
+
#
|
|
185
|
+
# @return [String] fusion, ws, or player
|
|
186
|
+
def product_type
|
|
187
|
+
return @product_type if @product_type
|
|
188
|
+
|
|
189
|
+
@logger.debug("determining product type")
|
|
190
|
+
case @product_name.downcase
|
|
191
|
+
when "workstation"
|
|
192
|
+
# If the license is standard, the type is player
|
|
193
|
+
if standard?
|
|
194
|
+
@logger.debug("workstation product with standard license: player")
|
|
195
|
+
@product_type = "player"
|
|
196
|
+
else
|
|
197
|
+
@logger.debug("workstation product with professional license: ws")
|
|
198
|
+
@product_type = "ws"
|
|
199
|
+
end
|
|
200
|
+
when "fusion"
|
|
201
|
+
@logger.debug("fusion product: fusion")
|
|
202
|
+
@product_type = "fusion"
|
|
203
|
+
else
|
|
204
|
+
@logger.debug("unknown product (#{@product_name}), defaulting: player")
|
|
205
|
+
@product_type = "player"
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@product_type
|
|
209
|
+
end
|
|
210
|
+
|
|
173
211
|
# @return [Boolean] using standard license
|
|
174
212
|
def standard?
|
|
175
213
|
!professional?
|
|
@@ -312,14 +350,24 @@ module HashiCorp
|
|
|
312
350
|
linked = false
|
|
313
351
|
end
|
|
314
352
|
|
|
353
|
+
# Sanity test
|
|
354
|
+
if !destination.directory?
|
|
355
|
+
raise Errors::CloneFolderNotFolder, path: destination.to_s
|
|
356
|
+
end
|
|
357
|
+
|
|
315
358
|
if linked
|
|
316
359
|
@logger.info("Cloning machine using VMware linked clones.")
|
|
317
360
|
# The filename of the resulting VMX
|
|
318
361
|
destination_vmx = destination.join(source_vmx.basename)
|
|
319
362
|
|
|
320
363
|
begin
|
|
364
|
+
snap_name = destination.basename
|
|
365
|
+
vmrun("snapshot", host_path(source_vmx), snap_name)
|
|
321
366
|
# Do a linked clone!
|
|
322
|
-
vmrun("clone", host_path(source_vmx), host_path(destination_vmx), "linked")
|
|
367
|
+
vmrun("clone", host_path(source_vmx), host_path(destination_vmx), "linked", "-snapshot=#{snap_name}")
|
|
368
|
+
# store the snapshot name
|
|
369
|
+
File.write(destination.join(SOURCE_SNAPSHOT_FILE_NAME).to_s, snap_name)
|
|
370
|
+
File.write(destination.join(SOURCE_VMXPATH_FILE_NAME).to_s, source_vmx.to_s)
|
|
323
371
|
# Common cleanup
|
|
324
372
|
rescue Errors::VMRunError => e
|
|
325
373
|
# Check if this version of VMware doesn't support linked clones
|
|
@@ -336,10 +384,6 @@ module HashiCorp
|
|
|
336
384
|
|
|
337
385
|
if !destination_vmx
|
|
338
386
|
@logger.info("Cloning machine using direct copy.")
|
|
339
|
-
# Sanity test
|
|
340
|
-
if !destination.directory?
|
|
341
|
-
raise Errors::CloneFolderNotFolder, path: destination.to_s
|
|
342
|
-
end
|
|
343
387
|
|
|
344
388
|
# Just copy over the files within the folder of the source
|
|
345
389
|
@logger.info("Cloning VM to #{destination}")
|
|
@@ -406,6 +450,21 @@ module HashiCorp
|
|
|
406
450
|
def delete
|
|
407
451
|
@logger.info("Deleting VM: #{@vm_dir}")
|
|
408
452
|
begin
|
|
453
|
+
snap_file = @vmx_path.parent.join(SOURCE_SNAPSHOT_FILE_NAME)
|
|
454
|
+
source_vmx_file = @vmx_path.parent.join(SOURCE_VMXPATH_FILE_NAME)
|
|
455
|
+
if snap_file.exist? && source_vmx_file.exist?
|
|
456
|
+
source_vmx = File.read(source_vmx_file.to_s)
|
|
457
|
+
snap_name = File.read(snap_file.to_s)
|
|
458
|
+
@logger.info("source snapshot name found, deleting snapshot (#{snap_name})")
|
|
459
|
+
begin
|
|
460
|
+
vmrun("deleteSnapshot", source_vmx, snap_name, "andDeleteChildren")
|
|
461
|
+
rescue Errors::VMRunError => err
|
|
462
|
+
# If we failed to remove the source snapshot, just log it and move on
|
|
463
|
+
@logger.warn("failed to remove source clone snapshot '#{snap_name}': #{err}")
|
|
464
|
+
end
|
|
465
|
+
else
|
|
466
|
+
@logger.debug("source snapshot information not found, ignoring")
|
|
467
|
+
end
|
|
409
468
|
@vm_dir.rmtree
|
|
410
469
|
rescue Errno::ENOTEMPTY
|
|
411
470
|
FileUtils.rm_rf(@vm_dir.to_s)
|
|
@@ -792,7 +851,7 @@ module HashiCorp
|
|
|
792
851
|
|
|
793
852
|
vmx["#{key}.present"] = "TRUE"
|
|
794
853
|
vmx["#{key}.connectiontype"] = adapter[:type].to_s
|
|
795
|
-
vmx["#{key}.virtualdev"] =
|
|
854
|
+
vmx["#{key}.virtualdev"] = DEFAULT_NIC_DEVICE
|
|
796
855
|
|
|
797
856
|
if adapter[:mac_address]
|
|
798
857
|
vmx["#{key}.addresstype"] = "static"
|
|
@@ -913,7 +972,7 @@ module HashiCorp
|
|
|
913
972
|
|
|
914
973
|
# This is called to do any message suppression if we need to.
|
|
915
974
|
def suppress_messages
|
|
916
|
-
if
|
|
975
|
+
if @product_name.downcase == "fusion"
|
|
917
976
|
contents = <<-DATA
|
|
918
977
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
919
978
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
@@ -1200,7 +1259,7 @@ module HashiCorp
|
|
|
1200
1259
|
command_opts = { :notify => [:stdout, :stderr] }
|
|
1201
1260
|
command_opts[:timeout] = opts[:timeout] if opts[:timeout]
|
|
1202
1261
|
|
|
1203
|
-
command = command.dup
|
|
1262
|
+
command = command.dup.map(&:to_s)
|
|
1204
1263
|
command << command_opts
|
|
1205
1264
|
|
|
1206
1265
|
|
|
@@ -1231,7 +1290,8 @@ module HashiCorp
|
|
|
1231
1290
|
# This executes the "vmrun" command with the given arguments.
|
|
1232
1291
|
def vmrun(*command)
|
|
1233
1292
|
begin
|
|
1234
|
-
|
|
1293
|
+
cmd = ["-T", product_type] + command
|
|
1294
|
+
vmexec(@vmrun_path, *cmd)
|
|
1235
1295
|
rescue Errors::VMExecError => e
|
|
1236
1296
|
raise Errors::VMRunError,
|
|
1237
1297
|
:command => e.extra_data[:command],
|
data/locales/en.yml
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
|
2
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
|
|
1
4
|
en:
|
|
2
5
|
hashicorp:
|
|
3
6
|
vagrant_vmware_desktop:
|
|
@@ -163,7 +166,9 @@ en:
|
|
|
163
166
|
to occur across several attempts, it may indicate a problem with the
|
|
164
167
|
base box being used. If this error occurs across multiple boxes, it
|
|
165
168
|
may indicate a VMware configuration problem. Persistent problems can
|
|
166
|
-
be reported to
|
|
169
|
+
be reported to:
|
|
170
|
+
|
|
171
|
+
https://github.com/hashicorp/vagrant-vmware-desktop/issues
|
|
167
172
|
clone_folder_exists: |-
|
|
168
173
|
The clone folder that Vagrant is attempting to use to import
|
|
169
174
|
the VMware box has existed repeatedly 10 times while generating
|
|
@@ -172,7 +177,9 @@ en:
|
|
|
172
177
|
to your system.
|
|
173
178
|
clone_folder_not_folder: |-
|
|
174
179
|
The clone directory given is not a directory. This is an internal
|
|
175
|
-
error and should be reported as a bug to
|
|
180
|
+
error and should be reported as a bug to:
|
|
181
|
+
|
|
182
|
+
https://github.com/hashicorp/vagrant-vmware-desktop/issues
|
|
176
183
|
|
|
177
184
|
Path: %{path}
|
|
178
185
|
disk_not_created: Disk %{name} not created!
|
|
@@ -536,7 +543,9 @@ en:
|
|
|
536
543
|
service key file. This error can occur if the Vagrant VMware Utility
|
|
537
544
|
has not yet been installed, or if it was installed incorrectly. If
|
|
538
545
|
this error persists after running the Vagrant VMware Utility installer
|
|
539
|
-
again, please
|
|
546
|
+
again, please open a new issue at:
|
|
547
|
+
|
|
548
|
+
https://github.com/hashicorp/vagrant-vmware-desktop/issues
|
|
540
549
|
|
|
541
550
|
Information about the Vagrant VMware Utility, including installation
|
|
542
551
|
instruction, can be found here:
|
|
@@ -550,7 +559,9 @@ en:
|
|
|
550
559
|
service key file. This error can occur if the Vagrant VMware Utility
|
|
551
560
|
has not yet been installed, or if it was installed incorrectly. If
|
|
552
561
|
this error persists after running the Vagrant VMware Utility installer
|
|
553
|
-
again, please
|
|
562
|
+
again, please open a new issue at:
|
|
563
|
+
|
|
564
|
+
https://github.com/hashicorp/vagrant-vmware-desktop/issues
|
|
554
565
|
|
|
555
566
|
Information about the Vagrant VMware Utility, including installation
|
|
556
567
|
instruction, can be found here:
|
|
@@ -583,11 +594,15 @@ en:
|
|
|
583
594
|
driver_api_request_unexpected_error: |-
|
|
584
595
|
Vagrant encountered an unexpected communications error with the
|
|
585
596
|
Vagrant VMware Utility driver. Please try to run the command
|
|
586
|
-
again. If this error persists, please
|
|
597
|
+
again. If this error persists, please open a new issue at:
|
|
598
|
+
|
|
599
|
+
https://github.com/hashicorp/vagrant-vmware-desktop/issues
|
|
587
600
|
driver_api_invalid_response: |-
|
|
588
601
|
Vagrant failed to properly process a result from the Vagrant VMware
|
|
589
602
|
Utility driver. Please try to run the command again. If this error
|
|
590
|
-
persists, please
|
|
603
|
+
persists, please open a new issue at:
|
|
604
|
+
|
|
605
|
+
https://github.com/hashicorp/vagrant-vmware-desktop/issues
|
|
591
606
|
driver_api_port_forward_list_error: |-
|
|
592
607
|
Failed to receive list of currently used VMware port forwards. The
|
|
593
608
|
reported cause for the error:
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vagrant-vmware-desktop
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vagrant Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-05-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Enables Vagrant to power VMware Workstation/Fusion machines.
|
|
14
14
|
email: vagrant@hashicorp.com
|
|
@@ -95,7 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: 1.3.6
|
|
97
97
|
requirements: []
|
|
98
|
-
|
|
98
|
+
rubyforge_project:
|
|
99
|
+
rubygems_version: 2.7.6
|
|
99
100
|
signing_key:
|
|
100
101
|
specification_version: 4
|
|
101
102
|
summary: Enables Vagrant to power VMware Workstation/Fusion machines.
|