Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor 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
mediaserver
envsetup
Commits
dae63cdf
Commit
dae63cdf
authored
8 years ago
by
Julien Allary
Browse files
Options
Downloads
Patches
Plain Diff
dirty vm export function
parent
0f3a1612
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
launcher.sh
+37
-2
37 additions, 2 deletions
launcher.sh
with
37 additions
and
2 deletions
launcher.sh
+
37
−
2
View file @
dae63cdf
...
@@ -128,6 +128,33 @@ exportvm() {
...
@@ -128,6 +128,33 @@ exportvm() {
echo
-e
"
${
CYAN
}
Files are available at
${
VM_STORE_LOCAL
}${
NC
}
"
echo
-e
"
${
CYAN
}
Files are available at
${
VM_STORE_LOCAL
}${
NC
}
"
}
}
exportvm_local
(){
VM_STORE
=
/home/jallary/ubicast/TMP/ENVOI
VM_STORE_LOCAL
=
/home/
# depuis poste local
VBoxManage
export
${
VM_NAME
}
-o
${
VM_STORE
}
/
${
VM_NAME
}
.ovf
--ovf10
# generating vmware conf file
cp
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
.ovf
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf
sed
-i
"s@<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>@<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType>@"
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf
sed
-i
"s@<rasd:Caption>sataController0</rasd:Caption>@<rasd:Caption>SCSIController</rasd:Caption>@"
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf
sed
-i
"s@<rasd:Description>SATA Controller</rasd:Description>@<rasd:Description>SCSIController</rasd:Description>@"
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf
sed
-i
"s@<rasd:ElementName>sataController0</rasd:ElementName>@<rasd:ElementName>SCSIController</rasd:ElementName>@"
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf
sed
-i
"s@<rasd:ResourceSubType>AHCI</rasd:ResourceSubType>@<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>@"
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf
sed
-i
"s@<rasd:ResourceType>20</rasd:ResourceType>@<rasd:ResourceType>6</rasd:ResourceType>@"
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf
# recherche n° ligne paragraphe à supp.
LIG
=
$(
grep
-n
'<rasd:AddressOnParent>3</rasd:AddressOnParent>'
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf |
awk
-F
":"
'{print$1}'
)
LIG0
=
$((
$LIG
-
1
))
LIG1
=
$((
$LIG0
+
9
))
sed
-i
"
${
LIG0
}
,
${
LIG1
}
d"
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
_vmware.ovf
# converting disk to qemu image
qemu-img convert
-c
-O
qcow2
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
-disk1
.vmdk
${
VM_STORE_LOCAL
}
/
${
VM_NAME
}
.qcow2
echo
-e
"
${
CYAN
}
Files are available at
${
VM_STORE_LOCAL
}${
NC
}
"
}
case
"
$1
"
in
case
"
$1
"
in
"ms"
)
"ms"
)
init
init
...
@@ -183,6 +210,12 @@ case "$1" in
...
@@ -183,6 +210,12 @@ case "$1" in
CONF
=
$(
echo
"
$2
"
)
CONF
=
$(
echo
"
$2
"
)
exportvm
exportvm
;;
;;
"exportvm_local"
)
VM_NAME
=
$(
echo
"
$2
"
)
exportvm_local
;;
*
)
*
)
echo
"
echo
"
...
@@ -204,7 +237,9 @@ wrecette deploy wowza license key and run tests
...
@@ -204,7 +237,9 @@ wrecette deploy wowza license key and run tests
After usage a log file will be generated under /root/
$(
date
+%F
)
_envsetup.log
After usage a log file will be generated under /root/
$(
date
+%F
)
_envsetup.log
From admin machine :
From admin machine :
Usage:
$0
exportvm [conf_file]
Usage:
$0
exportvm
exportvm export VM"
exportvm [conf_file] export VM from an hypervisor
exportvm_local [vm name] export VM from local vbox
"
;;
;;
esac
esac
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