-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsavi-create-vm2
executable file
·23 lines (20 loc) · 1.18 KB
/
savi-create-vm2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash -f
source /home/savitb/bin/functions
USER=$(whoami)
KEY_NAME="$USER"key
SECGROUP_NAME=$USER
VM="$USER"-vm2
PROJECT_NAME=$OS_TENANT_NAME
MAIN_NETWORK="$PROJECT_NAME"-net
PRIVATE_NETWORK="$USER"-net
blue_desc_title " Creating a $VM for ($USER)"
green_desc_title "Creating a $VM in $MAIN_NETWORK and $PRIVATE_NETWORK"
command_desc "quantum net-list"
NET_ID_MAIN=`quantum net-list -c id -c name | grep $MAIN_NETWORK | awk '{print $2}'`
NET_ID_PRIVATE=`quantum net-list -c id -c name | grep $PRIVATE_NETWORK | awk '{print $2}'`
echo "NET_ID_MAIN=$NET_ID_MAIN"
echo "NET_ID_PRIVATE=$NET_ID_PRIVATE"
command_desc "nova boot --file /home/ubuntu/id_rsa=$HOME/.ssh/id_rsa --file /etc/network/interfaces=$HOME/interfaces --file /etc/rc.local=$HOME/rc.local.vm2 --flavor m1.small --image Ubuntu64.2.1 --security_groups $SECGROUP_NAME --nic net-id=$NET_ID_MAIN --nic net-id=$NET_ID_PRIVATE $VM"
nova boot --file /home/ubuntu/id_rsa=$HOME/.ssh/id_rsa --file /etc/network/interfaces=$HOME/interfaces --file /etc/rc.local=$HOME/rc.local.vm2 --flavor m1.small --image Ubuntu64.2.1 --security_groups $SECGROUP_NAME --nic net-id=$NET_ID_MAIN --nic net-id=$NET_ID_PRIVATE $VM
yellow_desc "nova list"
nova list