OpenStack

v3.9.0 published on Thursday, Aug 4, 2022 by Pulumi

ServerGroup

Manages a V2 Server Group resource within OpenStack.

Policies

  • affinity - All instances/servers launched in this group will be hosted on the same compute node.

  • anti-affinity - All instances/servers launched in this group will be hosted on different compute nodes.

  • soft-affinity - All instances/servers launched in this group will be hosted on the same compute node if possible, but if not possible they still will be scheduled instead of failure. To use this policy your OpenStack environment should support Compute service API 2.15 or above.

  • soft-anti-affinity - All instances/servers launched in this group will be hosted on different compute nodes if possible, but if not possible they still will be scheduled instead of failure. To use this policy your OpenStack environment should support Compute service API 2.15 or above.

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var test_sg = new OpenStack.Compute.ServerGroup("test-sg", new OpenStack.Compute.ServerGroupArgs
        {
            Policies = 
            {
                "anti-affinity",
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewServerGroup(ctx, "test-sg", &compute.ServerGroupArgs{
			Policies: pulumi.StringArray{
				pulumi.String("anti-affinity"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.compute.ServerGroup;
import com.pulumi.openstack.compute.ServerGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var test_sg = new ServerGroup("test-sg", ServerGroupArgs.builder()        
            .policies("anti-affinity")
            .build());

    }
}
import pulumi
import pulumi_openstack as openstack

test_sg = openstack.compute.ServerGroup("test-sg", policies=["anti-affinity"])
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const test_sg = new openstack.compute.ServerGroup("test-sg", {
    policies: ["anti-affinity"],
});
resources:
  test-sg:
    type: openstack:compute:ServerGroup
    properties:
      policies:
        - anti-affinity

Create a ServerGroup Resource

new ServerGroup(name: string, args?: ServerGroupArgs, opts?: CustomResourceOptions);
@overload
def ServerGroup(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                name: Optional[str] = None,
                policies: Optional[Sequence[str]] = None,
                region: Optional[str] = None,
                value_specs: Optional[Mapping[str, Any]] = None)
@overload
def ServerGroup(resource_name: str,
                args: Optional[ServerGroupArgs] = None,
                opts: Optional[ResourceOptions] = None)
func NewServerGroup(ctx *Context, name string, args *ServerGroupArgs, opts ...ResourceOption) (*ServerGroup, error)
public ServerGroup(string name, ServerGroupArgs? args = null, CustomResourceOptions? opts = null)
public ServerGroup(String name, ServerGroupArgs args)
public ServerGroup(String name, ServerGroupArgs args, CustomResourceOptions options)
type: openstack:compute:ServerGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ServerGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ServerGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ServerGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ServerGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ServerGroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ServerGroup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ServerGroup resource accepts the following input properties:

Name string

A unique name for the server group. Changing this creates a new server group.

Policies List<string>

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

Region string

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

ValueSpecs Dictionary<string, object>

Map of additional options.

Name string

A unique name for the server group. Changing this creates a new server group.

Policies []string

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

Region string

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

ValueSpecs map[string]interface{}

Map of additional options.

name String

A unique name for the server group. Changing this creates a new server group.

policies List<String>

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

region String

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

valueSpecs Map<String,Object>

Map of additional options.

name string

A unique name for the server group. Changing this creates a new server group.

policies string[]

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

region string

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

valueSpecs {[key: string]: any}

Map of additional options.

name str

A unique name for the server group. Changing this creates a new server group.

policies Sequence[str]

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

region str

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

value_specs Mapping[str, Any]

Map of additional options.

name String

A unique name for the server group. Changing this creates a new server group.

policies List<String>

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

region String

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

valueSpecs Map<Any>

Map of additional options.

Outputs

All input properties are implicitly available as output properties. Additionally, the ServerGroup resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Members List<string>

The instances that are part of this server group.

Id string

The provider-assigned unique ID for this managed resource.

Members []string

The instances that are part of this server group.

id String

The provider-assigned unique ID for this managed resource.

members List<String>

The instances that are part of this server group.

id string

The provider-assigned unique ID for this managed resource.

members string[]

The instances that are part of this server group.

id str

The provider-assigned unique ID for this managed resource.

members Sequence[str]

The instances that are part of this server group.

id String

The provider-assigned unique ID for this managed resource.

members List<String>

The instances that are part of this server group.

Look up an Existing ServerGroup Resource

Get an existing ServerGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ServerGroupState, opts?: CustomResourceOptions): ServerGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        members: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        policies: Optional[Sequence[str]] = None,
        region: Optional[str] = None,
        value_specs: Optional[Mapping[str, Any]] = None) -> ServerGroup
func GetServerGroup(ctx *Context, name string, id IDInput, state *ServerGroupState, opts ...ResourceOption) (*ServerGroup, error)
public static ServerGroup Get(string name, Input<string> id, ServerGroupState? state, CustomResourceOptions? opts = null)
public static ServerGroup get(String name, Output<String> id, ServerGroupState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Members List<string>

The instances that are part of this server group.

Name string

A unique name for the server group. Changing this creates a new server group.

Policies List<string>

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

Region string

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

ValueSpecs Dictionary<string, object>

Map of additional options.

Members []string

The instances that are part of this server group.

Name string

A unique name for the server group. Changing this creates a new server group.

Policies []string

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

Region string

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

ValueSpecs map[string]interface{}

Map of additional options.

members List<String>

The instances that are part of this server group.

name String

A unique name for the server group. Changing this creates a new server group.

policies List<String>

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

region String

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

valueSpecs Map<String,Object>

Map of additional options.

members string[]

The instances that are part of this server group.

name string

A unique name for the server group. Changing this creates a new server group.

policies string[]

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

region string

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

valueSpecs {[key: string]: any}

Map of additional options.

members Sequence[str]

The instances that are part of this server group.

name str

A unique name for the server group. Changing this creates a new server group.

policies Sequence[str]

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

region str

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

value_specs Mapping[str, Any]

Map of additional options.

members List<String>

The instances that are part of this server group.

name String

A unique name for the server group. Changing this creates a new server group.

policies List<String>

The set of policies for the server group. All policies are mutually exclusive. See the Policies section for more information. Changing this creates a new server group.

region String

The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new server group.

valueSpecs Map<Any>

Map of additional options.

Import

Server Groups can be imported using the id, e.g.

 $ pulumi import openstack:compute/serverGroup:ServerGroup test-sg 1bc30ee9-9d5b-4c30-bdd5-7f1e663f5edf

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.