Commit Graph

64 Commits

Author SHA1 Message Date
Joe Topjian 4716451617 provider/openstack: Convert block_device from TypeSet to TypeList
This change better reflects how block devices are passed to the Nova API
and allows for future enablement of block_device features. It also resolves
an interpolation bug.
2015-12-12 22:18:23 +00:00
Nic Grayson ef9838c796 increased openstack 10 minute timeouts to 30 minutes 2015-12-08 16:03:33 -06:00
Joe Topjian 98a441314b provider/openstack: Make Security Groups Computed
This commit makes security groups in the openstack_compute_instance_v2
resource computed. This fixes issues where a security group is omitted
which causes the instance to have the "default" group applied. When
re-applying without this patch, an error will occur.
2015-11-07 04:01:50 +00:00
Joe Topjian 4a5cd0b415 provider/openstack: Fixing Image ID/Name areas
This commit cleans up areas that configure the image_id and image_name.

It enables the ability to not have to specify an image_id or image_name
when booting from a volume.

It also prevents Terraform from reporting an error when an image name is no
longer able to be resolved from an image ID. This usually happens when the
image has been deleted, but there are still running instances that were based
off of it.

The image_id and image_name parameters no longer immediately take a default
value from the OS_IMAGE_ID and OS_IMAGE_NAME environment variables. If no other
resolution of an image_id or image_name were found, then these variables will
be referenced. This further supports booting from a volume.

Finally, documentation was updated to take into account booting from a volume.
2015-10-31 22:45:34 +00:00
Joe Topjian 3d3f8122a9 provider/openstack: Volume Cleanup
This commit cleans up the volume and block device handling in the instance
resource. It also adds more acceptance tests to deal with different workflows
of attaching and detaching a volume through the instance's lifecycle.

No new functionality has been added.
2015-10-31 22:45:34 +00:00
Joe Topjian e75553fd9d provider/openstack: Fixes Boot From Volume
This commit fixes the previously broken "boot from volume" feature. It also
adds an acceptance test to ensure the feature continues to work.

The "delete_on_termination" option was also added.
2015-10-31 22:45:28 +00:00
Yo Takezawa 59828deb0f provider/openstack: Use security_groups as native set when update 2015-10-28 10:12:05 +09:00
Yo Takezawa d2cf45a057 provider/openstack: Ignore order of security_groups in instance 2015-10-27 15:57:28 +09:00
Radek Simko f9efede852 gofmt files from recently merged PRs 2015-10-07 13:35:06 -07:00
Paul Hinze 50b8161da1 Merge pull request #2008 from dupuy/secgrp-delta-remove-then-add
remove security groups (by name) before adding security groups (by id)
2015-09-24 14:14:48 -05:00
Mitchell Hashimoto ede6af8763 Merge pull request #1921 from jtopjian/openstack-servergroup-schedulerhints
provider/openstack: scheduler_hints and servergroups
2015-06-24 23:13:25 -07:00
Mitchell Hashimoto d1d2a90158 Revert "provider/openstack: change security groups to set"
This reverts commit 646fd76e07.
2015-06-24 23:10:30 -07:00
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
Alexander Dupuy 739a411b4d debug security group ids 2015-05-18 23:02:19 +02: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 7ca7eeabe7 Added scheduler_hints to the OpenStack instance resource.
This allows various hints to be passed to the OpenStack scheduler
that will determine where the instance will be hosted in the cloud.
2015-05-12 01:08:20 +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