Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
virl-utils-hs-fulda
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Rieger
virl-utils-hs-fulda
Commits
419b4cb7
Commit
419b4cb7
authored
9 years ago
by
Sebastian Rieger
Browse files
Options
Downloads
Patches
Plain Diff
added handling of existing image and creation of default flavor
parent
ca958307
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
create-cumulusvx-image/create-cumulus-vx-image.sh
+26
-2
26 additions, 2 deletions
create-cumulusvx-image/create-cumulus-vx-image.sh
with
26 additions
and
2 deletions
create-cumulusvx-image/create-cumulus-vx-image.sh
+
26
−
2
View file @
419b4cb7
#!/bin/bash
# create-cumulus-vx-image.sh V0.
1
# create-cumulus-vx-image.sh V0.
2
# HS-Fulda - sebastian.rieger@informatik.hs-fulda.de
#
# changelog:
#
# V0.2 - added support to delete existing image with the same name and generating the default nova flavor
# usage
if
[
!
$#
-eq
2
]
;
then
...
...
@@ -23,6 +27,14 @@ GLANCE_IMAGE_RELEASE=$CUMULUS_QCOW2_BASENAME
TMP_NAME
=
"CumulusVX-
$GLANCE_IMAGE_RELEASE
"
TIMESTAMP
=
$(
date
+%Y%m%d%H%M%S
)
CHECK_FOR_EXISTING_IMAGE
=
$(
glance image-show CumulusVX |
grep
name |
grep
CumulusVX
)
if
[
$?
==
0
]
;
then
echo
"Deleting existing image
$2
..."
echo
"==========================================================="
glance image-delete
$2
fi
echo
echo
"Creating CumulusVX image..."
echo
"==========================================================="
...
...
@@ -53,7 +65,10 @@ chmod +x /virl-config/cumulusvx.sh
/virl-config/cumulusvx.sh >/var/log/virl-startup.log
EOF
bash
#DEBUG:
# run bash to allow manual changes to the image before packing
#
#bash
# inject script to handle dhcp for eth0 and import of config defined in VM Maestro (config-drive)
...
...
@@ -74,6 +89,15 @@ glance image-create --container-format bare --disk-format qcow2 --is-public true
--file
$CUMULUS_PATCHED_QCOW2
--property
hw_disk_bus
=
ide
--property
serial
=
1
\
--property
hw_vif_model
=
e1000
--property
hw_cdrom_type
=
ide
--property
release
=
"
$GLANCE_IMAGE_RELEASE
"
--property
subtype
=
CumulusVX
--property
config_disk_type
=
disk
# create flavor
CHECKING_FOR_EXISTING_FLAVOR
=
$(
nova flavor-show CumulusVX.small |
grep
name |
grep
CumulusVX.small
)
if
[
$?
==
1
]
;
then
echo
"Creating default flavor CumulusVX.small..."
echo
"==========================================================="
nova flavor-create
--is-public
true
CumulusVX.small auto 256 0 1
fi
echo
echo
"Cleaning up..."
echo
"==========================================================="
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment