Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nexus
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flg_projects
nexus_vdi
nexus
Commits
85551c88
Commit
85551c88
authored
2 years ago
by
Florent Gluck
Browse files
Options
Downloads
Patches
Plain Diff
updated vm_run script to specifiy qcow or iso images and to boot first to cdrom if present
parent
91e1d945
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/template_creator/vm_run
+42
-6
42 additions, 6 deletions
tools/template_creator/vm_run
with
42 additions
and
6 deletions
tools/template_creator/vm_run
+
42
−
6
View file @
85551c88
...
...
@@ -3,18 +3,54 @@
CPUS
=
4
RAM
=
4G
APP
=
`
basename
$0
`
function
echoerr
{
echo
"
$@
"
>
&2
}
if
[
$#
-ne
1
]
;
then
appname
=
`
basename
$0
`
echoerr
"
$appname
- launch a QEMU VM on the specified disk image."
echoerr
"The VM uses
$CPUS
CPUs and
$RAM
of RAM."
function
usage
{
echoerr
"
$APP
- launch a VM on the specified disk image(s)."
echoerr
"The VM is configured with
$CPUS
CPUs and
$RAM
of RAM."
echoerr
""
echoerr
"Usage:
$
appname
disk
"
echoerr
"Usage:
$
APP
-d disk -c iso
"
echoerr
"disk the disk image to use (typically a .qcow file)"
echoerr
"iso the CD/DVD-ROM image to use (typically an .iso file)"
echoerr
""
echoerr
"At least one image must be specified."
exit
1
}
if
[
$#
-lt
1
]
;
then
usage
fi
while
[[
$#
-gt
0
]]
;
do
case
$1
in
-d
)
disk
=
"
$2
"
shift
# past argument
shift
# past value
;;
-c
)
iso
=
"
$2
"
shift
# past argument
shift
# past value
;;
*
)
echo
"Unknown argument
$1
"
exit
1
;;
esac
done
if
[
!
-z
$disk
]
;
then
disk_drive
=
"-drive file=
$disk
,index=0,media=disk,format=qcow2,if=virtio"
fi
if
[
!
-z
$iso
]
;
then
cdrom_drive
=
"-drive file=
$iso
,index=1,media=cdrom,format=raw,read-only=on"
fi
qemu-system-x86_64
-enable-kvm
-cpu
host
-smp
cpus
=
$CPUS
-m
$RAM
-drive
file
=
$1
,index
=
0,media
=
disk,format
=
qcow2,if
=
virtio
-vga
virtio
-device
virtio-serial-pci
-nic
user,model
=
virtio-net-pci
# -boot order=d tells QEMU to boot to CDROM first
qemu-system-x86_64
-enable-kvm
-cpu
host
-smp
cpus
=
$CPUS
-m
$RAM
-boot
order
=
d
$disk_drive
$cdrom_drive
-vga
virtio
-device
virtio-serial-pci
-nic
user,model
=
virtio-net-pci
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