Skip to content

Commit

Permalink
make the openstack vm image based and have a volume attached
Browse files Browse the repository at this point in the history
Signed-off-by: Benny Zlotnik <[email protected]>
  • Loading branch information
bennyz authored and ahadas committed Mar 20, 2024
1 parent fa4ba63 commit e14d62b
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions cluster/providers/openstack/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,25 @@ function packstack_create_cirros_volume {
openstack volume create --image cirros --size 1 cirros-volume

# wait for the volume to be created
sleep 10
while [ "$(openstack volume show -f value -c status cirros-volume)" != "available" ]; do
echo "waiting for volume to be created"
sleep 3
done

# boot VM instance from image
openstack server create --image cirros --flavor m1.tiny --wait cirros-server

# wait for the server to be created
while [ "$(openstack server show -f value -c status cirros-server)" != "ACTIVE" ]; do
echo "waiting for server to be created"
sleep 3
done

# attach the cirros-volume to the server
echo "attaching volume to server"
openstack server add volume cirros-server cirros-volume

# boot VM instance from volume
openstack server create --flavor m1.tiny --volume cirros-volume cirros-volume
sleep 15
openstack volume list
openstack volume list
openstack server list
}

Expand Down

0 comments on commit e14d62b

Please sign in to comment.