Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-daemon
Commits
d423beee
Commit
d423beee
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#4116] Add initial VM deployment scripts and xml specification
parent
1dea4d6d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/vm/Ubuntu-10.04-i386-on-KVM.xml
+23
-0
23 additions, 0 deletions
tools/vm/Ubuntu-10.04-i386-on-KVM.xml
tools/vm/deploy_vm.sh
+82
-0
82 additions, 0 deletions
tools/vm/deploy_vm.sh
with
105 additions
and
0 deletions
tools/vm/Ubuntu-10.04-i386-on-KVM.xml
0 → 100644
+
23
−
0
View file @
d423beee
<domain
type=
'kvm'
>
<name>
Ubuntu-10.04-i386-on-KVM
</name>
<description>
Virtual machine to test SFLphone compilation
</description>
<memory>
524288
</memory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
</os>
<devices>
<emulator>
usr/bin/kvm
</emulator>
<disk
type=
'file'
device=
'disk'
>
<source
file=
'/home/msavard/Development/vm/firstvm/vm0-ubuntu-10.04.1-desktop-i386.qcow2'
/>
<target
dev=
'hda'
/>
</disk>
<interface
type=
'network'
>
<source
network=
'default'
/>
</interface>
<graphics
type=
'vnc'
port=
'-1'
/>
</devices>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
restart
</on_crash>
</domain>
This diff is collapsed.
Click to expand it.
tools/vm/deploy_vm.sh
0 → 100644
+
82
−
0
View file @
d423beee
#!/bin/bash
# Requirements:
# 1) apt-get install kvm virsh
# 2) Make sure kvm and kvm_intel are installed
# lsmod | grep kvm
# 3) Get a .iso file for the coresponding distro
# 4) Install a new VM on a disk image
# kvm-img create vm0-ubuntu-10.04.1-desktop-i386.qcow2 -f qcow2 6G
# kvm -k en-us -usbdevice tablet -hda vm0-ubuntu-10.04.1-desktop-i386.qcow2 -cdrom ubuntu-10.04.1-desktop-i386.iso -boot d -m 512
# kvm -k en-us -usbdevice tablet -hda vm0-ubuntu-10.04.1-desktop-i386.qcow2 -cdrom ubuntu-10.04.1-desktop-i386.iso -boot c -m 512
# 5) Create the VM
# virsh -c qemu:///system define Ubuntu-10.04-i386-on-KVM.xml
# 6) Copy Host's public ssh key in order to avoid password request
# ssh-copy-id sflphone@machine
# 7) Take a snapshot of this disk image
# kvm-img snapshot -c tag_name disk_image_filename
# 8) Add NOPASSWORD in sudoers
VM
=
Ubuntu-10.04-i386-on-KVM
VIRSH
=
"virsh -c qemu:///system"
# Get the full path to vm's
DISK_IMG
=
$(
$VIRSH
dumpxml
"
${
VM
}
"
|grep source.file|cut
-d
"'"
-f2
)
echo
"Disk Image:
$DISK_IMG
"
# Get MAC address for this vm
MAC_ADDR
=
$(
$VIRSH
dumpxml
"
${
VM
}
"
|grep mac.address|cut
-d
"'"
-f2
)
echo
"Mac Address:
$MAC_ADDR
"
# Reset disk to last snapshot
LAST_SNAPSHOT_ID
=
$(
kvm-img snapshot
-l
$DISK_IMG
|tail
-n
1|cut
-d
' '
-f1
)
kvm-img snapshot
-a
$LAST_SNAPSHOT_ID
$DISK_IMG
# Create VM
$VIRSH
start
$VM
# Get its IP address
echo
-n
"Waiting for IP address..."
LAST_STAMP
=
$(
grep
$MAC_ADDR
/var/lib/misc/dnsmasq.leases |
cut
-d
' '
-f1
)
while
[
1
]
do
NEXT_STAMP
=
$(
grep
$MAC_ADDR
/var/lib/misc/dnsmasq.leases |
cut
-d
' '
-f1
)
if
[
$LAST_STAMP
!=
$NEXT_STAMP
]
;
then
IPADDR
=
$(
grep
$MAC_ADDR
/var/lib/misc/dnsmasq.leases |
cut
-d
' '
-f3
)
break
fi
echo
-n
"."
sleep
0.5
done
echo
" got
$IPADDR
"
HOST
=
sflphone@
$IPADDR
# Connect ssh
echo
-n
"Waiting for ssh to start..."
while
[
1
]
;
do
ssh
$HOST
echo
Connected
&&
break
sleep
2
done
# create an archive of the repository
# git archive --format=tar -o sflphone.tar HEAD
# gzip sflphone.tar
# scp -C sflphone.tar.gz $HOST
# sudo add-apt-repository ppa:savoirfairelinux
# sudo apt-get build-dep sflphone-common
# sudo apt-get build-dep sflphone-client-gnome
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