add adminPass option for server creation
diff --git a/openstack/compute/v2/servers/requests.go b/openstack/compute/v2/servers/requests.go
index 95a4188..6381419 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -131,6 +131,10 @@
// ConfigDrive [optional] enables metadata injection through a configuration drive.
ConfigDrive bool
+
+ // AdminPass [optional] sets the root user password. If not set, a randomly-generated
+ // password will be created and returned in the response.
+ AdminPass string
}
// ToServerCreateMap assembles a request body based on the contents of a CreateOpts.
@@ -158,6 +162,9 @@
if opts.Metadata != nil {
server["metadata"] = opts.Metadata
}
+ if opts.AdminPass != "" {
+ server["adminPass"] = opts.AdminPass
+ }
if len(opts.SecurityGroups) > 0 {
securityGroups := make([]map[string]interface{}, len(opts.SecurityGroups))