How to Create VM Instances | Step-by-Step Cloud VM Provisioning Guide
This guide walks you through the process of creating a new virtual machine instance on your preferred cloud provider using Nife.
Prerequisites
Before creating a VM instance, ensure you have:
- Active Organization: An organization created in your Nife account
- Cloud Provider Account: An active account with AWS, GCP, or Azure
- Proper Credentials: The necessary API keys, service accounts, or credentials for your cloud provider
- Required Permissions: Appropriate IAM permissions to create and manage VM instances
Creating a New VM Instance
Step 1: Access VM Creation
- Navigate to VM Management section in your Nife dashboard
- Click the Create VM button in the top-right corner
- The Create VM Instance dialog will open
Step 2: Basic Configuration
In the Basic Configuration section:
Cloud Provider Selection
Choose your cloud provider from the dropdown:
- Google Cloud Platform (GCP): For Google Compute Engine instances
- Amazon Web Services (AWS): For EC2 instances
- Microsoft Azure: For Azure Virtual Machines
Organization Selection
Select the organization that will own this VM instance. The instance will be associated with this organization for billing and access control purposes.
Instance Name
Enter a unique name for your VM instance. The name should be:
- Lowercase letters, numbers, and hyphens only
- Descriptive and easy to identify
- Example:
web-server-prod-01,api-backend-staging
The instance name must be provided before uploading service account files for GCP.
Step 3: Provider-Specific Configuration
The configuration fields change based on your selected cloud provider.
AWS Configuration
Required Fields
Region
- The AWS region where your instance is located
- Examples:
us-east-1,us-west-2,eu-west-1 - Must match the region of your EC2 instance
Instance ID
- Your EC2 instance ID
- Format: Starts with
i-followed by alphanumeric characters - Example:
i-1234567890abcdef0 - Find this in your AWS EC2 Dashboard under "Instances"
Access Key ID
- Your AWS IAM access key ID
- Format: Starts with
AKIAfollowed by characters - ⚠️ Keep this secure: Never share or expose this key
- Create new keys in AWS IAM Console if needed
Secret Access Key
- Your AWS IAM secret access key
- Only visible once when created in AWS IAM Console
- ⚠️ Keep this secure: Store it in a secure location
- This field is hidden after input for security
Getting AWS Credentials
- Log in to your AWS Management Console
- Navigate to IAM (Identity and Access Management)
- Go to Users and select your user
- Click Create access key under "Access Keys"
- Copy your Access Key ID and Secret Access Key
- Store the secret key securely (it won't be visible again)
GCP Configuration
Required Fields
Zone
- The Google Cloud zone where your instance will be created
- Examples:
us-central1-a,europe-west1-b,asia-southeast1-c - Must match your GCP Compute Engine zone
- Check available zones in GCP Console
Service Account Key File
- Upload your GCP service account JSON key file
- Click the file input and select your downloaded JSON key file
- The file will be uploaded and validated
Uploading Service Account File
- First, enter an Instance Name (required before file upload)
- Click the File Input field or drag and drop your JSON file
- Select the service account JSON file from your computer
- Click the Upload button
- Wait for upload confirmation (green success message)
Getting GCP Service Account Key
- Go to Google Cloud Console
- Navigate to Service Accounts
- Select or create a service account
- Click Keys tab
- Click Add Key → Create new key
- Choose JSON format
- The key will be automatically downloaded to your computer
- Store it securely
Keep your service account key file secure. Anyone with this file can access your GCP resources.
Azure Configuration
Required Fields
Subscription ID
- Your Azure subscription ID
- Format: GUID (example:
12345678-1234-1234-1234-123456789012) - Find this in Azure Portal under Subscriptions
Resource Group Name
- The name of the resource group containing your VM
- Example:
production-resources,dev-rg - Must exist in your Azure subscription
Tenant ID
- Your Azure Active Directory (Azure AD) tenant ID
- Format: GUID (example:
12345678-1234-1234-1234-123456789012) - Also called Directory ID
- Find this in Azure Portal under Azure AD
Client ID
- Your Azure service principal client ID
- Format: GUID (example:
12345678-1234-1234-1234-123456789012) - Also called Application ID
- Find this in Azure AD under App registrations
Client Secret
- Your Azure service principal client secret
- ⚠️ Keep this secure: Never share or expose this secret
- This field is hidden after input for security
- Create new secrets in App registration if needed
Getting Azure Credentials
- Log in to Azure Portal
- Navigate to Azure Active Directory → App registrations
- Create a new app registration or select an existing one
- Copy the Application (client) ID and Directory (tenant) ID
- Go to Certificates & secrets
- Click New client secret
- Copy the secret value (visible only once)
- Store all secrets securely
Submitting the Form
Validation
Before submitting, ensure all required fields are completed:
- Cloud provider is selected
- Organization is selected
- Instance name is provided
- All provider-specific required fields are filled
The Add Instance button will be disabled until all required fields are valid.
Creating the Instance
- Review all entered information
- Click the Add Instance button
- Wait for the instance to be created and validated
- A success message will appear once the instance is registered
- The instance will now appear in your VM instances list
Troubleshooting
File Upload Issues (GCP)
"Please enter an instance name before uploading the file"
- Enter the instance name in the Basic Configuration section first
"Please select a valid JSON file"
- Ensure you're uploading a
.jsonfile - The file should be the GCP service account key file
"Failed to upload file"
- Check your internet connection
- Verify the file is valid JSON
- Try again with a different file
Credential Validation Issues
"AWS credentials are invalid"
- Verify the Access Key ID and Secret Key are correct
- Ensure the key has EC2 permissions
- Check that the instance exists in the specified region
"GCP service account is invalid"
- Verify the service account key file is correct
- Ensure the service account has Compute Engine permissions
- Check the zone is available in your GCP project
"Azure credentials are invalid"
- Verify all IDs match your Azure account
- Ensure the service principal has necessary permissions
- Check that the subscription and resource group exist
Next Steps
After creating VM instances:
- Managing VM Instances - Learn how to manage your instances
- Monitoring VM Performance - Monitor your instance metrics
- Cloud Provider Setup - Detailed provider configuration