티스토리 뷰
Predefined
Should have packages
- jq (https://stedolan.github.io/jq/download/)
- openstacksdk (https://docs.openstack.org/openstacksdk/latest/user/)
Defined variables for using script.
ImageName="centos7"
VmName="TestVM"
Flavor="m1.large"
Keypair="testvm-key"
gathering UUID and names
flavorUuid=`openstack flavor list -f value | grep $Flavor | awk '{print $1}'`
echo "flavor uuid : "$flavorUuid
imageUuid=`openstack image list -f json | jq -r ".[] | select(.Name|test(\"$ImageName\")) | .ID"`
echo "image uuid : "$imageUuid
netUuids=`openstack network list -f json`
firstNetUuid=`echo $netUuids | jq -r ".[] | select(.Name|test(\"net0\")) | .ID"`
echo "first net uuid : "$firstNetUuid
secondNetUuid=`echo $netUuids | jq -r ".[] | select(.Name|test(\"net1\")) | .ID"`
echo "second net uuid : "$secondNetUuid
thirdNetUuid=`echo $netUuids | jq -r ".[] | select(.Name|test(\"net2\")) | .ID"`
echo "third net uuid : "$thirdNetUuid
sgId=`openstack security group list --project admin -f value | grep default | awk '{print $1}'`
echo "security group uuid : "$sgId
OpenStack VM creation
openstack server create --flavor m1.large \
--image $imageUuid \
--key-name $Keypair \
--network $firstNetUuid \
--network $secondNetUuid \
--network $thirdNetUuid \
--security-group $sgId \
$VmName
Floating IP
serverUuid=`openstack server list -f value | grep $VmName | awk '{print $1}'`
echo "created "$serverUuid" VM"
fipIp=`openstack floating ip create provider -f json | jq -r '.name'`
echo "created floating IP "$fipIp
openstack server add floating ip $serverUuid $fipIp
echo "associate floating ip into "$serverUuid" "$VmName
All of command lines are on following page.
References
'Cloud > Private Cloud' 카테고리의 다른 글
Terraform OpenStack Provider (0) | 2020.11.04 |
---|---|
access another Openstack VM using cirros image (0) | 2020.09.23 |
How to use clouds.yaml at OpenStack (0) | 2020.09.10 |
Make a free certification using certbot on kubernetes (0) | 2020.08.12 |
ElasticSearch, Fluentd, Grafana and Prometheus (3) | 2020.08.06 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- metallb
- ceph
- Terraform
- DevSecOps
- vmware openstack
- ansible
- OpenStack
- macvlan
- nginx-ingress
- Helm Chart
- boundary ssh
- crashloopbackoff
- GateKeeper
- kubernetes
- open policy agent
- Jenkinsfile
- kata container
- openstacksdk
- jenkins
- hashicorp boundary
- aquasecurity
- K3S
- kubernetes install
- openstack backup
- minikube
- socket
- mattermost
- wsl2
- azure policy
- minio
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함