Skip to main content

How Virtual Machines Are Created in OpenStack:

Step-by-Step Guide to Creating a VM in OpenStack: 

1. Log in to OpenStack CLI:
The first step is to log into the OpenStack command-line interface (CLI) by sourcing your OpenStack RC file. This file contains the credentials and environment variables necessary to authenticate you with OpenStack services.
# source <your-openrc-file.sh>

2. Select or Upload an Image:
VMs in OpenStack are booted from pre-defined images. You can either use an available image or upload your own. 

List available images:
# openstack image list
Upload a new image:
# openstack image create --disk-format qcow2 --container-format bare --file <IMAGE_PATH> <IMAGE_NAME>
This ensures you have the correct image available for booting the VM.

3. Create or Choose a Network:
A VM needs to be attached to a network for connectivity. If you don't have one, you can create a new network. 

Create a network:
# openstack network create <NETWORK_NAME>
Create a subnet for the network:
# openstack subnet create --network <NETWORK_NAME> --subnet-range 192.168.0.0/24 <SUBNET_NAME>

4. Select or Create a Flavor:
Flavors in OpenStack determine the size of the VM, specifying the number of vCPUs, memory, and disk space.

List available flavors:
# openstack flavor list
Create a new flavor (if required):
# openstack flavor create --ram 2048 --vcpus 2 --disk 20 <FLAVOR_NAME>

5. Set Up Security Groups:
Security groups act as virtual firewalls, controlling incoming and outgoing traffic for your VM.

List existing security groups:
# openstack security group list
Create a new security group:
#openstack security group create <SECURITY_GROUP_NAME>
Add rules to allow traffic (e.g., SSH):
# openstack security group rule create --proto tcp --dst-port 22 <SECURITY_GROUP_ID>

6. Launch the VM:
Now that you have selected an image, network, flavor, and security group, it’s time to launch the VM.

Launch a VM:
# openstack server create --flavor <FLAVOR_ID> --image <IMAGE_ID> --network <NETWORK_ID> --security-group <SEC_GROUP_ID> --key-name <KEY_NAME> <VM_NAME>
Check the VM status:
# openstack server list
Once the status changes to ACTIVE, the VM is successfully running. 

7. Assign a Floating IP (Optional):
To access the VM externally, you can associate a floating IP with it.

Create a floating IP:
# openstack floating ip create <EXTERNAL_NETWORK>
Assign the floating IP:
# openstack server add floating ip <VM_ID> <FLOATING_IP>

8. Access the VM:
Once the VM is up and running with a floating IP, you can SSH into the instance:
# ssh -i <KEY_FILE> <USERNAME>@<FLOATING_IP>

Comments

Popular posts from this blog

temp-1

  🔧 vast_id Configuration Key: vast_id Description This section defines the VAST ID , a unique numeric identifier used by internal systems for asset tracking, automation, or integration with enterprise management platforms. It helps associate the server with inventory records, monitoring tools, or deployment workflows. ✅ Used during provisioning to register the system in centralized databases or orchestration systems. JSON Format json 1 "vast_id" : 12194 ✅ Can also be provided as a string: json 1 "vast_id" : "12194" Field Reference vast_id String or Integer Unique identifier for the system in VAST (Verizon Asset Systems Tracker) 12194 ✅ Must be non-empty and numeric — leading zeros may be stripped depending on system. Validations Enforced vast_id  is required and must be a non-empty string or integer Ensures the field is present and contains usable data If  vast_id  is a string, it must not be blank or whitespace-only Prevents " " , "...

How to Generate and Use SSH Keys in OpenStack:

This guide walks you through generating SSH keys from scratch, configuring them in OpenStack, and using them for secure instance access. These steps will help you manage your OpenStack instances securely and efficiently using SSH key pairs.  Step-by-Step Guide: Generating and Using SSH Key Pairs in OpenStack:  Step 1: Generate SSH Key Pair Locally:  To begin, you need to generate an SSH key pair on your local machine. This pair consists of a public and a private key.  Generate a new SSH key pair on your local system (Linux/macOS). Run the following command in your terminal: # ssh-keygen -t rsa -b 2048 Enter the file name for the key: When prompted, provide the file name and path to save the key. By default, it will be saved in ~/.ssh/id_rsa . You can press Enter to accept the default location.  Set a passphrase (optional): You can choose to set a passphrase for additional security or leave it blank for easy access.  This will create two files: id_rsa:...

Install Apache Guacamole on Ubuntu 22.04

  Install Apache Guacamole on Ubuntu 22.04 Apache Guacamole Installation Guide Remote Desktop Gateway for Ubuntu 22.04 Ubuntu 22.04 Remote Desktop What is Apache Guacamole? Apache Guacamole is a clientless remote desktop gateway that supports standard protocols like VNC, RDP, and SSH. Thanks to HTML5, once Guacamole is installed on a server, all you need to access your desktops is a web browser. Clientless No plugins or client software needed Secure ...