### Example Notification Server Start Source: https://docs.openstack.org/developer/performance-docs/test_plans/mq/plan.html An example command to start the notification server with specific credentials and host. ```bash python simulator.py --url rabbit://nova:DUoqsyrq@192.168.0.4:5673/ notify-server ``` -------------------------------- ### Example Notification Client Start Source: https://docs.openstack.org/developer/performance-docs/test_plans/mq/plan.html An example command to start the notification client with specific parameters for threads and messages. ```bash python simulator.py --url rabbit://nova:DUoqsyrq@192.168.0.4:5673/ notify-client -p 10 -m 100 ``` -------------------------------- ### Example RPC Cast Server Start Source: https://docs.openstack.org/developer/performance-docs/test_plans/mq/plan.html An example command to start the RPC server with specific credentials and host. ```bash python simulator.py --url rabbit://nova:DUoqsyrq@192.168.0.4:5673/ --debug true rpc-server ``` -------------------------------- ### Example RPC Cast Client Start Source: https://docs.openstack.org/developer/performance-docs/test_plans/mq/plan.html An example command to start the RPC client with specific parameters for threads and messages. ```bash python simulator.py --url rabbit://nova:DUoqsyrq@192.168.0.4:5673/ rpc-client --is-cast true -p 10 -m 100 ``` -------------------------------- ### Generate Install Guide Skeleton Source: https://docs.openstack.org/doc-contrib-guide/project-install-guide.html Use the installguide-cookiecutter to create a basic structure for your project's installation guide within your repository. ```bash $ cookiecutter https://opendev.org/openstack/installguide-cookiecutter.git ``` -------------------------------- ### Complete Multi-Cloud Example with Shade Source: https://docs.openstack.org/developer/shade/multi-cloud-demo.html This example demonstrates initializing Shade for multiple clouds, uploading an image, finding a suitable flavor, and booting a server with automatic IP assignment. Ensure you have the necessary image file ('devuan-jessie.qcow2') available. ```python import shade # Initialize and turn on debug logging shade.simple_logging(debug=True) for cloud_name, region_name in [ ('my-vexxhost', 'ca-ymq-1'), ('my-citycloud', 'Buf1'), ('my-internap', 'ams01')]: # Initialize cloud cloud = shade.openstack_cloud(cloud=cloud_name, region_name=region_name) # Upload an image to the cloud image = cloud.create_image( 'devuan-jessie', filename='devuan-jessie.qcow2', wait=True) # Find a flavor with at least 512M of RAM flavor = cloud.get_flavor_by_ram(512) # Boot a server, wait for it to boot, and then do whatever is needed # to get a public ip for it. cloud.create_server( 'my-server', image=image, flavor=flavor, wait=True, auto_ip=True) ``` -------------------------------- ### Example Keystone Installation Playbook Source: https://docs.openstack.org/openstack-ansible-os_keystone/2023.1 An Ansible playbook demonstrating the installation and setup of the Keystone role, including numerous configuration variables. ```yaml --- - name: Installation and setup of Keystone hosts: keystone_all user: root roles: - { role: "os_keystone", tags: [ "os-keystone" ] } vars: external_lb_vip_address: 10.100.100.102 internal_lb_vip_address: 10.100.100.102 keystone_galera_address: 10.100.100.101 keystone_galera_database: keystone keystone_venv_tag: "testing" keystone_developer_mode: true keystone_git_install_branch: master keystone_auth_admin_password: "SuperSecretePassword" keystone_oslomsg_rpc_password: "secrete" keystone_oslomsg_notify_password: "secrete" keystone_container_mysql_password: "SuperSecrete" keystone_oslomsg_rpc_transport: rabbit keystone_oslomsg_rpc_servers: 10.100.100.101 keystone_oslomsg_rpc_port: 5671 keystone_oslomsg_rpc_use_ssl: true keystone_oslomsg_rpc_userid: keystone keystone_oslomsg_rpc_vhost: /keystone keystone_oslomsg_notify_transport: rabbit keystone_oslomsg_notify_servers: 10.100.100.101 keystone_oslomsg_notify_port: 5671 keystone_oslomsg_notify_use_ssl: true keystone_oslomsg_notify_userid: keystone keystone_oslomsg_notify_vhost: /keystone galera_client_drop_config_file: false galera_root_user: root vars_prompt: - name: "galera_root_password" prompt: "What is galera_root_password?" ``` -------------------------------- ### Create and Boot Server with Shade Source: https://docs.openstack.org/developer/shade/index.html Python code demonstrating how to initialize Shade, upload an image, find a flavor, and boot a server with automatic IP assignment. ```python import shade # Initialize and turn on debug logging shade.simple_logging(debug=True) # Initialize cloud # Cloud configs are read with os-client-config cloud = shade.openstack_cloud(cloud='mordred') # Upload an image to the cloud image = cloud.create_image( 'ubuntu-trusty', filename='ubuntu-trusty.qcow2', wait=True) # Find a flavor with at least 512M of RAM flavor = cloud.get_flavor_by_ram(512) # Boot a server, wait for it to boot, and then do whatever is needed # to get a public ip for it. cloud.create_server( 'my-server', image=image, flavor=flavor, wait=True, auto_ip=True) ``` -------------------------------- ### Basic Swift Configuration Example Source: https://docs.openstack.org/openstack-ansible-os_swift/2023.1 An example of a basic Swift configuration, specifying storage network, replication network, drives, mount point, and storage policies. This serves as a starting point for cluster setup. ```yaml swift: part_power: 8 storage_network: 'br-storage' replication_network: 'br-storage' drives: - name: swift1.img - name: swift2.img - name: swift3.img mount_point: /srv storage_policies: - policy: name: default index: 0 default: True ``` -------------------------------- ### Etcd Get Metrics Setup Source: https://docs.openstack.org/developer/performance-docs/methodologies/monitoring/index.html Prepares to fetch etcd metrics by locating `etcdctl`, `jq`, and `curl`, and identifying leader and slave endpoints. Exits if `jq` or `curl` are not installed. ```bash #!/bin/bash -e ETCD=/usr/local/bin/etcdctl type jq >/dev/null 2>&1 || ( echo "Jq is not installed" ; exit 1 ) type curl >/dev/null 2>&1 || ( echo "Curl is not installed" ; exit 1 ) # get etcd members credentials MEMBERS="${ETCD} --endpoints https://127.0.0.1:2379 member list" LEADER_ID=$(eval "$MEMBERS" | awk -F ':' '/isLeader=true/ {print $1}') LEADER_ENDPOINT=$(eval "$MEMBERS" | awk '/isLeader=true/ {print $4}' | cut -d"=" -f2) SLAVE_ID=$(eval "$MEMBERS" | grep 'isLeader=false' | head -n 1 | awk -F ":" '{print $1}') SLAVE_ENDPOINT=$(eval "$MEMBERS" | grep 'isLeader=false' | head -n 1 | awk '{print $4}' | cut -d"=" -f2) ``` -------------------------------- ### Run Infrastructure Setup Playbook Source: https://docs.openstack.org/project-deploy-guide/openstack-ansible/draft/run-playbooks.html Run the `setup-infrastructure.yml` playbook to install essential infrastructure services like Memcached, RabbitMQ, and Galera. ```bash # openstack-ansible setup-infrastructure.yml ``` -------------------------------- ### Example OpenStack-Ansible Playbook for Nova Source: https://docs.openstack.org/openstack-ansible-os_nova/2024.1 This playbook demonstrates the installation and setup of the Nova service using the os_nova role. It includes variable definitions for Galera and prompts for the Galera root password. ```yaml --- - name: Installation and setup of Nova hosts: nova_all user: root roles: - role: "os_nova" tags: - os-nova vars: nova_galera_address: "{{ internal_lb_vip_address }}" galera_root_user: root vars_prompt: - name: "galera_root_password" prompt: "What is galera_root_password?" ``` -------------------------------- ### Instance Power Off Start Payload Example Source: https://docs.openstack.org/developer/nova/notifications.html Example payload for an instance power off start notification. ```json { "event_type": "instance.power_off.start", "payload": { "nova_object.data": { "action_initiator_project": "6f70656e737461636b20342065766572", "action_initiator_user": "fake", "architecture": "x86_64", "auto_disk_config": "MANUAL", "availability_zone": "nova", "block_devices": [ { "nova_object.data": { "boot_index": null, ``` -------------------------------- ### Create Server with Scheduler Hints Source: https://docs.openstack.org/api-ref/compute?expanded=reset-server-state-os-resetstate-action-detail%2Clist-actions-for-server-detail This example demonstrates how to create a server and specify scheduler hints to influence its placement. It includes various optional scheduler hints like `different_host`, `group`, `query`, `same_host`, and `target_cell`. ```APIDOC ## POST /servers ### Description Creates a new server with specified configurations, including optional scheduler hints. ### Method POST ### Endpoint /servers ### Parameters #### Request Body - **server** (object) - Required - Server configuration details. - **accessIPv4** (string) - Optional - IPv4 access address. - **accessIPv6** (string) - Optional - IPv6 access address. - **name** (string) - Required - The name of the server. - **imageRef** (string) - Required - Reference to the image to use for the server. - **flavorRef** (string) - Required - Reference to the flavor to use for the server. - **availability_zone** (string) - Optional - The availability zone for the server. - **OS-DCF:diskConfig** (string) - Optional - Disk configuration setting. - **metadata** (object) - Optional - Metadata for the server. - **personality** (array) - Optional - Files to inject into the server. - **security_groups** (array) - Optional - Security groups to apply to the server. - **user_data** (string) - Optional - User data script to run on server boot. - **networks** (array or string) - Optional - Network configurations for the server. Can be an array of network objects or the string "auto". - **block_device_mapping_v2** (array) - Optional - Block device mappings for the server. - **trusted_image_certificates** (array) - Optional - Trusted image certificates for the server. - **OS-SCH-HNT:scheduler_hints** (object) - Optional - Scheduler hints to influence server placement. - **different_host** (array) - Optional - Schedule on a different host from a set of servers. - **group** (string) - Optional - Schedule according to a server group policy. - **query** (string) - Optional - Schedule using a custom JSON filter. - **same_host** (array) - Optional - Schedule on the same host as another server. - **target_cell** (string) - Optional - Schedule in a specific target cell. ### Request Example ```json { "server" : { "accessIPv4": "1.2.3.4", "accessIPv6": "80fe::", "name" : "new-server-test", "imageRef" : "70a599e0-31e7-49b7-b260-868f441e862b", "flavorRef" : "1", "availability_zone": "us-west", "OS-DCF:diskConfig": "AUTO", "metadata" : { "My Server Name" : "Apache1" }, "personality": [ { "path": "/etc/banner.txt", "contents": "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 b25zLiINCg0KLVJpY2hhcmQgQmFjaA==" } ], "security_groups": [ { "name": "default" } ], "user_data" : "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==" }, "OS-SCH-HNT:scheduler_hints": { "same_host": "48e6a9f6-30af-47e0-bc04-acaed113bb4e" } } ``` ### Response #### Success Response (200) - **server** (object) - Details of the created server. ``` -------------------------------- ### Example Playbook for RabbitMQ Server Installation Source: https://docs.openstack.org/openstack-ansible-rabbitmq_server/2025.1 An example Ansible playbook to install the RabbitMQ server role. ```yaml --- - name: Install RabbitMQ server hosts: rabbitmq_all user: root serial: - 1 - 100% roles: - role: rabbitmq_server tags: - rabbitmq-server vars: rabbitmq_cookie_token: secrete ``` -------------------------------- ### Create Server with Scheduler Hints Source: https://docs.openstack.org/api-ref/compute?expanded= Example of creating a server with scheduler hints to specify placement on a different host. ```json { "server" : { "accessIPv4": "1.2.3.4", "accessIPv6": "80fe::", "name" : "new-server-test", "imageRef" : "70a599e0-31e7-49b7-b260-868f441e862b", "flavorRef" : "1", "availability_zone": "us-west", "OS-DCF:diskConfig": "AUTO", "metadata" : { "My Server Name" : "Apache1" }, "personality": [ { "path": "/etc/banner.txt", "contents": "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 b25zLiINCg0KLVJpY2NoYXJkIEJhY2g==" } ], "security_groups": [ { "name": "default" } ], "user_data" : "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==" }, "OS-SCH-HNT:scheduler_hints": { "same_host": "48e6a9f6-30af-47e0-bc04-acaed113bb4e" } } ``` -------------------------------- ### Create Server with SimpleCIDRAffinityFilter Hints Source: https://docs.openstack.org/developer/nova/filter_scheduler.html Shows how to create a server using the openstack command-line tool with hints for IP subnet range scheduling. ```bash $ openstack server create \ --image cedef40a-ed67-4d10-800e-17455edce175 --flavor 1 \ --hint build_near_host_ip=192.168.1.1 --hint cidr=/24 \ server-1 ``` -------------------------------- ### Example Playbook for Installing Galera Client Source: https://docs.openstack.org/openstack-ansible-galera_server/latest An example Ansible playbook to install the Galera client component. It targets localhost and configures the necessary variables for client installation. ```yaml --- - name: Install Galera client hosts: localhost roles: - galera_server vars: galera_install_server: false galera_install_client: true galera_root_password: secrete ``` -------------------------------- ### Install Ceph Client Playbook Example Source: https://docs.openstack.org/openstack-ansible-ceph_client/victoria An example Ansible playbook to install the Ceph client role on all hosts. ```yaml - name: Install Ceph client hosts: all user: root roles: - role: "openstack-ansible-ceph_client" ``` -------------------------------- ### Example Playbook for Installing PKI Role Source: https://docs.openstack.org/ansible-role-pki/2023.2 This playbook demonstrates how to include and run the pki role on localhost. ```yaml --- - name: Install PKI hosts: localhost user: root roles: - role: "pki" ``` -------------------------------- ### Create Server with Scheduler Hints Source: https://docs.openstack.org/api-ref/compute Example of creating a server with scheduler hints to specify placement on the same host as another server. ```json { "server" : { "accessIPv4": "1.2.3.4", "accessIPv6": "80fe::", "name" : "new-server-test", "imageRef" : "70a599e0-31e7-49b7-b260-868f441e862b", "flavorRef" : "1", "availability_zone": "us-west", "OS-DCF:diskConfig": "AUTO", "metadata" : { "My Server Name" : "Apache1" }, "personality": [ { "path": "/etc/banner.txt", "contents": "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 b25zLiINCg0KLVJpY2hhcmQgQmFjaA==" } ], "security_groups": [ { "name": "default" } ], "user_data" : "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==" }, "OS-SCH-HNT:scheduler_hints": { "same_host": "48e6a9f6-30af-47e0-bc04-acaed113bb4e" } } ``` -------------------------------- ### Example Playbook for Tacker Server Installation Source: https://docs.openstack.org/openstack-ansible-os_tacker/2025.1 An example Ansible playbook to install the Tacker server using the os_tacker role. ```yaml --- - name: Install tacker server hosts: tacker_all user: root roles: - role: "os_tacker" tags: - "os-tacker" ``` -------------------------------- ### Example Playbook for Designate Installation Source: https://docs.openstack.org/openstack-ansible-os_designate/train This playbook demonstrates how to install the Designate server using the os_designate role. It specifies hosts, user, roles, and necessary variables for configuration. ```yaml --- - name: Install Designate Server hosts: designate_all user: root roles: - { role: "os_designate", tags: [ "os-designate" ] } vars: external_lb_vip_address: 172.16.24.1 internal_lb_vip_address: 192.168.0.1 designate_galera_address: "{{ internal_lb_vip_address }}" designate_galera_password: "SuperSecretePassword1" designate_service_password: "SuperSecretePassword3" designate_oslomsg_rpc_password: "SuperSecretePassword4" ``` -------------------------------- ### Create Fedora Disk Image and Install Source: https://docs.openstack.org/image-guide/create-images-manually-example-fedora-image.html Use qemu-img to create a disk image and virt-install to begin the Fedora installation process. Ensure the netinstall ISO is accessible. ```bash # qemu-img create -f qcow2 /tmp/fedora.qcow2 10G # virt-install --virt-type kvm --name fedora --ram 1024 \ --disk /tmp/fedora.qcow2,format=qcow2 \ --network network=default \ --graphics vnc,listen=0.0.0.0 --noautoconsole \ --os-type=linux --os-variant=fedora23 \ --location=/tmp/Fedora-Server-netinst-x86_64-25-1.3.iso ``` -------------------------------- ### Example CloudKitty Installation Playbook Source: https://docs.openstack.org/openstack-ansible-os_cloudkitty/2025.2 An example Ansible playbook for installing the CloudKitty service, specifying hosts, roles, and necessary variables. ```yaml - name: Install cloudkitty service hosts: cloudkitty_all user: root roles: - { role: "os_cloudkitty", tags: [ "os-cloudkitty" ] } vars: external_lb_vip_address: 172.16.24.1 internal_lb_vip_address: 192.168.0.1 cloudkitty_galera_address: "{{ internal_lb_vip_address }}" cloudkitty_container_mysql_password: "SuperSecretePassword1" cloudkitty_service_password: "SuperSecretePassword2" cloudkitty_oslomsg_rpc_password: "SuperSecretePassword3" cloudkitty_oslomsg_notify_password: "SuperSecretePassword4" ``` -------------------------------- ### Example Playbook for Senlin Installation Source: https://docs.openstack.org/openstack-ansible-os_senlin/victoria This playbook demonstrates how to install the Senlin server using the os_senlin role. It targets hosts in the 'senlin_all' group and applies the role with the 'os-senlin' tag. ```yaml --- - name: Install senlin server hosts: senlin_all user: root roles: - { role: "os_senlin", tags: [ "os-senlin" ] } ``` -------------------------------- ### Download and install Cloudbase-Init Source: https://docs.openstack.org/image-guide/create-images-manually-example-windows-image.html Downloads the Cloudbase-Init MSI installer and then runs the installer. Configuration options for username, network adapter, and serial port logging should be adjusted as needed. ```powershell C:\Invoke-WebRequest -UseBasicParsing https://cloudbase.it/downloads/CloudbaseInitSetup_Stable_x64.msi -OutFile cloudbaseinit.msi C:\.\cloudbaseinit.msi ``` -------------------------------- ### Example Playbook for Adjutant Installation Source: https://docs.openstack.org/openstack-ansible-os_adjutant/latest An example Ansible playbook to install the Adjutant server role. Includes setting necessary variables. ```yaml - name: Install adjutant server hosts: adjutant_all user: root roles: - { role: "os_adjutant", tags: [ "os-adjutant" ] } vars: external_lb_vip_address: 172.16.24.1 internal_lb_vip_address: 192.168.0.1 adjutant_galera_address: "{{ internal_lb_vip_address }}" adjutant_galera_password: "SuperSecretePassword1" adjutant_service_password: "SuperSecretePassword2" adjutant_rabbitmq_password: "SuperSecretePassword3" ``` -------------------------------- ### Get Stack Files Response Example Source: https://docs.openstack.org/api-ref/orchestration/v1/index.html Example response from the 'Get stack files' endpoint, mapping file paths to their content. ```json { "file:///home/username/hello.sh": "#!/bin/sh\necho hello\n" } ``` -------------------------------- ### Download Ubuntu ISO and Prepare Disk for VM Source: https://docs.openstack.org/image-guide/create-images-manually-example-ubuntu-image.html Downloads the Ubuntu network installation ISO, sets ownership for the ISO file, creates a qcow2 disk image for the VM, and sets ownership for the disk image. ```bash # wget -O /var/lib/libvirt/boot/bionic-mini.iso \ http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso # chown libvirt-qemu:kvm /var/lib/libvirt/boot/bionic-mini.iso # qemu-img create -f qcow2 /var/lib/libvirt/images/bionic.qcow2 10G # chown libvirt-qemu:kvm /var/lib/libvirt/images/bionic.qcow2 ```