주:
- 이 자습서에서는 Oracle Cloud에 액세스해야 합니다. 무료 계정에 등록하려면 Oracle Cloud Infrastructure Free Tier 시작하기를 참조하십시오.
- Oracle Cloud Infrastructure 자격 증명, 테넌시 및 구획에 예제 값을 사용합니다. 실습을 완료했으면 이러한 값을 자신의 클라우드 환경과 관련된 값으로 대체하십시오.
Provision an Oracle Exadata Database Service on Cloud@Customer Virtual Machine Cluster with Ansible
소개
This tutorial explains how to use the OCI Ansible collection to provision Oracle Exadata Database Service on Cloud@Customer virtual machine (VM) clusters. Cloud@CustomerOracle Exadata Database Service on Cloud@Customer VM 클러스터에서 Oracle Exadata Database Service를 생성하려면 먼저 해당 VM 클러스터 네트워크를 생성해야 합니다.
목표
- Provision an Oracle Exadata Database Service on Cloud@Customer VM cluster network and VM cluster using Ansible.
필요 조건
-
An Oracle Cloud Infrastructure (OCI) account with Oracle Exadata Database Service on Cloud@Customer infrastructure available.
-
SSH 키 쌍입니다.
-
다음 구성 요소가 이미 설치되고 올바르게 구성된 제어 노드입니다.
- Ansible.
- OCI Ansible 모음입니다.
- Oracle Cloud Infrastructure 명령행 인터페이스(OCI CLI)
자세한 내용은 Oracle Cloud Infrastructure에서 Ansible을 사용하기 위한 필수 조건을 참조하십시오.
작업 1: Inventory 생성
-
올바르게 구성된 Ansible 제어 노드에 연결합니다.
-
다음 컨텐트를 사용하여
inventory_exacc.yml
라는 인벤토리 파일을 생성합니다.localhost ansible_connection=local
작업 2: 변수 파일 생성
다음 내용에 설명된 모든 변수를 사용하여 variables_exacc.yml
라는 변수 파일을 생성합니다.
# Your variables file
your_region: "eu-frankfurt-1" # The OCI region where your resources will reside - This parameter is optional
your_exa_infra_id: "ocid1.exadatainfrastructure.oc1.eu-frankfurt-1.xxx" # The OCI of your Exadata infrastructure
## Variables related to your VM cluster network
your_vm_net_comp_id: "ocid1.compartment.oc1..xxx" # The compartment OCID of your VM cluster network
your_vm_net_name: "my_vm_cluster_network_name" # The display name of your VM cluster network
your_vm_net_dns: "10.109.10.2" # The list of your DNS server IP addresses. Maximum of 3 allowed.
your_vm_net_ntp: "10.109.10.3" # The list of your NTP server IP addresses. Maximum of 3 allowed.
your_vm_net_scan_ips: ["203.101.10.123", "203.101.10.124", "203.101.10.125"] # The list of your SCAN IP addresses. Three addresses should be provided.
your_vm_net_scan_listener_port_tcp: "1521" # Your SCAN TCPIP port. Default is 1521.
### Variables related to your CLIENT network
your_cli_nodes_hostname_1: "your_1st_hostname" # The hostname of your 1st node on the CLIENT network
your_cli_nodes_ip_1: "203.101.10.101" # The IP address of your 1st node on the CLIENT network
your_cli_nodes_vip_hostname_1: "your_1st_hostname-vip" # The node virtual IP (VIP) host name of your 1st node on the CLIENT network
your_cli_nodes_vip_1: "203.101.10.102" # The node virtual IP (VIP) address of your 1st node on the CLIENT network
your_db_server_ocid_1: "ocid1.dbserver.oc1.eu-frankfurt-1.xxx" # The Db server OCID associated with your 1st node on the CLIENT network
your_cli_nodes_hostname_2: "your_2nd_hostname" # The hostname of your 2nd node on the CLIENT network
your_cli_nodes_ip_2: "203.101.10.103" # The IP address of your 2nd node on the CLIENT network
your_cli_nodes_vip_hostname_2: "your_2nd_hostname-vip" # The node virtual IP (VIP) host name of your 2nd node on the CLIENT network
your_cli_nodes_vip_2: "203.101.10.104" # The node virtual IP (VIP) address of your 2nd node on the CLIENT network
your_db_server_ocid_2: "ocid1.dbserver.oc1.eu-frankfurt-1.yyy" # The Db server OCID associated with your 2nd node on the CLIENT network
your_cli_vm_net_vlan_id: "123" # Your CLIENT network VLAN ID
your_cli_vm_net_netmask: "your_client_netmask" # Your CLIENT network netmask
your_cli_vm_net_gateway: "your_client_gateway_ip" # Your CLIENT network gateway
your_cli_vm_net_domain_name: "your_client_network_domain_name" # Your CLIENT network domain name
### Variables related to your BACKUP network
your_bck_nodes_hostname_1: "your_1st_hostname-bk" # The hostname of your 1st node on the BACKUP network
your_bck_nodes_ip_1: "10.108.10.3" # The IP address of your 1st node on the BACKUP network
your_bck_nodes_hostname_2: "your_2nd_hostname-bk" # The hostname of your 2nd node on the BACKUP network
your_bck_nodes_ip_2: "10.108.10.4" # The IP address of your 2nd node on the BACKUP network
your_bck_vm_net_vlan_id: "456" # Your BACKUP network VLAN ID
your_bck_vm_net_netmask: "your_backup_netmask" # Your BACKUP network netmask
your_bck_vm_net_gateway: "your_backup_gateway_ip" # Your BACKUP network gateway
your_bck_vm_net_domain_name: "your_backup_network_domain_name" # Your BACKUP network domain name
## Variables related to your VM cluster
your_vm_cluster_comp_id: "ocid1.compartment.oc1..yyy" # The compartment OCID of your VM cluster
your_vm_cluster_name: "my_vm_cluster_name"
your_vm_clus_ssh_public_keys: [ "ssh-rsa AAAAB3NzaC...qScP4xMPQ9L5xWsqs" ]
your_license_model: "LICENSE_INCLUDED" # The Oracle license model that applies to the VM cluster. The default is BRING_YOUR_OWN_LICENSE.
작업 3: VM 클러스터 네트워크를 프로비전하기 위한 플레이북 생성
-
다음 내용이 포함된
playbook_exacc_vmCluster_network_creation.yml
라는 플레이북 파일을 만듭니다.- hosts: localhost collections: - oracle.oci vars_files: - variables_exacc.yml tasks: - name: Create VM cluster network oci_database_vm_cluster_network: region: "{{ your_region }}" compartment_id: "{{ your_vm_net_comp_id }}" exadata_infrastructure_id: "{{ your_exa_infra_id }}" display_name: "{{ your_vm_net_name }}" dns: "{{ your_vm_net_dns }}" ntp: "{{ your_vm_net_ntp }}" scans: - hostname: "{{ your_vm_clus_name }}-scan" ips: "{{ your_vm_net_scan_ips }}" scan_listener_port_tcp: "{{ your_vm_net_scan_listener_port_tcp }}" vm_networks: - network_type: CLIENT nodes: - hostname: "{{ your_cli_nodes_hostname_1 }}" ip: "{{ your_cli_nodes_ip_1 }}" vip_hostname: "{{ your_cli_nodes_vip_hostname_1 }}" vip: "{{ your_cli_nodes_vip_1 }}" db_server_id: "{{ your_db_server_ocid_1 }}" - hostname: "{{ your_cli_nodes_hostname_2 }}" ip: "{{ your_cli_nodes_ip_2 }}" vip_hostname: "{{ your_cli_nodes_vip_hostname_2 }}" vip: "{{ your_cli_nodes_vip_2 }}" db_server_id: "{{ your_db_server_ocid_2 }}" vlan_id: "{{ your_cli_vm_net_vlan_id }}" netmask: "{{ your_cli_vm_net_netmask }}" gateway: "{{ your_cli_vm_net_gateway }}" domain_name: "{{ your_cli_vm_net_domain_name }}" - network_type: BACKUP nodes: - hostname: "{{ your_bck_nodes_hostname_1 }}" ip: "{{ your_bck_nodes_ip_1 }}" vip_hostname: "{{ your_bck_nodes_vip_hostname_1 }}" vip: "{{ your_bck_nodes_vip_1 }}" db_server_id: "{{ your_db_server_ocid_1 }}" - hostname: "{{ your_bck_nodes_hostname_2 }}" ip: "{{ your_bck_nodes_ip_2 }}" vip_hostname: "{{ your_bck_nodes_vip_hostname_2 }}" vip: "{{ your_bck_nodes_vip_2 }}" db_server_id: "{{ your_db_server_ocid_2 }}" vlan_id: "{{ your_bck_vm_net_vlan_id }}" netmask: "{{ your_bck_vm_net_netmask }}" gateway: "{{ your_bck_vm_net_gateway }}" domain_name: "{{ your_bck_vm_net_domain_name }}" wait: true register: new_vmClusterNetwork
모듈
oci_database_vm_cluster_network
호출의 끝에 있는 task 키워드register
를 기록해 둡니다. 이것은 모듈의 출력이new_vmClusterNetwork
변수에 등록됨을 의미합니다. 이 변수는 OCID를 포함하여 새로 생성된 VM 클러스터 네트워크의 모든 세부정보를 포함합니다.참고: 기본 Exadata 인프라에는 두 개의
db servers
가 포함되어 있으므로 이 자습서에서는 각 네트워크 유형에 대해 두 개의 노드 딕셔너리만 있습니다. 노드가 4개 또는 8개인 VM 클러스터를 만들려면 각 네트워크 유형에 대해 적절한 수의 노드 사전을 제공해야 합니다. -
playbook_exacc_vmCluster_network_creation.yml
플레이북에서 새로 생성된 VM 클러스터 네트워크의 OCID를 검색하는 다음 작업을 추가합니다.- name: Get OCID of newly created VM cluster network set_fact: your_vm_net_ocid: "{{ item.id }}" loop: - "{{ new_vmClusterNetwork.vm_cluster_network }}" loop_control: label: "{{ item.display_name }}"
-
플레이북
playbook_exacc_vmCluster_network_creation.yml
에서 새로 만든 VM 클러스터 네트워크를 검증하고 해당 구성을 다운로드하기 위해 다음 작업을 추가합니다.- name: Validate VM cluster network oci_database_vm_cluster_network_actions: exadata_infrastructure_id: "{{ your_exa_infra_id }}" vm_cluster_network_id: "{{ your_vm_net_ocid }}" region: "{{ your_region }}" action: validate - name: Download network configuration file of VM cluster network oci_database_vm_cluster_network_actions: exadata_infrastructure_id: "{{ your_exa_infra_id }}" vm_cluster_network_id: "{{ your_vm_net_ocid }}" action: download_vm_cluster_network_config_file config_file_dest: "/tmp/net_config_my_vm_cluster_network.json" region: "{{ your_region }}"
-
플레이북
playbook_exacc_vmCluster_network_creation.yml
에서 다음 작업을 추가하여 검증이 수행된 후 새로 만든 VM 클러스터 네트워크의 세부 정보를 표시합니다.- name: Get facts of newly created VM cluster network oci_database_vm_cluster_network_facts: exadata_infrastructure_id: "{{ your_exa_infra_id }}" vm_cluster_network_id: "{{ your_vm_net_ocid }}" region: "{{ your_region }}" register: newly_created_VM_cluster_network_facts - name: Display details of newly created VM cluster network debug: msg : "{{ newly_created_VM_cluster_network_facts.vm_cluster_networks }}"
작업 4: Playbook을 실행하여 VM 클러스터 네트워크 프로비전
-
상세 정보 표시 옵션을 사용하여 VM 클러스터 네트워크 만들기 플레이북을 실행합니다.
ansible-playbook playbook_exacc_vmCluster_network_creation.yml -i inventory_exacc.yml -vvv
주: 상세 정보 표시 옵션
-vvv
를 사용하면 상세 정보 표시 수준이 높아지고 플레이북이 실행되는 동안 모든 기본 단계를 이해하는 데 도움이 됩니다. -
몇 분 후
oci_database_vm_cluster_network
모듈이 성공적으로 실행되면 다음 출력이 반환됩니다.changed: [localhost] => { [...], "vm_cluster_network": { "compartment_id": "ocid1.compartment.oc1..xxx", "defined_tags": { "Oracle-Tags": { "CreatedBy": "creation_user", "CreatedOn": "2025-01-09T09:30:30.631Z" } }, "display_name": "my_vm_cluster_network_name", "dns": [ "10.109.10.2" ], "dr_scans": null, "exadata_infrastructure_id": "ocid1.exadatainfrastructure.oc1.eu-frankfurt-1.xxx", "freeform_tags": {}, "id": "ocid1.vmclusternetwork.oc1.eu-frankfurt-1.xxx", "lifecycle_details": null, "lifecycle_state": "REQUIRES_VALIDATION", "ntp": [ "10.109.10.3" ], "scans": [ { "hostname": "name_of_your-scan", "ips": [ "203.101.10.123", "203.101.10.124", "203.101.10.125" ], "port": 1521, "scan_listener_port_tcp": 1521, "scan_listener_port_tcp_ssl": 2484 } ], "time_created": "2025-01-09T09:30:30.818000+00:00", "vm_cluster_id": null, "vm_networks": [ { "domain_name": "your_client_network_domain_name", "gateway": "your_client_gateway_ip", "netmask": "your_client_netmask", "network_type": "CLIENT", "nodes": [ { "db_server_id": "ocid_of_your_1st_db_server", "hostname": "your_1st_hostname", "ip": "203.101.10.101", "lifecycle_state": "REQUIRES_VALIDATION", "vip": "203.101.10.102", "vip_hostname": "your_1st_hostname-vip" }, { "db_server_id": "ocid_of_your_2nd_db_server", "hostname": "your_2nd_hostname", "ip": "203.101.10.103", "lifecycle_state": "REQUIRES_VALIDATION", "vip": "203.101.10.104", "vip_hostname": "your_2nd_hostname-vip" } ], "vlan_id": "123" }, { "domain_name": "your_backup_network_domain_name", "gateway": "your_backup_gateway_ip", "netmask": "your_backup_netmask", "network_type": "BACKUP", "nodes": [ { "db_server_id": "ocid_of_your_1st_db_server", "hostname": "your_1st_hostname-bk", "ip": "10.108.10.3", "lifecycle_state": "REQUIRES_VALIDATION", }, { "db_server_id": "ocid_of_your_2nd_db_server", "hostname": "your_2nd_hostname-bk", "ip": "10.108.10.4", "lifecycle_state": "REQUIRES_VALIDATION", } ], "vlan_id": "456" } ] } }
작업 5: VM 클러스터를 프로비전하기 위한 플레이북 생성
-
다음 내용이 포함된
playbook_exacc_vmCluster_creation.yml
라는 플레이북 파일을 만듭니다.- hosts: localhost collections: - oracle.oci vars_files: - variables_exacc.yml tasks: - name: Get all existing VM cluster networks oci_database_vm_cluster_network_facts: exadata_infrastructure_id: "{{ your_exa_infra_id }}" compartment_id: "{{ your_vm_net_comp_id }}" region: "{{ your_region }}" register: get_all_vmClusterNetworks - name: Get OCID of the newly created VM cluster network set_fact: your_vm_net_ocid: "{{ item.id }}" loop: "{{ get_all_vmClusterNetworks.vm_cluster_networks }}" loop_control: label: "{{ item.display_name }}" when: item.display_name == your_vm_net_name
이러한 두 작업은 VM 클러스터 만들기에 필요하므로 새로 만든 VM 클러스터 네트워크의 OCID를 검색하는 데 사용됩니다.
-
VM 클러스터 만들기 작업을
playbook_exacc_vmCluster_creation.yml
플레이북에 추가합니다.- name: Create VM cluster oci_database_vm_cluster: region: "{{ your_region }}" compartment_id: "{{ your_vm_cluster_comp_id }}" display_name: "{{ your_vm_cluster_name }}" exadata_infrastructure_id: "{{ your_exa_infra_id }}" vm_cluster_network_id: "{{ your_vm_net_ocid }}" gi_version: "19.0.0.0.0" cpu_core_count: "4" ssh_public_keys: "{{ your_vm_clus_ssh_public_keys }}" time_zone: "Europe/Zurich" memory_size_in_gbs: "60" db_node_storage_size_in_gbs: "120" data_storage_size_in_tbs: "2" license_model: "{{ your_license_model }}" is_sparse_diskgroup_enabled: "false" is_local_backup_enabled: "false" data_collection_options: is_diagnostics_events_enabled: "false" is_health_monitoring_enabled: "false" is_incident_logs_enabled: "false" wait: true wait_timeout: 18000
gi_version
매개변수에 대해 현재 허용되는 값은19.0.0.0.0
및23.0.0.0.0
입니다. 그렇지 않으면Cannot create VM cluster because Oracle Grid Infrastructure version is invalid. Valid versions are: [19.0.0.0.0, 23.0.0.0.0].
오류가 표시됩니다.주: VM 클러스터를 만들려면 일반적으로 최대 3시간이 걸립니다. 따라서 코드에
wait: true
및wait_timeout: 18000
지침이 추가됩니다.
작업 6: Playbook을 실행하여 VM 클러스터 프로비전
-
상세 정보 표시 옵션을 사용하여 VM 클러스터 만들기 플레이북을 실행합니다.
ansible-playbook playbook_exacc_vmCluster_creation.yml -i inventory_exacc.yml -vvv
주: 상세 정보 표시 옵션
-vvv
를 사용하면 상세 정보 표시 수준이 높아지고 플레이북이 실행되는 동안 모든 기본 단계를 이해하는 데 도움이 됩니다. -
몇 분 후
oci_database_vm_cluster
모듈이 성공적으로 실행되면 다음 출력이 반환됩니다.changed: [localhost] => { [...], "vm_clusters": [ { "availability_domain": "your_availability_domain", "compartment_id": "ocid1.compartment.oc1..yyy", "cpus_enabled": 4, "data_collection_options": { "is_diagnostics_events_enabled": false, "is_health_monitoring_enabled": false, "is_incident_logs_enabled": false }, "data_storage_size_in_gbs": null, "data_storage_size_in_tbs": 2.0, "db_node_storage_size_in_gbs": 120, "db_servers": [ "ocid1.dbserver.oc1.eu-frankfurt-1.xxx", "ocid1.dbserver.oc1.eu-frankfurt-1.yyy" ], "defined_tags": { "Oracle-Tags": { "CreatedBy": "creation_user", "CreatedOn": "2025-01-09T12:40:17.201Z" } }, "display_name": "my_vm_cluster_name", "exadata_infrastructure_id": "ocid1.exadatainfrastructure.oc1.eu-frankfurt-1.xxx", "file_system_configuration_details": [ { "file_system_size_gb": 15, "mount_point": "/" }, [...], { "file_system_size_gb": 16, "mount_point": "swap" } ], "freeform_tags": {}, "gi_software_image_id": null, "gi_version": "19.24.0.0.0", "id": "ocid1.vmcluster.oc1.eu-frankfurt-1.xxx", "is_local_backup_enabled": false, "is_sparse_diskgroup_enabled": false, "last_patch_history_entry_id": null, "license_model": "your_license_model", "lifecycle_details": null, "lifecycle_state": "AVAILABLE", "memory_size_in_gbs": 60, "ocpus_enabled": null, "shape": "your_ExadataCC_shape", "ssh_public_keys": null, "system_version": "24.1.6.0.0.241115", "time_created": "2025-01-09T12:40:17.256000+00:00", "time_zone": "Europe/Zurich", "vm_cluster_network_id": "your_newly_created_vmCluster_network_OCID" } ] }
작업 7: 새로 만든 VM 클러스터의 상태를 확인하기 위한 플레이북 만들기
다음 내용이 포함된 playbook_exacc_vmCluster_post_creation_checks.yml
라는 플레이북 파일을 만듭니다.
- hosts: localhost
collections:
- oracle.oci
vars_files:
- variables_exacc.yml
tasks:
- name: Get newly created vmCluster facts
oci_database_vm_cluster_facts:
region: "{{ your_region }}"
compartment_id: "{{ your_vm_cluster_comp_id }}"
exadata_infrastructure_id: "{{ your_exa_infra_id }}"
display_name: "{{ your_vm_cluster_name }}"
register: output_cluster_facts
- name: Set vmCluster facts
set_fact:
your_vm_cluster_id: "{{ item.id }}"
your_vm_cluster_state: "{{ item.lifecycle_state }}"
loop: "{{ output_cluster_facts.vm_clusters }}"
loop_control:
label: "{{ item.display_name }}"
when: item.display_name == your_vm_cluster_name
- name: Check VM cluster state
debug:
msg: "The VM cluster your_vm_cluster_name is in lifecycle state your_vm_cluster_state ."
작업 8: Playbook을 실행하여 새로 생성된 VM 클러스터의 상태 확인
-
상세 정보 표시 옵션을 사용하여 VM 클러스터 검사 플레이북을 실행합니다.
ansible-playbook playbook_exacc_vmCluster_post_creation_checks.yml -i inventory_exacc.yml -vvv
주: 상세 정보 표시 옵션
-vvv
를 사용하면 상세 정보 표시 수준이 높아지고 플레이북이 실행되는 동안 모든 기본 단계를 이해하는 데 도움이 됩니다. -
몇 초 후 플레이북
playbook_exacc_vmCluster_post_creation_checks.yml
를 성공적으로 실행하면 다음 출력이 반환됩니다.ok: [localhost] => { "msg": "The VM cluster your_vm_cluster_name is in lifecycle state AVAILABLE." }
관련 링크
확인
- 작성자 - Flora Barriele(EMEA Cloud Lift 구현 기술 리드 - 데이터베이스)
추가 학습 자원
docs.oracle.com/learn에서 다른 실습을 탐색하거나 Oracle Learning YouTube 채널에서 더 많은 무료 학습 콘텐츠에 액세스하세요. 또한 Oracle Learning Explorer가 되려면 education.oracle.com/learning-explorer을 방문하십시오.
제품 설명서는 Oracle Help Center를 참조하십시오.
Provision an Oracle Exadata Database Service on Cloud@Customer Virtual Machine Cluster with Ansible
G27484-01
February 2025
Copyright ©2025, Oracle and/or its affiliates.