knife-vsphere 4.0.7 → 4.1.4
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/chef/knife/{base_vsphere_command.rb → helpers/base_vsphere_command.rb} +3 -3
- data/lib/chef/knife/{customization_helper.rb → helpers/customization_helper.rb} +0 -0
- data/lib/chef/knife/{search_helper.rb → helpers/search_helper.rb} +0 -0
- data/lib/chef/knife/vsphere_cluster_list.rb +5 -1
- data/lib/chef/knife/vsphere_cpu_ratio.rb +5 -1
- data/lib/chef/knife/vsphere_customization_list.rb +5 -1
- data/lib/chef/knife/vsphere_datastore_file.rb +5 -1
- data/lib/chef/knife/vsphere_datastore_list.rb +5 -1
- data/lib/chef/knife/vsphere_datastore_maxfree.rb +5 -1
- data/lib/chef/knife/vsphere_datastorecluster_list.rb +5 -1
- data/lib/chef/knife/vsphere_datastorecluster_maxfree.rb +5 -1
- data/lib/chef/knife/vsphere_folder_list.rb +5 -1
- data/lib/chef/knife/vsphere_hosts_list.rb +7 -3
- data/lib/chef/knife/vsphere_pool_list.rb +5 -1
- data/lib/chef/knife/vsphere_pool_query.rb +7 -4
- data/lib/chef/knife/vsphere_pool_show.rb +7 -4
- data/lib/chef/knife/vsphere_template_list.rb +7 -3
- data/lib/chef/knife/vsphere_vlan_create.rb +5 -1
- data/lib/chef/knife/vsphere_vlan_list.rb +5 -1
- data/lib/chef/knife/vsphere_vm_cdrom.rb +13 -9
- data/lib/chef/knife/vsphere_vm_clone.rb +17 -16
- data/lib/chef/knife/vsphere_vm_config.rb +7 -3
- data/lib/chef/knife/vsphere_vm_delete.rb +12 -8
- data/lib/chef/knife/vsphere_vm_disk_extend.rb +7 -3
- data/lib/chef/knife/vsphere_vm_disk_list.rb +7 -4
- data/lib/chef/knife/vsphere_vm_execute.rb +7 -4
- data/lib/chef/knife/vsphere_vm_find.rb +7 -3
- data/lib/chef/knife/vsphere_vm_list.rb +5 -1
- data/lib/chef/knife/vsphere_vm_markastemplate.rb +7 -3
- data/lib/chef/knife/vsphere_vm_migrate.rb +7 -3
- data/lib/chef/knife/vsphere_vm_move.rb +7 -3
- data/lib/chef/knife/vsphere_vm_net.rb +8 -3
- data/lib/chef/knife/vsphere_vm_network_add.rb +11 -4
- data/lib/chef/knife/vsphere_vm_network_delete.rb +7 -3
- data/lib/chef/knife/vsphere_vm_network_list.rb +7 -3
- data/lib/chef/knife/vsphere_vm_network_set.rb +7 -3
- data/lib/chef/knife/vsphere_vm_property_get.rb +8 -4
- data/lib/chef/knife/vsphere_vm_property_set.rb +9 -5
- data/lib/chef/knife/vsphere_vm_show.rb +8 -4
- data/lib/chef/knife/vsphere_vm_snapshot.rb +7 -3
- data/lib/chef/knife/vsphere_vm_state.rb +7 -3
- data/lib/chef/knife/vsphere_vm_toolsconfig.rb +8 -3
- data/lib/chef/knife/vsphere_vm_vmdk_add.rb +7 -3
- data/lib/chef/knife/vsphere_vm_vnc_set.rb +7 -3
- data/lib/chef/knife/vsphere_vm_wait_sysprep.rb +11 -6
- data/lib/knife-vsphere/version.rb +1 -1
- metadata +8 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b3da3f22e30951524d12b891b2a9b8453530c67c889eb4072db702a628d8228
|
4
|
+
data.tar.gz: bd700fdf09e80f68913538e31e4e0d7932c6f655f3da97326483f8d2e07063bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3e90db9d4a8d421d4796eb6f76adf6534c312403c2bba379acd4ab7ef80088eb12ada90d8475e494493543ff5bf7138e0f622ea17e47fc3fceaf69051350470
|
7
|
+
data.tar.gz: 38b4ad4dbd307fb243efd6c9e46d4ddafbd84eb3f92d608cae87ab71702e886508192f089be35bb26f7a8c867995fe69d2d3459162cb56d219694a2b93aae826
|
@@ -5,9 +5,6 @@
|
|
5
5
|
#
|
6
6
|
|
7
7
|
require "chef/knife"
|
8
|
-
require "rbvmomi"
|
9
|
-
require "base64"
|
10
|
-
require "filesize"
|
11
8
|
require "chef/knife/bootstrap"
|
12
9
|
|
13
10
|
# Power state on
|
@@ -24,7 +21,10 @@ class Chef
|
|
24
21
|
# Main knife vsphere that more or less everything in this gem is built off of
|
25
22
|
class BaseVsphereCommand < Chef::Knife::Bootstrap
|
26
23
|
deps do
|
24
|
+
require "rbvmomi"
|
27
25
|
Chef::Knife::Bootstrap.load_deps
|
26
|
+
require "base64"
|
27
|
+
require "filesize"
|
28
28
|
require "socket"
|
29
29
|
require "net/ssh/multi"
|
30
30
|
require "readline"
|
File without changes
|
File without changes
|
@@ -4,12 +4,16 @@
|
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
require "chef/knife"
|
7
|
-
|
7
|
+
require_relative "helpers/base_vsphere_command"
|
8
8
|
|
9
9
|
# Lists all known clusters in the configured datacenter
|
10
10
|
class Chef::Knife::VsphereClusterList < Chef::Knife::BaseVsphereCommand
|
11
11
|
banner "knife vsphere cluster list"
|
12
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
end
|
16
|
+
|
13
17
|
common_options
|
14
18
|
|
15
19
|
def traverse_folders(folder)
|
@@ -1,10 +1,14 @@
|
|
1
1
|
require "chef/knife"
|
2
|
-
|
2
|
+
require_relative "helpers/base_vsphere_command"
|
3
3
|
|
4
4
|
# VsphereCpuratio extends the BaseVspherecommand
|
5
5
|
class Chef::Knife::VsphereCpuRatio < Chef::Knife::BaseVsphereCommand
|
6
6
|
banner "knife vsphere cpu ratio [CLUSTER] [HOST]"
|
7
7
|
|
8
|
+
deps do
|
9
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
10
|
+
end
|
11
|
+
|
8
12
|
common_options
|
9
13
|
|
10
14
|
# The main run method for cpu_ratio
|
@@ -3,13 +3,17 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
7
7
|
|
8
8
|
# Lists all customization specifications in the configured datacenter
|
9
9
|
# VsphereCustomizationlist extends the BaseVspherecommand
|
10
10
|
class Chef::Knife::VsphereCustomizationList < Chef::Knife::BaseVsphereCommand
|
11
11
|
banner "knife vsphere customization list"
|
12
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
end
|
16
|
+
|
13
17
|
common_options
|
14
18
|
|
15
19
|
# The main run method for customization_list
|
@@ -1,12 +1,16 @@
|
|
1
1
|
|
2
2
|
require "chef/knife"
|
3
|
-
|
3
|
+
require_relative "helpers/base_vsphere_command"
|
4
4
|
|
5
5
|
# Upload or download a file from a datastore
|
6
6
|
# VsphereDatastoreFile extends the BaseVspherecommand
|
7
7
|
class Chef::Knife::VsphereDatastoreFile < Chef::Knife::BaseVsphereCommand
|
8
8
|
banner "knife vsphere datastore file"
|
9
9
|
|
10
|
+
deps do
|
11
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
12
|
+
end
|
13
|
+
|
10
14
|
common_options
|
11
15
|
|
12
16
|
option :local_file,
|
@@ -16,13 +16,17 @@
|
|
16
16
|
# PERFORMANCE OF THIS SOFTWARE
|
17
17
|
|
18
18
|
require "chef/knife"
|
19
|
-
|
19
|
+
require_relative "helpers/base_vsphere_command"
|
20
20
|
|
21
21
|
# Lists all known data stores in datacenter with sizes
|
22
22
|
# VsphereDatastorelist extends the BaseVspherecommand
|
23
23
|
class Chef::Knife::VsphereDatastoreList < Chef::Knife::BaseVsphereCommand
|
24
24
|
banner "knife vsphere datastore list"
|
25
25
|
|
26
|
+
deps do
|
27
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
28
|
+
end
|
29
|
+
|
26
30
|
common_options
|
27
31
|
|
28
32
|
option :list,
|
@@ -16,13 +16,17 @@
|
|
16
16
|
# PERFORMANCE OF THIS SOFTWARE
|
17
17
|
|
18
18
|
require "chef/knife"
|
19
|
-
|
19
|
+
require_relative "helpers/base_vsphere_command"
|
20
20
|
|
21
21
|
# Gets the data store with the most free space in datacenter
|
22
22
|
# VsphereDatastoreMaxfree extends the BaseVspherecommand
|
23
23
|
class Chef::Knife::VsphereDatastoreMaxfree < Chef::Knife::BaseVsphereCommand
|
24
24
|
banner "knife vsphere datastore maxfree"
|
25
25
|
|
26
|
+
deps do
|
27
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
28
|
+
end
|
29
|
+
|
26
30
|
option :regex,
|
27
31
|
short: "-r REGEX",
|
28
32
|
long: "--regex REGEX",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# PERFORMANCE OF THIS SOFTWARE
|
17
17
|
|
18
18
|
require "chef/knife"
|
19
|
-
|
19
|
+
require_relative "helpers/base_vsphere_command"
|
20
20
|
|
21
21
|
def number_to_human_size(number)
|
22
22
|
number = number.to_f
|
@@ -56,6 +56,10 @@ end
|
|
56
56
|
class Chef::Knife::VsphereDatastoreclusterList < Chef::Knife::BaseVsphereCommand
|
57
57
|
banner "knife vsphere datastorecluster list"
|
58
58
|
|
59
|
+
deps do
|
60
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
61
|
+
end
|
62
|
+
|
59
63
|
common_options
|
60
64
|
|
61
65
|
def run
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# PERFORMANCE OF THIS SOFTWARE
|
17
17
|
|
18
18
|
require "chef/knife"
|
19
|
-
|
19
|
+
require_relative "helpers/base_vsphere_command"
|
20
20
|
|
21
21
|
def max_dscluster(dscluster, max_dscluster)
|
22
22
|
return true unless max_dscluster
|
@@ -47,6 +47,10 @@ end
|
|
47
47
|
class Chef::Knife::VsphereDatastoreclusterMaxfree < Chef::Knife::BaseVsphereCommand
|
48
48
|
banner "knife vsphere datastorecluster maxfree"
|
49
49
|
|
50
|
+
deps do
|
51
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
52
|
+
end
|
53
|
+
|
50
54
|
option :regex,
|
51
55
|
short: "-r REGEX",
|
52
56
|
long: "--regex REGEX",
|
@@ -3,13 +3,17 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
7
7
|
|
8
8
|
# Lists all vm folders
|
9
9
|
# VsphereFolderlist extends the BaseVspherecommand
|
10
10
|
class Chef::Knife::VsphereFolderList < Chef::Knife::BaseVsphereCommand
|
11
11
|
banner "knife vsphere folder list"
|
12
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
end
|
16
|
+
|
13
17
|
common_options
|
14
18
|
|
15
19
|
# Walks though the folders to find something
|
@@ -1,14 +1,18 @@
|
|
1
1
|
require "chef/knife"
|
2
|
-
|
3
|
-
require "rbvmomi"
|
4
|
-
require "netaddr"
|
2
|
+
require_relative "helpers/base_vsphere_command"
|
5
3
|
|
6
4
|
# list hosts belonging to pool
|
7
5
|
# VsphereHostslist extends the BaseVspherecommand
|
8
6
|
class Chef::Knife::VsphereHostsList < Chef::Knife::BaseVsphereCommand
|
9
7
|
banner "knife vsphere hosts list"
|
10
8
|
|
9
|
+
deps do
|
10
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
11
|
+
require "netaddr"
|
12
|
+
end
|
13
|
+
|
11
14
|
common_options
|
15
|
+
|
12
16
|
option :pool,
|
13
17
|
long: "--pool pool",
|
14
18
|
short: "-h",
|
@@ -3,12 +3,16 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
7
7
|
|
8
8
|
# Lists all known pools in the configured datacenter
|
9
9
|
class Chef::Knife::VspherePoolList < Chef::Knife::BaseVsphereCommand
|
10
10
|
banner "knife vsphere pool list"
|
11
11
|
|
12
|
+
deps do
|
13
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
14
|
+
end
|
15
|
+
|
12
16
|
common_options
|
13
17
|
|
14
18
|
def traverse_folders(folder)
|
@@ -1,11 +1,14 @@
|
|
1
1
|
require "chef/knife"
|
2
|
-
|
3
|
-
require "rbvmomi"
|
4
|
-
require "netaddr"
|
2
|
+
require_relative "helpers/base_vsphere_command"
|
5
3
|
|
6
4
|
# VspherePoolQuery extends the BaseVsphereCommand
|
7
5
|
class Chef::Knife::VspherePoolQuery < Chef::Knife::BaseVsphereCommand
|
8
|
-
banner 'knife vsphere pool query POOLNAME QUERY.
|
6
|
+
banner 'knife vsphere pool query POOLNAME QUERY. See "https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.ComputeResource.html" for allowed QUERY values.'
|
7
|
+
|
8
|
+
deps do
|
9
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
10
|
+
require "netaddr"
|
11
|
+
end
|
9
12
|
|
10
13
|
common_options
|
11
14
|
|
@@ -1,10 +1,13 @@
|
|
1
1
|
require "chef/knife"
|
2
|
-
|
3
|
-
require "rbvmomi"
|
4
|
-
require "netaddr"
|
2
|
+
require_relative "helpers/base_vsphere_command"
|
5
3
|
|
6
4
|
class Chef::Knife::VspherePoolShow < Chef::Knife::BaseVsphereCommand
|
7
|
-
banner 'knife vsphere pool show POOLNAME QUERY.
|
5
|
+
banner 'knife vsphere pool show POOLNAME QUERY. See "https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.ComputeResource.html" for allowed QUERY values.'
|
6
|
+
|
7
|
+
deps do
|
8
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
9
|
+
require "netaddr"
|
10
|
+
end
|
8
11
|
|
9
12
|
common_options
|
10
13
|
|
@@ -4,15 +4,19 @@
|
|
4
4
|
#
|
5
5
|
|
6
6
|
require "chef/knife"
|
7
|
-
|
8
|
-
require "chef/knife/search_helper"
|
7
|
+
require_relative "helpers/base_vsphere_command"
|
9
8
|
|
10
9
|
# Lists all known VM templates in the configured datacenter
|
11
10
|
# VsphereTemplatelist extends the BaseVspherecommand
|
12
11
|
class Chef::Knife::VsphereTemplateList < Chef::Knife::BaseVsphereCommand
|
13
|
-
include SearchHelper
|
14
12
|
banner "knife vsphere template list"
|
15
13
|
|
14
|
+
deps do
|
15
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
16
|
+
require_relative "helpers/search_helper"
|
17
|
+
include SearchHelper
|
18
|
+
end
|
19
|
+
|
16
20
|
common_options
|
17
21
|
|
18
22
|
# The main run method for template_list
|
@@ -1,11 +1,15 @@
|
|
1
1
|
require "chef/knife"
|
2
|
-
|
2
|
+
require_relative "helpers/base_vsphere_command"
|
3
3
|
|
4
4
|
# Lists all known data stores in datacenter with sizes
|
5
5
|
# VsphereVlanCreate extends BaseVspherecommand
|
6
6
|
class Chef::Knife::VsphereVlanCreate < Chef::Knife::BaseVsphereCommand
|
7
7
|
banner "knife vsphere vlan create NAME VID"
|
8
8
|
|
9
|
+
deps do
|
10
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
11
|
+
end
|
12
|
+
|
9
13
|
common_options
|
10
14
|
|
11
15
|
option :switch,
|
@@ -15,13 +15,17 @@
|
|
15
15
|
# PERFORMANCE OF THIS SOFTWARE
|
16
16
|
|
17
17
|
require "chef/knife"
|
18
|
-
|
18
|
+
require_relative "helpers/base_vsphere_command"
|
19
19
|
|
20
20
|
# Lists all known data stores in datacenter with sizes
|
21
21
|
# VsphereVlanlist extends the BaseVspherecommand
|
22
22
|
class Chef::Knife::VsphereVlanList < Chef::Knife::BaseVsphereCommand
|
23
23
|
banner "knife vsphere vlan list"
|
24
24
|
|
25
|
+
deps do
|
26
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
27
|
+
end
|
28
|
+
|
25
29
|
common_options
|
26
30
|
|
27
31
|
# The main run method for vlan_list
|
@@ -1,14 +1,18 @@
|
|
1
1
|
# License:: Apache License, Version 2.0
|
2
2
|
|
3
3
|
require "chef/knife"
|
4
|
-
|
5
|
-
require "chef/knife/search_helper"
|
4
|
+
require_relative "helpers/base_vsphere_command"
|
6
5
|
|
7
6
|
# VsphereVmCdrom extends the BaseVspherecommand
|
8
7
|
class Chef::Knife::VsphereVmCdrom < Chef::Knife::BaseVsphereCommand
|
9
|
-
include SearchHelper
|
10
8
|
banner "knife vsphere vm cdrom VMNAME (options)"
|
11
9
|
|
10
|
+
deps do
|
11
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
12
|
+
require_relative "helpers/search_helper"
|
13
|
+
include SearchHelper
|
14
|
+
end
|
15
|
+
|
12
16
|
# The empty device name.
|
13
17
|
EMPTY_DEVICE_NAME ||= "".freeze
|
14
18
|
|
@@ -66,15 +70,15 @@ class Chef::Knife::VsphereVmCdrom < Chef::Knife::BaseVsphereCommand
|
|
66
70
|
|
67
71
|
vm = get_vm_by_name(vmname, get_config(:folder)) || fatal_exit("Could not find #{vmname}")
|
68
72
|
|
69
|
-
cdrom_obj = vm.config.hardware.device.find { |hw| hw.class == RbVmomi::VIM::VirtualCdrom }
|
73
|
+
cdrom_obj = vm.config.hardware.device.find { |hw| hw.class == ::RbVmomi::VIM::VirtualCdrom }
|
70
74
|
fatal_exit "Could not find a cd drive" unless cdrom_obj
|
71
75
|
|
72
76
|
backing = if get_config(:attach)
|
73
|
-
RbVmomi::VIM::VirtualCdromIsoBackingInfo(
|
77
|
+
::RbVmomi::VIM::VirtualCdromIsoBackingInfo(
|
74
78
|
fileName: iso_path
|
75
79
|
)
|
76
80
|
else
|
77
|
-
RbVmomi::VIM::VirtualCdromRemoteAtapiBackingInfo(deviceName: EMPTY_DEVICE_NAME)
|
81
|
+
::RbVmomi::VIM::VirtualCdromRemoteAtapiBackingInfo(deviceName: EMPTY_DEVICE_NAME)
|
78
82
|
end
|
79
83
|
|
80
84
|
vm.ReconfigVM_Task(
|
@@ -85,14 +89,14 @@ class Chef::Knife::VsphereVmCdrom < Chef::Knife::BaseVsphereCommand
|
|
85
89
|
private
|
86
90
|
|
87
91
|
def spec(cd_device, backing)
|
88
|
-
RbVmomi::VIM::VirtualMachineConfigSpec(
|
92
|
+
::RbVmomi::VIM::VirtualMachineConfigSpec(
|
89
93
|
deviceChange: [{
|
90
94
|
operation: :edit,
|
91
|
-
device: RbVmomi::VIM::VirtualCdrom(
|
95
|
+
device: ::RbVmomi::VIM::VirtualCdrom(
|
92
96
|
backing: backing,
|
93
97
|
key: cd_device.key,
|
94
98
|
controllerKey: cd_device.controllerKey,
|
95
|
-
connectable: RbVmomi::VIM::VirtualDeviceConnectInfo(
|
99
|
+
connectable: ::RbVmomi::VIM::VirtualDeviceConnectInfo(
|
96
100
|
startConnected: get_config(:on_boot) || false,
|
97
101
|
connected: get_config(:attach) || false,
|
98
102
|
allowGuestControl: true
|
@@ -7,17 +7,26 @@
|
|
7
7
|
#
|
8
8
|
|
9
9
|
require "chef/knife"
|
10
|
-
|
11
|
-
require "chef/knife/customization_helper"
|
12
|
-
require "chef/knife/search_helper"
|
13
|
-
require "ipaddr"
|
14
|
-
require "netaddr"
|
15
|
-
require "securerandom"
|
10
|
+
require_relative "helpers/base_vsphere_command"
|
16
11
|
|
17
12
|
# VsphereVmClone extends the BaseVspherecommand
|
18
13
|
class Chef::Knife::VsphereVmClone < Chef::Knife::BaseVsphereCommand
|
19
14
|
banner "knife vsphere vm clone VMNAME (options)"
|
20
15
|
|
16
|
+
deps do
|
17
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
18
|
+
require "ipaddr"
|
19
|
+
require "netaddr"
|
20
|
+
require "securerandom"
|
21
|
+
require "chef/json_compat"
|
22
|
+
|
23
|
+
require_relative "helpers/search_helper"
|
24
|
+
include SearchHelper
|
25
|
+
|
26
|
+
require_relative "helpers/customization_helper"
|
27
|
+
include CustomizationHelper
|
28
|
+
end
|
29
|
+
|
21
30
|
# A AUTO_MAC for NIC?
|
22
31
|
AUTO_MAC ||= "auto".freeze
|
23
32
|
# A NO IP for you to use!
|
@@ -25,14 +34,6 @@ class Chef::Knife::VsphereVmClone < Chef::Knife::BaseVsphereCommand
|
|
25
34
|
# a linklayer origin is an actual nic
|
26
35
|
ORIGIN_IS_REAL_NIC ||= "linklayer".freeze
|
27
36
|
|
28
|
-
# include Chef::Knife::WinrmBase
|
29
|
-
include CustomizationHelper
|
30
|
-
include SearchHelper
|
31
|
-
deps do
|
32
|
-
require "chef/json_compat"
|
33
|
-
Chef::Knife::Bootstrap.load_deps
|
34
|
-
end
|
35
|
-
|
36
37
|
common_options
|
37
38
|
|
38
39
|
option :dest_folder,
|
@@ -83,7 +84,7 @@ class Chef::Knife::VsphereVmClone < Chef::Knife::BaseVsphereCommand
|
|
83
84
|
|
84
85
|
option :customization_plugin_data,
|
85
86
|
long: "--cplugin-data CUST_PLUGIN_DATA",
|
86
|
-
description: "String of data to pass to the plugin.
|
87
|
+
description: "String of data to pass to the plugin. Use any format you wish."
|
87
88
|
|
88
89
|
option :customization_vlan,
|
89
90
|
long: "--cvlan CUST_VLANS",
|
@@ -715,7 +716,7 @@ class Chef::Knife::VsphereVmClone < Chef::Knife::BaseVsphereCommand
|
|
715
716
|
if @customization_plugin.respond_to?(:data=)
|
716
717
|
@customization_plugin.data = cplugin_data
|
717
718
|
else
|
718
|
-
abort "Customization plugin has no :data= accessor to receive the --cplugin-data argument.
|
719
|
+
abort "Customization plugin has no :data= accessor to receive the --cplugin-data argument. Define both or neither."
|
719
720
|
end
|
720
721
|
end
|
721
722
|
else
|
@@ -2,16 +2,20 @@
|
|
2
2
|
# License:: Apache License, Version 2.0
|
3
3
|
|
4
4
|
require "chef/knife"
|
5
|
-
|
6
|
-
require "chef/knife/search_helper"
|
5
|
+
require_relative "helpers/base_vsphere_command"
|
7
6
|
|
8
7
|
# VsphereVMconfig extends the BaseVspherecommand
|
9
8
|
class Chef::Knife::VsphereVmConfig < Chef::Knife::BaseVsphereCommand
|
10
|
-
include SearchHelper
|
11
9
|
banner "knife vsphere vm config VMNAME PROPERTY VALUE (PROPERTY VALUE)...
|
12
10
|
See \"https://www.vmware.com/support/developer/converter-sdk/conv60_apireference/vim.vm.ConfigSpec.html\"
|
13
11
|
for allowed ATTRIBUTE values (any property of type xs:string is supported)."
|
14
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
require_relative "helpers/search_helper"
|
16
|
+
include SearchHelper
|
17
|
+
end
|
18
|
+
|
15
19
|
common_options
|
16
20
|
|
17
21
|
# The main run method in vm_config
|
@@ -4,20 +4,24 @@
|
|
4
4
|
#
|
5
5
|
|
6
6
|
require "chef/knife"
|
7
|
-
|
8
|
-
require "chef/knife/search_helper"
|
9
|
-
require "rbvmomi"
|
10
|
-
|
11
|
-
# These two are needed for the '--purge' deletion case
|
12
|
-
require "chef/node"
|
13
|
-
require "chef/api_client"
|
7
|
+
require_relative "helpers/base_vsphere_command"
|
14
8
|
|
15
9
|
# Delete a virtual machine from vCenter
|
16
10
|
# VsphereVmDelete extends the BaseVspherecommand
|
17
11
|
class Chef::Knife::VsphereVmDelete < Chef::Knife::BaseVsphereCommand
|
18
|
-
include SearchHelper
|
19
12
|
banner "knife vsphere vm delete VMNAME (options)"
|
20
13
|
|
14
|
+
deps do
|
15
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
16
|
+
require_relative "helpers/search_helper"
|
17
|
+
include SearchHelper
|
18
|
+
|
19
|
+
# These two are needed for the '--purge' deletion case
|
20
|
+
require "chef/node"
|
21
|
+
require "chef/api_client"
|
22
|
+
require "rbvmomi"
|
23
|
+
end
|
24
|
+
|
21
25
|
option :purge,
|
22
26
|
short: "-P",
|
23
27
|
long: "--purge",
|
@@ -4,13 +4,17 @@
|
|
4
4
|
#
|
5
5
|
|
6
6
|
require "chef/knife"
|
7
|
-
|
8
|
-
require "chef/knife/search_helper"
|
7
|
+
require_relative "helpers/base_vsphere_command"
|
9
8
|
|
10
9
|
class Chef::Knife::VsphereVmDiskExtend < Chef::Knife::BaseVsphereCommand
|
11
|
-
include SearchHelper
|
12
10
|
banner "knife vsphere vm disk extend VMNAME SIZE. Extends the disk of vm VMNAME to SIZE kilobytes."
|
13
11
|
|
12
|
+
deps do
|
13
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
14
|
+
require_relative "helpers/search_helper"
|
15
|
+
include SearchHelper
|
16
|
+
end
|
17
|
+
|
14
18
|
common_options
|
15
19
|
|
16
20
|
option :diskname,
|
@@ -1,14 +1,17 @@
|
|
1
1
|
require "chef/knife"
|
2
|
-
|
3
|
-
require "chef/knife/search_helper"
|
2
|
+
require_relative "helpers/base_vsphere_command"
|
4
3
|
|
5
4
|
# List the disks attached to a VM
|
6
5
|
# VsphereVmdisklist extends the BaseVspherecommand
|
7
6
|
class Chef::Knife::VsphereVmDiskList < Chef::Knife::BaseVsphereCommand
|
8
|
-
include SearchHelper
|
9
|
-
|
10
7
|
banner "knife vsphere vm disk list VMNAME"
|
11
8
|
|
9
|
+
deps do
|
10
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
11
|
+
require_relative "helpers/search_helper"
|
12
|
+
include SearchHelper
|
13
|
+
end
|
14
|
+
|
12
15
|
common_options
|
13
16
|
|
14
17
|
# The main run method for vm_disk_list
|
@@ -2,15 +2,18 @@
|
|
2
2
|
# License:: Apache License, Version 2.0
|
3
3
|
|
4
4
|
require "chef/knife"
|
5
|
-
|
6
|
-
require "chef/knife/search_helper"
|
5
|
+
require_relative "helpers/base_vsphere_command"
|
7
6
|
|
8
7
|
# VsphereVMexecute extends the Basevspherecommand
|
9
8
|
class Chef::Knife::VsphereVmExecute < Chef::Knife::BaseVsphereCommand
|
10
|
-
include SearchHelper
|
11
|
-
|
12
9
|
banner "knife vsphere vm execute VMNAME COMMAND ARGS"
|
13
10
|
|
11
|
+
deps do
|
12
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
13
|
+
require_relative "helpers/search_helper"
|
14
|
+
include SearchHelper
|
15
|
+
end
|
16
|
+
|
14
17
|
option :exec_user,
|
15
18
|
long: "--exec-user USER",
|
16
19
|
description: "User to execute as",
|
@@ -3,14 +3,18 @@
|
|
3
3
|
#
|
4
4
|
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# find vms belonging to pool that match criteria, display specified fields
|
10
9
|
class Chef::Knife::VsphereVmFind < Chef::Knife::BaseVsphereCommand
|
11
|
-
include SearchHelper
|
12
10
|
banner "knife vsphere vm find"
|
13
11
|
|
12
|
+
deps do
|
13
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
14
|
+
require_relative "helpers/search_helper"
|
15
|
+
include SearchHelper
|
16
|
+
end
|
17
|
+
|
14
18
|
VMFOLDER ||= "vm".freeze
|
15
19
|
|
16
20
|
common_options
|
@@ -3,12 +3,16 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
7
7
|
|
8
8
|
# Lists all known virtual machines in the configured datacenter
|
9
9
|
class Chef::Knife::VsphereVmList < Chef::Knife::BaseVsphereCommand
|
10
10
|
banner "knife vsphere vm list"
|
11
11
|
|
12
|
+
deps do
|
13
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
14
|
+
end
|
15
|
+
|
12
16
|
common_options
|
13
17
|
|
14
18
|
option :recursive,
|
@@ -7,17 +7,21 @@
|
|
7
7
|
#
|
8
8
|
|
9
9
|
require "chef/knife"
|
10
|
-
|
11
|
-
require "chef/knife/search_helper"
|
10
|
+
require_relative "helpers/base_vsphere_command"
|
12
11
|
|
13
12
|
# Clone an existing template into a new VM, optionally applying a customization specification.
|
14
13
|
# usage:
|
15
14
|
# knife vsphere vm markastemplate MyVM --folder /templates
|
16
15
|
# Vspherevmmarkastemplate extends the Basevspherecommand
|
17
16
|
class Chef::Knife::VsphereVmMarkastemplate < Chef::Knife::BaseVsphereCommand
|
18
|
-
include SearchHelper
|
19
17
|
banner "knife vsphere vm markastemplate VMNAME"
|
20
18
|
|
19
|
+
deps do
|
20
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
21
|
+
require_relative "helpers/search_helper"
|
22
|
+
include SearchHelper
|
23
|
+
end
|
24
|
+
|
21
25
|
common_options
|
22
26
|
|
23
27
|
# The main run method for vm_markastemplate
|
@@ -3,15 +3,19 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# migrate vm to specified resource pool , datastore and host
|
10
9
|
class Chef::Knife::VsphereVmMigrate < Chef::Knife::BaseVsphereCommand
|
11
|
-
include SearchHelper
|
12
10
|
# migrate --resource-pool --dest-host --dest-datastore
|
13
11
|
banner "knife vsphere vm migrate VMNAME (options)"
|
14
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
require_relative "helpers/search_helper"
|
16
|
+
include SearchHelper
|
17
|
+
end
|
18
|
+
|
15
19
|
common_options
|
16
20
|
|
17
21
|
option :dest_host,
|
@@ -3,15 +3,19 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# Moves the VM to another folder or datastore
|
10
9
|
# VsphereVmMove extends the BaseVspherecommand
|
11
10
|
class Chef::Knife::VsphereVmMove < Chef::Knife::BaseVsphereCommand
|
12
|
-
include SearchHelper
|
13
11
|
banner "knife vsphere vm move VMNAME"
|
14
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
require_relative "helpers/search_helper"
|
16
|
+
include SearchHelper
|
17
|
+
end
|
18
|
+
|
15
19
|
common_options
|
16
20
|
|
17
21
|
option :dest_name,
|
@@ -3,14 +3,19 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# Switch VM networking state up/down (on all network interfaces)
|
10
9
|
# VsphereVmNet extends the BaseVspherecommand
|
11
10
|
class Chef::Knife::VsphereVmNet < Chef::Knife::BaseVsphereCommand
|
12
|
-
include SearchHelper
|
13
11
|
banner "knife vsphere vm net STATE VMNAME"
|
12
|
+
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
require_relative "helpers/search_helper"
|
16
|
+
include SearchHelper
|
17
|
+
end
|
18
|
+
|
14
19
|
common_options
|
15
20
|
|
16
21
|
# The main run method for vm_net
|
@@ -3,14 +3,17 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
8
|
-
require "netaddr"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
9
7
|
|
10
8
|
class Chef::Knife::VsphereVmNetworkAdd < Chef::Knife::BaseVsphereCommand
|
11
|
-
include SearchHelper
|
12
9
|
banner "knife vsphere vm network add VMNAME NETWORKNAME"
|
13
10
|
|
11
|
+
deps do
|
12
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
13
|
+
require_relative "helpers/search_helper"
|
14
|
+
include SearchHelper
|
15
|
+
end
|
16
|
+
|
14
17
|
option :adapter_type,
|
15
18
|
long: "--adapter-type STRING",
|
16
19
|
description: "Adapter type eg e1000,vmxnet3",
|
@@ -21,6 +24,10 @@ class Chef::Knife::VsphereVmNetworkAdd < Chef::Knife::BaseVsphereCommand
|
|
21
24
|
description: "Adapter MAC address eg. AA:BB:CC:DD:EE:FF",
|
22
25
|
required: false
|
23
26
|
|
27
|
+
deps do
|
28
|
+
require "netaddr"
|
29
|
+
end
|
30
|
+
|
24
31
|
common_options
|
25
32
|
|
26
33
|
def run
|
@@ -3,13 +3,17 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
class Chef::Knife::VsphereVmNetworkDelete < Chef::Knife::BaseVsphereCommand
|
10
|
-
include SearchHelper
|
11
9
|
banner "knife vsphere vm network delete VMNAME NICNAME"
|
12
10
|
|
11
|
+
deps do
|
12
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
13
|
+
require_relative "helpers/search_helper"
|
14
|
+
include SearchHelper
|
15
|
+
end
|
16
|
+
|
13
17
|
common_options
|
14
18
|
|
15
19
|
def run
|
@@ -3,14 +3,18 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# VsphereVmNetworklist extends the BaseVspherecommand
|
10
9
|
class Chef::Knife::VsphereVmNetworkList < Chef::Knife::BaseVsphereCommand
|
11
|
-
include SearchHelper
|
12
10
|
banner "knife vsphere vm network list VMNAME"
|
13
11
|
|
12
|
+
deps do
|
13
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
14
|
+
require_relative "helpers/search_helper"
|
15
|
+
include SearchHelper
|
16
|
+
end
|
17
|
+
|
14
18
|
common_options
|
15
19
|
|
16
20
|
# The main run method for vm_network_list
|
@@ -3,15 +3,19 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# Changes network on a certain VM
|
10
9
|
# VsphereVmNetworkSet extends the BaseVspherecommand
|
11
10
|
class Chef::Knife::VsphereVmNetworkSet < Chef::Knife::BaseVsphereCommand
|
12
|
-
include SearchHelper
|
13
11
|
banner "knife vsphere vm network set VMNAME NETWORKNAME"
|
14
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
require_relative "helpers/search_helper"
|
16
|
+
include SearchHelper
|
17
|
+
end
|
18
|
+
|
15
19
|
common_options
|
16
20
|
|
17
21
|
option :nic,
|
@@ -2,13 +2,17 @@
|
|
2
2
|
# License:: Apache License, Version 2.0
|
3
3
|
|
4
4
|
require "chef/knife"
|
5
|
-
|
6
|
-
require "chef/knife/search_helper"
|
5
|
+
require_relative "helpers/base_vsphere_command"
|
7
6
|
|
8
7
|
# VsphereVMPropertyget extends the BaseVspherecommand
|
9
8
|
class Chef::Knife::VsphereVmPropertyGet < Chef::Knife::BaseVsphereCommand
|
10
|
-
|
11
|
-
|
9
|
+
banner "knife vsphere vm property get VMNAME PROPERTY. Gets a vApp Property on VMNAME."
|
10
|
+
|
11
|
+
deps do
|
12
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
13
|
+
require_relative "helpers/search_helper"
|
14
|
+
include SearchHelper
|
15
|
+
end
|
12
16
|
|
13
17
|
common_options
|
14
18
|
|
@@ -2,19 +2,23 @@
|
|
2
2
|
# License:: Apache License, Version 2.0
|
3
3
|
|
4
4
|
require "chef/knife"
|
5
|
-
|
6
|
-
require "chef/knife/search_helper"
|
5
|
+
require_relative "helpers/base_vsphere_command"
|
7
6
|
|
8
7
|
# VsphereVMPropertySet extends Basevspherecommand
|
9
8
|
class Chef::Knife::VsphereVmPropertySet < Chef::Knife::BaseVsphereCommand
|
10
|
-
|
11
|
-
|
9
|
+
banner "knife vsphere vm property set VMNAME PROPERTY VALUE. Sets a vApp Property on VMNAME."
|
10
|
+
|
11
|
+
deps do
|
12
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
13
|
+
require_relative "helpers/search_helper"
|
14
|
+
include SearchHelper
|
15
|
+
end
|
12
16
|
|
13
17
|
common_options
|
14
18
|
|
15
19
|
option :ovf_environment_transport,
|
16
20
|
long: "--ovf-environment-transport STRING",
|
17
|
-
description: "Comma delimited string.
|
21
|
+
description: "Comma delimited string. Configures the transports to use for properties. Supported values are: iso and com.vmware.guestInfo."
|
18
22
|
|
19
23
|
# The main run method for vm_property_set
|
20
24
|
#
|
@@ -2,13 +2,17 @@
|
|
2
2
|
# License:: Apache License, Version 2.0
|
3
3
|
|
4
4
|
require "chef/knife"
|
5
|
-
|
6
|
-
require "chef/knife/search_helper"
|
5
|
+
require_relative "helpers/base_vsphere_command"
|
7
6
|
|
8
7
|
# VsphereVmShow extends the BaseVspherecommand
|
9
8
|
class Chef::Knife::VsphereVmShow < Chef::Knife::BaseVsphereCommand
|
10
|
-
|
11
|
-
|
9
|
+
banner 'knife vsphere vm show VMNAME QUERY. See "https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.VirtualMachine.html" for allowed QUERY values.'
|
10
|
+
|
11
|
+
deps do
|
12
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
13
|
+
require_relative "helpers/search_helper"
|
14
|
+
include SearchHelper
|
15
|
+
end
|
12
16
|
|
13
17
|
common_options
|
14
18
|
|
@@ -3,14 +3,18 @@
|
|
3
3
|
#
|
4
4
|
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# Manage snapshots of a virtual machine
|
10
9
|
class Chef::Knife::VsphereVmSnapshot < Chef::Knife::BaseVsphereCommand
|
11
|
-
include SearchHelper
|
12
10
|
banner "knife vsphere vm snapshot VMNAME (options)"
|
13
11
|
|
12
|
+
deps do
|
13
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
14
|
+
require_relative "helpers/search_helper"
|
15
|
+
include SearchHelper
|
16
|
+
end
|
17
|
+
|
14
18
|
common_options
|
15
19
|
|
16
20
|
option :list,
|
@@ -4,13 +4,11 @@
|
|
4
4
|
#
|
5
5
|
|
6
6
|
require "chef/knife"
|
7
|
-
|
8
|
-
require "chef/knife/search_helper"
|
7
|
+
require_relative "helpers/base_vsphere_command"
|
9
8
|
|
10
9
|
# Manage power state of a virtual machine
|
11
10
|
# VsphereVmState extends the BaseVspherecommand
|
12
11
|
class Chef::Knife::VsphereVmState < Chef::Knife::BaseVsphereCommand
|
13
|
-
include SearchHelper
|
14
12
|
# The Different power states that vSphere reports
|
15
13
|
POWER_STATES ||= {
|
16
14
|
PS_ON => "powered on",
|
@@ -20,6 +18,12 @@ class Chef::Knife::VsphereVmState < Chef::Knife::BaseVsphereCommand
|
|
20
18
|
|
21
19
|
banner "knife vsphere vm state VMNAME (options)"
|
22
20
|
|
21
|
+
deps do
|
22
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
23
|
+
require_relative "helpers/search_helper"
|
24
|
+
include SearchHelper
|
25
|
+
end
|
26
|
+
|
23
27
|
common_options
|
24
28
|
|
25
29
|
option :state,
|
@@ -2,20 +2,25 @@
|
|
2
2
|
# License:: Apache License, Version 2.0
|
3
3
|
|
4
4
|
require "chef/knife"
|
5
|
-
|
6
|
-
require "chef/knife/search_helper"
|
5
|
+
require_relative "helpers/base_vsphere_command"
|
7
6
|
|
8
7
|
# Vspherevmtoolsconfig extends the BaseVspherecommand
|
9
8
|
class Chef::Knife::VsphereVmToolsconfig < Chef::Knife::BaseVsphereCommand
|
10
|
-
include SearchHelper
|
11
9
|
banner "knife vsphere vm toolsconfig VMNAME PROPERTY VALUE
|
12
10
|
See \"https://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.vm.ToolsConfigInfo.html\"
|
13
11
|
for available properties and types."
|
14
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
require_relative "helpers/search_helper"
|
16
|
+
include SearchHelper
|
17
|
+
end
|
18
|
+
|
15
19
|
option :empty,
|
16
20
|
short: "-e",
|
17
21
|
long: "--empty",
|
18
22
|
description: "Allow empty string"
|
23
|
+
|
19
24
|
common_options
|
20
25
|
|
21
26
|
# The main run method for vm_toolsconfig
|
@@ -3,15 +3,19 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# Add a new disk to a virtual machine
|
10
9
|
# VsphereVmvmdkadd extends the BaseVspherecommand
|
11
10
|
class Chef::Knife::VsphereVmVmdkAdd < Chef::Knife::BaseVsphereCommand
|
12
|
-
include SearchHelper
|
13
11
|
banner "knife vsphere vm vmdk add VMNAME DISK_GB"
|
14
12
|
|
13
|
+
deps do
|
14
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
15
|
+
require_relative "helpers/search_helper"
|
16
|
+
include SearchHelper
|
17
|
+
end
|
18
|
+
|
15
19
|
common_options
|
16
20
|
|
17
21
|
option :vmdk_type,
|
@@ -3,14 +3,18 @@
|
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
require "chef/knife"
|
6
|
-
|
7
|
-
require "chef/knife/search_helper"
|
6
|
+
require_relative "helpers/base_vsphere_command"
|
8
7
|
|
9
8
|
# Main class VsphereVMvncset extends the BaseVspherecommand
|
10
9
|
class Chef::Knife::VsphereVmVncset < Chef::Knife::BaseVsphereCommand
|
11
|
-
include SearchHelper
|
12
10
|
banner "knife vsphere vm vncset VMNAME"
|
13
11
|
|
12
|
+
deps do
|
13
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
14
|
+
require_relative "helpers/search_helper"
|
15
|
+
include SearchHelper
|
16
|
+
end
|
17
|
+
|
14
18
|
option :vnc_port,
|
15
19
|
long: "--vnc-port PORT",
|
16
20
|
description: "Port to run VNC on",
|
@@ -5,20 +5,25 @@
|
|
5
5
|
#
|
6
6
|
|
7
7
|
require "chef/knife"
|
8
|
-
|
9
|
-
require "chef/knife/search_helper"
|
10
|
-
require "chef/knife/customization_helper"
|
8
|
+
require_relative "helpers/base_vsphere_command"
|
11
9
|
|
12
10
|
# Wait for vm finishing Sysprep.
|
13
11
|
# usage:
|
14
12
|
# knife vsphere vm wait sysprep somemachine --sleep 30 \
|
15
13
|
# --timeout 600
|
16
14
|
class Chef::Knife::VsphereVmWaitSysprep < Chef::Knife::BaseVsphereCommand
|
17
|
-
include SearchHelper
|
18
|
-
include CustomizationHelper
|
19
|
-
|
20
15
|
banner "knife vsphere vm wait sysprep VMNAME (options)"
|
21
16
|
|
17
|
+
deps do
|
18
|
+
Chef::Knife::BaseVsphereCommand.load_deps
|
19
|
+
|
20
|
+
require_relative "helpers/search_helper"
|
21
|
+
include SearchHelper
|
22
|
+
|
23
|
+
require_relative "helpers/customization_helper"
|
24
|
+
include CustomizationHelper
|
25
|
+
end
|
26
|
+
|
22
27
|
common_options
|
23
28
|
|
24
29
|
option :sleep,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-vsphere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Pagel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: netaddr
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '1.8'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '4.0'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '1.8'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '4.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: filesize
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,20 +92,6 @@ dependencies:
|
|
92
92
|
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '15.1'
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: chef-bin
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '15.1'
|
102
|
-
type: :runtime
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
requirements:
|
106
|
-
- - ">="
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: '15.1'
|
109
95
|
description: VMware vSphere support for Chef Infra's Knife command
|
110
96
|
email: ezra@cpan.org
|
111
97
|
executables: []
|
@@ -113,9 +99,9 @@ extensions: []
|
|
113
99
|
extra_rdoc_files: []
|
114
100
|
files:
|
115
101
|
- LICENSE
|
116
|
-
- lib/chef/knife/base_vsphere_command.rb
|
117
|
-
- lib/chef/knife/customization_helper.rb
|
118
|
-
- lib/chef/knife/search_helper.rb
|
102
|
+
- lib/chef/knife/helpers/base_vsphere_command.rb
|
103
|
+
- lib/chef/knife/helpers/customization_helper.rb
|
104
|
+
- lib/chef/knife/helpers/search_helper.rb
|
119
105
|
- lib/chef/knife/vsphere_cluster_list.rb
|
120
106
|
- lib/chef/knife/vsphere_cpu_ratio.rb
|
121
107
|
- lib/chef/knife/vsphere_customization_list.rb
|
@@ -159,7 +145,7 @@ files:
|
|
159
145
|
- lib/chef/knife/vsphere_vm_vnc_set.rb
|
160
146
|
- lib/chef/knife/vsphere_vm_wait_sysprep.rb
|
161
147
|
- lib/knife-vsphere/version.rb
|
162
|
-
homepage:
|
148
|
+
homepage: https://github.com/chef/knife-vsphere
|
163
149
|
licenses:
|
164
150
|
- Apache-2.0
|
165
151
|
metadata: {}
|