Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cloudstack/resource_cloudstack_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ func resourceCloudStackInstance() *schema.Resource {
Optional: true,
},

"hostid": {
Type: schema.TypeString,
Optional: true,
},

"start_vm": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -297,6 +302,12 @@ func resourceCloudStackInstanceCreate(d *schema.ResourceData, meta interface{})
p.SetKeypair(keypair.(string))
}

// If a hostid is supplied, add it to the parameter struct

if hostid, ok := d.GetOk("hostid"); ok {
p.SetHostid(hostid.(string))
}

if userData, ok := d.GetOk("user_data"); ok {
ud, err := getUserData(userData.(string), cs.HTTPGETOnly)
if err != nil {
Expand Down