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 " " , "...

testing

09052025 T-1 { "volume_groups" : { "vgroot" : { "vgsize" : "304G" , "fs_type" : "xfs" } } , "logical_volumes" : { "root" : { "lvroot" : { "vgname" : "vgroot" , "lvname" : "lvroot" , "lvsize" : "12G" , "mountpoint" : "/" , "purpose" : "root filesystem" , "disk" : 1 , "partition" : 2 } } , "swap" : { "lvswap" : { "vgname" : "vgroot" , "lvname" : "lvswap" , "lvsize" : "4G" , "mountpoint" : "NA" , "purpose" : "swap" , "disk" : 1 , "partit...

temp

 {   "_id": {     "$oid": "6841e4b0fd270b2ab92d7eaa"   },   // 📌 [Auto-generated]   // Description: Unique system identifier for internal use (MongoDB ObjectId).   // Type: ObjectId (string)   // Required: No (automatically handled)   "vast_id": "21452",   // 📌 [Required]   // Description: Your unique request ID or reference number.   // Type: string   // Format: Numeric string (e.g., "21452")   // Example: "21452"   "env": "dev",   // 📌 [Required]   // Description: The environment where the VM will be deployed.   // Type: string   // Allowed values: "dev", "qa", "uat", "prod"   // Example: "dev" for development, "prod" for production   "ver": "0.2",   // 📌 [Do Not Modify]   // Description: Template version. Used by automation to ensure compatibility.   // Type: string   // Format: Semantic versioning (e.g., "...