Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simple-vm-manager
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
simple-vm-manager
Commits
a9c10815
There was an error fetching the commit references. Please try again later.
Commit
a9c10815
authored
11 months ago
by
Recolic
Browse files
Options
Downloads
Patches
Plain Diff
.use name instead of uuid
parent
222b3bb7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cron-callback.sh
+3
-2
3 additions, 2 deletions
cron-callback.sh
with
3 additions
and
2 deletions
cron-callback.sh
+
3
−
2
View file @
a9c10815
...
...
@@ -2,6 +2,7 @@
# You may change this directory
workdir
=
./data
ver
=
1.0.62
_self_bin_name
=
"
$0
"
function
where_is_him
()
{
...
...
@@ -106,13 +107,13 @@ function start_vm_if_not_running () {
local
uuid
=
`
uuidgen
--namespace
@oid
--name
"qemu.
$name
"
--sha1
`
# Check if qemu already running for this instance.
ps aux |
grep
-F
"
uuid
$uuid
"
|
grep
qemu
>
/dev/null 2>&1
&&
return
0
ps aux |
grep
-F
"
name
$uuid
"
|
grep
qemu
>
/dev/null 2>&1
&&
return
0
# start it
[[
!
-f
"vm/
$name
/disk.img"
]]
&&
echo2
"In start_vm, disk image vm/
$name
/disk.img doesn't exist. Did init_vm fail?"
&&
return
1
echo2
"+ Starting VM
$name
with options_txt '
$options_txt
' and uuid
$uuid
..."
[[
-f
"vm/
$name
/initimg.iso"
]]
&&
options+
=(
-cdrom
"vm/
$name
/initimg.iso"
)
nohup
qemu-system-x86_64
--
uuid
"
$uuid
"
-drive
file
=
"vm/
$name
/disk.img"
,if
=
virtio
-cpu
host
--enable-kvm
-net
nic,model
=
virtio-net-pci
"
${
options
[@]
}
"
>>
tmp/qemu.log 2>&1 &
disown
nohup
qemu-system-x86_64
--
name
"
$uuid
"
-drive
file
=
"vm/
$name
/disk.img"
,if
=
virtio
-cpu
host
--enable-kvm
-net
nic,model
=
virtio-net-pci
"
${
options
[@]
}
"
>>
tmp/qemu.log 2>&1 &
disown
}
function
do_init
()
{
...
...
This diff is collapsed.
Click to expand it.
Recolic
@root
mentioned in commit
26ea4928
·
11 months ago
mentioned in commit
26ea4928
mentioned in commit 26ea4928c7d5f76956621d71c31979be639eda46
Toggle commit list
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