Commit Graph

50 Commits

Author SHA1 Message Date
Mitchell Hashimoto 38151229b1 Merge pull request #2285 from cvvs/b_provider_openstack_router_adminbool
provider/openstack: change router resource admin_state_up from string to bool
2015-06-24 23:09:14 -07:00
Mitchell Hashimoto 09acd1f79d providers/openstack: fix crash case if network is nil [GH-2323] 2015-06-23 16:19:42 -07:00
cvvs 646fd76e07 provider/openstack: change security groups to set
This commit converts the openstack compute instances security groups to
a set from a list.

This fixes ordering problems which forces or indicates change to security
groups where none exist, and mimics the functionality in the aws
provider's compute resource.

Includes fixes from dupuy addressing crashes due to an empty state.
2015-06-09 10:04:06 -06:00
Joe Topjian 4daaacd292 Minor volume fixes
This commit follows suit of #1897 by fixing volume-related
parameters which allow the volume attach acceptance test
to work. It also re-enables the volume attach test.
2015-05-14 02:59:21 +00:00
Joe Topjian fe0a7a5ec5 Allow Blank Region
When OS_REGION_NAME is not set, fall back to a blank string. This
will cause gophercloud to use the cloud's only region in
single-region clouds.
2015-04-11 05:10:10 +00:00
Joe Topjian ef4e03a729 Workaround for missing tenant-network
This commit resolves an issue where the tenant-network api extension
does not exist. The caveat is that the user must either specify no
networks (single network environment) or can only specify UUIDs for
network configurations.
2015-04-01 21:31:55 +00:00
Joe Topjian 4244d0947e Making the network resource computable
This allows the obtained network information to be successfully stored
for environments that do not require a network resource to be specified.
2015-04-01 16:06:47 +00:00
Joe Topjian bb81228205 typo with netname when no networks are specified 2015-04-01 15:39:36 +00:00
Joe Topjian 30b0fc7489 Only attempt to get the MAC address if it exists. 2015-04-01 15:39:36 +00:00
Joe Topjian 0d77232196 Fixing computed parameters 2015-04-01 15:39:36 +00:00
Joe Topjian ccba698370 Network Read changes
This commit changes how the network info is read from OpenStack.
It pulls all relevant information from server.Addresses and merges
it with the available information from the networks parameters.
The access_v4, access_v6, and floating IP information is then
determined from the result.

A MAC address parameter is also added since that information is
available in server.Addresses.
2015-04-01 15:39:36 +00:00
Joe Topjian b160654cb3 Allow networks to be specified by name
This commit allows the user to specify a network by name rather than
just uuid. This is done via the os-tenant-networks api extension.
This works for both neutron and nova-network.
2015-04-01 15:39:36 +00:00
Joe Topjian b90a6152c5 Renamed fixed_ip to fixed_ip_v4 and added fixed_ip_v6 2015-04-01 15:39:36 +00:00
Joe Topjian d768a01cab Removes check for a "public" network
This is only possible if the OpenStack cloud explicitly has a network
called "public".
2015-04-01 15:39:36 +00:00
Joe Topjian 141b40189e os-floating-ips support
This commit causes the resource to manage floating IPs by way of the
os-floating-ips API.

At the moment, it works with both nova-network and Neutron environments,
but if you use multiple Neutron networks, the network that supports the
floating IP must be listed first.
2015-04-01 15:39:18 +00:00
Guillaume Giamarchi a90b9db397 Bugfix on floating IP assignment
The `getFirstNetworkID` does not work correctly because the first
network is not always the private network of the instance.

As long as the `GET /networks` gives a list containing also public
networks we don't have any guarantee that the first network is the
one we want. Furthermore, with a loop over the network list we are
not able to determine which network is the one we want.

Instead of retrieving the network ID and then finding the port ID,
it's better to basically take the first port ID of the instance.
2015-04-01 00:14:56 +02:00
Chris Buben 0092946f74 user_data support
Mostly stolen from: https://github.com/jtopjian/terraform-provider-openstack/blob/master/openstack/resource_openstack_instance.go
2015-03-31 09:54:50 -06:00
Julien Vey 2e37784065 Fix general comments by @phinze 2015-03-31 09:54:50 -06:00
Joe Topjian f011462e30 Volume Pending States
This commit adds pending states for volume attachment, detachment,
and deletion.
2015-03-31 09:54:50 -06:00
Eric Bellemon d03b420e62 Replace perigee.UnexpectedResponseCodeError with gophercloud.UnexpectedResponseCodeError 2015-03-31 09:54:49 -06:00
Joe Topjian 4c9a44b69f Added access_ip_v6 support
This commit populates access_ip_v6 by either the AccessIPv6 attribute
or by finding the first available IPv6 address.

