Oracle® Solaris에서 OpenStack(Kilo) 설치 및 구성

인쇄 보기 종료

업데이트 날짜: 2016년 6월
 
 

게스트 이미지를 자동으로 초기화하는 방법

시작하기 전에

다음을 완료한 상태여야 합니다.

  • 이미지를 클라우드에 배치할 시스템의 UA(Unified Archive)를 만들었습니다. UA를 만들기 전에 해당 시스템에 Cloudbase-init 패키지가 포함되어 있는지 확인합니다.

    UA 만들기에 대한 지침은 Oracle Solaris의 시스템 복구 및 복제용 Unified Archive 사용 설명서의 Unified Archives 작업 장을 참조하십시오. 이 설명서는 Operating Systems Documentation의 사용 중인 Oracle Solaris 버전 라이브러리에 있습니다.

  • Heat 템플리트의 사용자 데이터 섹션에서 사용자 데이터 정보를 제공합니다. 템플리트를 *.yaml 파일로 저장합니다.

  1. Cloudbase-Init 패키지를 포함하는 이미지를 Glance에 업로드합니다.
  2. 다음 명령을 실행합니다.
    # heat stack-create -f yaml-template \
       -P key_name=your key name;image=image name\
       private_net=name of tenant private network stack-name
    
예 8  Cloudbase-Init를 사용하는 Heat 템플리트

다음 예는 Cloudbase-Init로 처리되는 Heat 템플리트를 보여줍니다. 제공해야 하는 정보는 굵게 표시되고 편의를 위해 사용자 데이터 정보가 표시됩니다. 템플리트 이름은 test.yaml입니다.

heat_template_version: 2013-05-23

description: HOT template to deploy one server into an existing neutron tenant 
network and assign a floating IP address so it's routable from the public network.

parameters:
  key_name:Server1Key
    type: string
    description: Name of keypair to assign to server
  image:Solaris Non-global Zone
    type: string
    description: Name of image to use for server
  flavor:8
    type: string
    description: Flavor to use for server
    default: 1
  public_net:
    type: string
    description: 
      Name or ID of public network for which floating IP address will 
be allocated
    default: oracle
  private_net:HR
    type: string
    description: Name or ID of private network into which server is 
deployed

resources:
  server1:
    type: OS::Nova::Server
    properties:
      name: { get_param: 'OS::stack_name' }
      image: { get_param: image }
      flavor: { get_param: flavor }
      key_name: { get_param: key_name }
      networks:
        - port: { get_resource: server1_port }
      user_data_format: RAW
---------- 사용자 데이터 섹션 시작 ----------
      user_data:
        str_replace:
          template: |
            #!/bin/ksh
            print "This is a test."

  server1_port:
    type: OS::Neutron::Port
    properties:
      network: { get_param: private_net }

  server1_floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network: { get_param: public_net }
      port_id: { get_resource: server1_port }

outputs:
  server1_private_ip:
    description: IP address of server1 in private network
    value: { get_attr: [ server1, first_address ] }
  server1_public_ip:
    description: Floating IP address of server1 in public network
    value: { get_attr: [ server1_floating_ip, floating_ip_address ] }

템플리트를 배치하려면 다음을 입력합니다.

# heat stack-create -f test.yaml -P key_name=Server1Key \
   -P image=Solaris Non-global Zone\
...-P flavor=8
   -P private_net=HR teststack

명령의 각 옵션에 대한 특정 값은 test.yaml 템플리트 파일의 정보에서 온 것입니다. 공용 네트워크는 oracle이며 기본값입니다.