Server

The Server node is defined with a section name, a type and properties.

section name

Example: vm:

type

type: dcm.nodes.Server

properties

The following node properties are supported when defining a Server node in a blueprint template:

  • name - server name
  • product - cloud provider product type/size
  • serverProductID - cloud provider product identifier
  • image - machine image specified by the cloud provider identifier
  • cloud - cloud where the server will be created in
  • cloudAccountID - cloud account of the cloud
  • region - region in the cloud where the server will be created in
  • zone - data center in the cloud region where the server will be created in
  • platform - operating system platform (supported values: CENT_OS, DEBIAN, FEDORA_CORE, FREE_BSD, OPEN_BSD, RHEL, SOLARIS, SUSE, UBUNTU, UNKNOWN, UNIX, WINDOWS)
  • architecture - I32 OR I64
  • startupScript - a script containing one or more commands to be passed and run on the server during the boot process.
  • For Linux servers the commands can be split on separate lines by ending the line with the vertical bar character |
  • For Windows servers the commands can be split on separate lines by ending the line with the the backtick character `

Attention

The Dell Cloud Manager agent must be installed and running on the servers in the stacks.

If the cloud provider supports passing user data scripts to the launched server to be run during system boot, and the machine image used to launch the server has been configured to accept and run scripts, then you can install the Dell Cloud Manager agent on the servers in the stack using the blueprint template startupScript statement or the ServerWithAgent server type. If not, you will need to pre-install the Dell Cloud Manager agents on machine images and specify those machine images in your blueprint templates.

Refer to the Support Matrix in this document for reference.

Linux Server Example

  node_templates:
    vm:
        type: dcm.nodes.Server
        properties:
          name: "test-server"
          cloud: { get_input: [account_region_zone_selector, cloud] }              # Retrieve cloud from the AccountRegionSelector
          cloudAccountId: { get_input: [account_region_zone_selector, accountId] } # Retrieve the cloud account ID from the AccountRegionSelector
          region: { get_input: [account_region_zone_selector, region] }            # Retrieve region from the AccountRegionSelector
          zone: { get_input: [account_region_zone_selector, zone] }                # Retrieve zone from the AccountRegionSelector
          platform: { get_input: [product_selector, platform] }                    # Retrieve platform from the Product selector
          architecture: { get_input: [product_selector, architecture] }            # Retrieve architecture from the Product selector
          product: { get_input: [product_selector, product] }                      # Retrieve product from the Product selector
          image: { get_input: [product_selector, image] }                          # Retrieve machine from the Product selector
          serverProductId: { get_input: [product_selector, serverProductId] }      # Retrieve server product id from the Product selector
          startupScript: |
              #!/bin/bash
              ##########################################################################################################################################
              # Install the Dell Cloud Manager agent, point it to the Dell Cloud Manager server and configure it to startup at boot time.
              ##########################################################################################################################################
              export DCM_URL=${dcm.callback.url}

              ##########################################################################################################################################
              # The -Z argument configures the Dell Cloud Manager agent and allows it to accept unknown certificates. 
              # This is only recommended for testing and should not be done in a production environment.
              ##########################################################################################################################################
              curl -L --retry 10 https://linux-stable-agent.enstratius.com/installer.sh | bash -s - --url $DCM_URL --on-boot -Z

              ##########################################################################################################################################
              # Start the Dell Cloud Manager agent.
              ##########################################################################################################################################
              /etc/init.d/dcm-agent start

        requirements:                                                   # This virtual machine node has a requirement on a firewall
          - firewall: vm_firewall_rules                                 # The firewall statement is named "vm_firewall_rules"
            relationship_type: tosca.relationships.DependsOn

Note

In the example above get_input is an internal function. Refer to Internal functions for more details.

Windows Server Example

node_templates:
  web_vm:
      type: dcm.nodes.Server
      properties:  
        name: "apache-server"
        cloud: { get_input: [account_region_zone_selector, cloud] }              # Retrieve cloud from the AccountRegionSelector
        cloudAccountId: { get_input: [account_region_zone_selector, accountId] } # Retrieve the cloud account ID from the AccountRegionSelector
        region: { get_input: [account_region_zone_selector, region] }            # Retrieve region from the AccountRegionSelector
        zone: { get_input: [account_region_zone_selector, zone] }                # Retrieve zone from the AccountRegionSelector
        platform: { get_input: [product_selector, platform] }                    # Retrieve platform from the Product selector
        architecture: { get_input: [product_selector, architecture] }            # Retrieve architecture from the Product selector
        product: { get_input: [product_selector, product] }                      # Retrieve product from the Product selector
        image: { get_input: [product_selector, image] }                          # Retrieve machine from the Product selector
        serverProductId: { get_input: [product_selector, serverProductId] }      # Retrieve server product id from the Product selector
        startupScript:  |
            ###########################################################################################################################################
            # Install the Dell Cloud Manager agent, point it to the Dell Cloud Manager server and start it.
            ###########################################################################################################################################
            <powershell>

            ###########################################################################################################################################
            # Extract the hostname/ip address and port from the DCM variable ${dcm.callback.url}.
            ###########################################################################################################################################
            $callback_url = "${dcm.callback.url}"
            $host_port = ${callback_url}.TrimStart("wss://").TrimEnd("/agentManager").Split(":", 2)
            $host_name = ${host_port}[0]
            $port = ${host_port}[1]
            if (${port} -eq ${null}) {
              $port = 443
            }

            ###########################################################################################################################################
            # Download the DCM Windows Agent
            ###########################################################################################################################################
            Invoke-WebRequest "http://windows.stable.agent.enstratius.com/DCM.Agent.Setup-latest.msi" -OutFile "c:\windows\temp\dcm_agent.msi"

            ###########################################################################################################################################
            # Install the Windows DCM Agent.  Note: the backtick character (`) can be used to split a command in powershell into multiple lines
            ###########################################################################################################################################
            msiexec /i "c:\windows\temp\dcm_agent.msi" /log "c:\windows\temp\dcm_agent_install.log" `
            /q INSTALLFOLDER="c:\Enstratius\" INSTALL_ENVIRONMENT="Staging" SERVER_ADDRESS=${host_name} `
            SERVER_PORT=${port} CLOUD_PROVIDER="Amazon" | Out-Null

            ###########################################################################################################################################
            # Start the DCM Agent
            ###########################################################################################################################################            
            start-service DCMAgent
            </powershell>
        
      requirements:                                                 # This virtual machine node has a requirement on the firewall
        - firewall: vm_firewall_rules
          relationship_type: tosca.relationships.DependsOn 

Note

In the example above get_input is an internal function. Refer to Internal functions for more details.