This commit retains the original feature of setting the default ssh
connection to the IPv4 address unless one is not found. IPv6 access
can still be enabled by explicitly setting it in the resource paramters.

This commit also removes d.Set("host") in favor of SetConnInfo
2015-03-31 09:54:49 -06:00
Jon Perritt 633e98dffe security group rule fix; still not exporting rule ID 2015-03-31 09:54:49 -06:00
Joe Topjian 4df32aebed Changing how security groups are read for compute instances 2015-03-31 09:54:49 -06:00
Jon Perritt 64d53009a0 typeset->typelist 2015-03-31 09:54:49 -06:00
Jon Perritt bb6969a4c5 resize server on flavor_id or flavor_name change 2015-03-31 09:54:49 -06:00
Jon Perritt 49b01a4f0a update compute instance security group Read operation 2015-03-31 09:54:49 -06:00
Joe Topjian e5f2315bfe Instance volume attach
This commit adds the ability for instances to attach volumes from within their resource.
2015-03-31 09:54:48 -06:00
Joe Topjian 16ea14e8c9 Grammar fix 2015-03-31 09:54:48 -06:00
Joe Topjian b3438d07d6 This commit enables both the image_id and the image_name to be
computed, so that specifying one will populate the other.
2015-03-31 09:54:48 -06:00
Joe Topjian 768292c069 Support for flavor_name
This commit renames flavor_ref to flavor_id and adds the flavor_name
parameter. Users can now specify either a flavor ID or name when launching
instances.
2015-03-31 09:54:48 -06:00
Joe Topjian 74482abc5b Refactoring multiple results 2015-03-31 09:54:48 -06:00
Joe Topjian bad2c9f18d Accounting for multiple results of an image name
If multiple results are found, an error will be returned to the user.
2015-03-31 09:54:48 -06:00
Joe Topjian f51a53000f Support for image_name
This commit renames image_ref to image_id and adds the image_name
parameter. Users can now specify either an image UUID or image name
when launching instances.

image_name is preferrable as deployers/sysadmins generally regularly
deprecate/remove outdated and insecure images. Using a consistent
naming scheme allows end-users to always retrieve a working image.
2015-03-31 09:54:48 -06:00
Jon Perritt fafa946871 handle 404 (Not Found) in Get operations 2015-03-31 09:54:48 -06:00
Julien Vey 132d5acb33 Make pool name configurable in tests 2015-03-31 09:54:48 -06:00
Julien Vey 760e03856e Manage floating IP in compute instances 2015-03-31 09:54:48 -06:00
Julien Vey aae87816f6 add ACTIVE as pending state when deleting instance 2015-03-31 09:54:48 -06:00
Julien Vey 8e9c6787dd Just try the first IP available if none found before
Some cloud don't implement correctly IP addresses.
Instead of failing during the provisionning, we just take the
first IP available and try with this one.
2015-03-31 09:54:48 -06:00
Jon Perritt ccd51ae3ab added ok codes to gophercloud -> update ServerV2StateRefreshFunc 2015-03-31 09:54:48 -06:00
Jon Perritt e2634562a4 define block_device schema 2015-03-31 09:54:48 -06:00
Jon Perritt 436ef9e53b boot from volume ops and docs 2015-03-31 09:54:48 -06:00
Jon Perritt 33d62bbdbf 'networks' -> 'network' 2015-03-31 09:54:47 -06:00
Jon Perritt 1aba665ad7 refactor service clients to *Config 2015-03-31 09:54:47 -06:00
Jon Perritt 17b137c972 go fmt 2015-03-31 09:54:47 -06:00
Jon Perritt 59b5efc25a add defaultFuncs; fix bug with server createOpts 2015-03-31 09:54:46 -06:00
Jon Perritt d86cb6be1c fix diff bug in 'Read' functions 2015-03-31 09:54:46 -06:00
Jon Perritt 5d2fe153c0 go fmt 2015-03-31 09:54:46 -06:00
Jon Perritt 2214331b3c export 'region' from 'Read' operations 2015-03-31 09:54:46 -06:00
Jon Perritt dc99dd1f05 add versioning to files 2015-03-31 09:54:46 -06:00
Jon Perritt 8579c8693a make 'region' resource-specific; create new client for each crud operation 2015-03-31 09:54:46 -06:00