@@ -6,10 +6,12 @@ import (
66)
77
88const (
9- vmwarevsphereConfigDriver = "vmwarevsphere"
9+ vmwarevsphereConfigDriver = "vmwarevsphere"
10+ vmwarevsphereConfigCreationTypeDefault = "legacy"
1011)
1112
1213var (
14+ vmwarevsphereConfigCreationType = []string {"vm" , "template" , "library" , "legacy" }
1315 vmwarevsphereConfigVappIpallocationpolicies = []string {"dhcp" , "fixed" , "transient" , "fixedAllocated" }
1416 vmwarevsphereConfigVappIpprotocols = []string {"IPv4" , "IPv6" }
1517 vmwarevsphereConfigVappTransports = []string {"iso" , "com.vmware.guestInfo" }
@@ -20,17 +22,28 @@ var (
2022type vmwarevsphereConfig struct {
2123 Boot2dockerURL string `json:"boot2dockerUrl,omitempty" yaml:"boot2dockerUrl,omitempty"`
2224 Cfgparam []string `json:"cfgparam,omitempty" yaml:"cfgparam,omitempty"`
25+ CloneFrom string `json:"cloneFrom,omitempty" yaml:"cloneFrom,omitempty"`
26+ CloudConfig string `json:"cloudConfig,omitempty" yaml:"cloudConfig,omitempty"`
2327 Cloudinit string `json:"cloudinit,omitempty" yaml:"cloudinit,omitempty"`
28+ ContentLibrary string `json:"contentLibrary,omitempty" yaml:"contentLibrary,omitempty"`
2429 CPUCount string `json:"cpuCount,omitempty" yaml:"cpuCount,omitempty"`
30+ CreationType string `json:"creationType,omitempty" yaml:"creationType,omitempty"`
31+ CustomAttributes []string `json:"customAttribute,omitempty" yaml:"customAttribute,omitempty"`
2532 Datacenter string `json:"datacenter,omitempty" yaml:"datacenter,omitempty"`
2633 Datastore string `json:"datastore,omitempty" yaml:"datastore,omitempty"`
34+ DatastoreCluster string `json:"datastoreCluster,omitempty" yaml:"datastoreCluster,omitempty"`
2735 DiskSize string `json:"diskSize,omitempty" yaml:"diskSize,omitempty"`
2836 Folder string `json:"folder,omitempty" yaml:"folder,omitempty"`
2937 Hostsystem string `json:"hostsystem,omitempty" yaml:"hostsystem,omitempty"`
3038 MemorySize string `json:"memorySize,omitempty" yaml:"memorySize,omitempty"`
3139 Network []string `json:"network,omitempty" yaml:"network,omitempty"`
3240 Password string `json:"password,omitempty" yaml:"password,omitempty"`
3341 Pool string `json:"pool,omitempty" yaml:"pool,omitempty"`
42+ SshPassword string `json:"sshPassword,omitempty" yaml:"sshPassword,omitempty"`
43+ SshPort string `json:"sshPort,omitempty" yaml:"sshPort,omitempty"`
44+ SshUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"`
45+ SshUserGroup string `json:"sshUserGroup,omitempty" yaml:"sshUserGroup,omitempty"`
46+ Tags []string `json:"tag,omitempty" yaml:"tag,omitempty"`
3447 Username string `json:"username,omitempty" yaml:"username,omitempty"`
3548 VappIpallocationpolicy string `json:"vappIpallocationpolicy,omitempty" yaml:"vappIpallocationpolicy,omitempty"`
3649 VappIpprotocol string `json:"vappIpprotocol,omitempty" yaml:"vappIpprotocol,omitempty"`
@@ -45,55 +58,101 @@ type vmwarevsphereConfig struct {
4558func vsphereConfigFields () map [string ]* schema.Schema {
4659 s := map [string ]* schema.Schema {
4760 "boot2docker_url" : & schema.Schema {
48- Type : schema .TypeString ,
49- Optional : true ,
50- Default : "https://releases.rancher.com/os/latest/rancheros-vmware.iso" ,
61+ Type : schema .TypeString ,
62+ Optional : true ,
63+ Default : "https://releases.rancher.com/os/latest/rancheros-vmware.iso" ,
64+ Description : "vSphere URL for boot2docker image" ,
5165 },
5266 "cfgparam" : & schema.Schema {
53- Type : schema .TypeList ,
54- Optional : true ,
67+ Type : schema .TypeList ,
68+ Optional : true ,
69+ Description : "vSphere vm configuration parameters (used for guestinfo)" ,
5570 Elem : & schema.Schema {
5671 Type : schema .TypeString ,
5772 },
5873 },
74+ "clone_from" : & schema.Schema {
75+ Type : schema .TypeString ,
76+ Optional : true ,
77+ Description : "If you choose creation type clone a name of what you want to clone is required" ,
78+ },
79+ "cloud_config" : & schema.Schema {
80+ Type : schema .TypeString ,
81+ Optional : true ,
82+ Description : "Filepath to a cloud-config yaml file to put into the ISO user-data" ,
83+ },
5984 "cloudinit" : & schema.Schema {
60- Type : schema .TypeString ,
61- Optional : true ,
85+ Type : schema .TypeString ,
86+ Optional : true ,
87+ Description : "vSphere cloud-init filepath or url to add to guestinfo" ,
88+ },
89+ "content_library" : & schema.Schema {
90+ Type : schema .TypeString ,
91+ Optional : true ,
92+ Description : "If you choose to clone from a content library template specify the name of the library" ,
6293 },
6394 "cpu_count" : & schema.Schema {
64- Type : schema .TypeString ,
65- Optional : true ,
66- Default : "2" ,
95+ Type : schema .TypeString ,
96+ Optional : true ,
97+ Default : "2" ,
98+ Description : "vSphere CPU number for docker VM" ,
99+ },
100+ "creation_type" : & schema.Schema {
101+ Type : schema .TypeString ,
102+ Optional : true ,
103+ Default : vmwarevsphereConfigCreationTypeDefault ,
104+ ValidateFunc : validation .StringInSlice (vmwarevsphereConfigCreationType , true ),
105+ Description : "Creation type when creating a new virtual machine. Supported values: vm, template, library, legacy" ,
106+ },
107+ "custom_attributes" : & schema.Schema {
108+ Type : schema .TypeList ,
109+ Optional : true ,
110+ Description : "vSphere custom attributes, format key/value e.g. '200=my custom value'" ,
111+ Elem : & schema.Schema {
112+ Type : schema .TypeString ,
113+ },
67114 },
68115 "datacenter" : & schema.Schema {
69- Type : schema .TypeString ,
70- Optional : true ,
116+ Type : schema .TypeString ,
117+ Optional : true ,
118+ Description : "vSphere datacenter for virtual machine" ,
71119 },
72120 "datastore" : & schema.Schema {
73- Type : schema .TypeString ,
74- Optional : true ,
121+ Type : schema .TypeString ,
122+ Optional : true ,
123+ Description : "vSphere datastore for virtual machine" ,
124+ },
125+ "datastore_cluster" : & schema.Schema {
126+ Type : schema .TypeString ,
127+ Optional : true ,
128+ Description : "vSphere datastore cluster for virtual machine" ,
75129 },
76130 "disk_size" : & schema.Schema {
77- Type : schema .TypeString ,
78- Optional : true ,
79- Default : "20480" ,
131+ Type : schema .TypeString ,
132+ Optional : true ,
133+ Default : "20480" ,
134+ Description : "vSphere size of disk for docker VM (in MB)" ,
80135 },
81136 "folder" : & schema.Schema {
82- Type : schema .TypeString ,
83- Optional : true ,
137+ Type : schema .TypeString ,
138+ Optional : true ,
139+ Description : "vSphere folder for the docker VM. This folder must already exist in the datacenter" ,
84140 },
85141 "hostsystem" : & schema.Schema {
86- Type : schema .TypeString ,
87- Optional : true ,
142+ Type : schema .TypeString ,
143+ Optional : true ,
144+ Description : "vSphere compute resource where the docker VM will be instantiated. This can be omitted if using a cluster with DRS" ,
88145 },
89146 "memory_size" : & schema.Schema {
90- Type : schema .TypeString ,
91- Optional : true ,
92- Default : "2048" ,
147+ Type : schema .TypeString ,
148+ Optional : true ,
149+ Default : "2048" ,
150+ Description : "vSphere size of memory for docker VM (in MB)" ,
93151 },
94152 "network" : & schema.Schema {
95- Type : schema .TypeList ,
96- Optional : true ,
153+ Type : schema .TypeList ,
154+ Optional : true ,
155+ Description : "vSphere network where the virtual machine will be attached" ,
97156 Elem : & schema.Schema {
98157 Type : schema .TypeString ,
99158 },
@@ -105,8 +164,42 @@ func vsphereConfigFields() map[string]*schema.Schema {
105164 Description : "vSphere password" ,
106165 },
107166 "pool" : & schema.Schema {
108- Type : schema .TypeString ,
109- Optional : true ,
167+ Type : schema .TypeString ,
168+ Optional : true ,
169+ Description : "vSphere resource pool for docker VM" ,
170+ },
171+ "ssh_password" : {
172+ Type : schema .TypeString ,
173+ Optional : true ,
174+ Sensitive : true ,
175+ Default : "tcuser" ,
176+ Description : "If using a non-B2D image you can specify the ssh password" ,
177+ },
178+ "ssh_port" : {
179+ Type : schema .TypeString ,
180+ Optional : true ,
181+ Default : "22" ,
182+ Description : "If using a non-B2D image you can specify the ssh port" ,
183+ },
184+ "ssh_user" : {
185+ Type : schema .TypeString ,
186+ Optional : true ,
187+ Default : "docker" ,
188+ Description : "If using a non-B2D image you can specify the ssh user" ,
189+ },
190+ "ssh_user_group" : {
191+ Type : schema .TypeString ,
192+ Optional : true ,
193+ Default : "staff" ,
194+ Description : "If using a non-B2D image the uploaded keys will need chown'ed, defaults to staff e.g. docker:staff" ,
195+ },
196+ "tags" : & schema.Schema {
197+ Type : schema .TypeList ,
198+ Optional : true ,
199+ Description : "vSphere tags id e.g. urn:xxx" ,
200+ Elem : & schema.Schema {
201+ Type : schema .TypeString ,
202+ },
110203 },
111204 "username" : {
112205 Type : schema .TypeString ,
@@ -116,23 +209,27 @@ func vsphereConfigFields() map[string]*schema.Schema {
116209 "vapp_ip_allocation_policy" : & schema.Schema {
117210 Type : schema .TypeString ,
118211 Optional : true ,
212+ Description : "vSphere vApp IP allocation policy. Supported values are: dhcp, fixed, transient and fixedAllocated" ,
119213 ValidateFunc : validation .StringInSlice (vmwarevsphereConfigVappIpallocationpolicies , true ),
120214 },
121215 "vapp_ip_protocol" : & schema.Schema {
122216 Type : schema .TypeString ,
123217 Optional : true ,
218+ Description : "vSphere vApp IP protocol for this deployment. Supported values are: IPv4 and IPv6" ,
124219 ValidateFunc : validation .StringInSlice (vmwarevsphereConfigVappIpprotocols , true ),
125220 },
126221 "vapp_property" : & schema.Schema {
127- Type : schema .TypeList ,
128- Optional : true ,
222+ Type : schema .TypeList ,
223+ Optional : true ,
224+ Description : "vSphere vApp properties" ,
129225 Elem : & schema.Schema {
130226 Type : schema .TypeString ,
131227 },
132228 },
133229 "vapp_transport" : & schema.Schema {
134230 Type : schema .TypeString ,
135231 Optional : true ,
232+ Description : "vSphere OVF environment transports to use for properties. Supported values are: iso and com.vmware.guestInfo" ,
136233 ValidateFunc : validation .StringInSlice (vmwarevsphereConfigVappTransports , true ),
137234 },
138235 "vcenter" : {
0 commit comments