mirror of https://github.com/apache/cloudstack.git
changes for the new debian-based systemvm
This commit is contained in:
parent
1ddc229e6b
commit
f94299fe0c
|
|
@ -2,7 +2,12 @@
|
|||
|
||||
BASE_DIR="/var/www/html/copy/template/"
|
||||
HTACCESS="$BASE_DIR/.htaccess"
|
||||
|
||||
PASSWDFILE="/etc/httpd/.htpasswd"
|
||||
if [ -d /etc/apache2 ]
|
||||
then
|
||||
PASSWDFILE="/etc/apache2/.htpasswd"
|
||||
fi
|
||||
|
||||
config_htaccess() {
|
||||
mkdir -p $BASE_DIR
|
||||
|
|
|
|||
|
|
@ -15,6 +15,17 @@ config_httpd_conf() {
|
|||
echo "</VirtualHost>" >> /etc/httpd/conf/httpd.conf
|
||||
}
|
||||
|
||||
config_apache2_conf() {
|
||||
local ip=$1
|
||||
local srvr=$2
|
||||
cp -f /etc/apache2/sites-available/default.orig /etc/apache2/sites-available/default
|
||||
cp -f /etc/apache2/sites-available/default-ssl.orig /etc/apache2/sites-available/default-ssl
|
||||
sed -i -e "s/VirtualHost.*:80$/VirtualHost $ip:80/" /etc/httpd/conf/httpd.conf
|
||||
sed -i 's/_default_/$ip/' /etc/apache2/sites-available/default-ssl
|
||||
sed -i 's/ssl-cert-snakeoil.key/realhostip.key/' /etc/apache2/sites-available/default-ssl
|
||||
sed -i 's/ssl-cert-snakeoil.pem/realhostip.crt/' /etc/apache2/sites-available/default-ssl
|
||||
}
|
||||
|
||||
copy_certs() {
|
||||
local certdir=$(dirname $0)/certs
|
||||
local mydir=$(dirname $0)
|
||||
|
|
@ -25,16 +36,37 @@ copy_certs() {
|
|||
return 1
|
||||
}
|
||||
|
||||
copy_certs_apache2() {
|
||||
local certdir=$(dirname $0)/certs
|
||||
local mydir=$(dirname $0)
|
||||
if [ -d $certdir ] && [ -f $certdir/realhostip.key ] && [ -f $certdir/realhostip.crt ] ; then
|
||||
cp $certdir/realhostip.key /etc/ssl/private/ && cp $certdir/realhostip.crt /etc/ssl/certs/
|
||||
return $?
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
if [ $# -ne 2 ] ; then
|
||||
echo $"Usage: `basename $0` ipaddr servername "
|
||||
exit 0
|
||||
fi
|
||||
|
||||
copy_certs
|
||||
if [ -d /etc/apache2 ]
|
||||
then
|
||||
copy_certs_apache2
|
||||
else
|
||||
copy_certs
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Failed to copy certificates"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
config_httpd_conf $1 $2
|
||||
if [ -d /etc/apache2 ]
|
||||
then
|
||||
config_apache2_conf $1 $2
|
||||
else
|
||||
config_httpd_conf $1 $2
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -3175,11 +3175,11 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR
|
|||
|
||||
Ternary<SR, VDI, VolumeVO> mount = mounts.get(0);
|
||||
|
||||
Set<VM> templates = VM.getByNameLabel(conn, "CentOS 5.3");
|
||||
Set<VM> templates = VM.getByNameLabel(conn, "Debian Lenny 5.0 (32-bit)");
|
||||
if (templates.size() == 0) {
|
||||
templates = VM.getByNameLabel(conn, "CentOS 5.3 (64-bit)");
|
||||
templates = VM.getByNameLabel(conn, "Debian Lenny 5.0 (32-bit)");
|
||||
if (templates.size() == 0) {
|
||||
String msg = " can not find template CentOS 5.3 ";
|
||||
String msg = " can not find template Debian Lenny 5.0 (32-bit) ";
|
||||
s_logger.warn(msg);
|
||||
return msg;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
<domain type='kvm' id='4'>
|
||||
<name>systemvm2</name>
|
||||
<memory>1572864</memory>
|
||||
<currentMemory>1572864</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686' >hvm</type>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<devices>
|
||||
<!--<emulator>/usr/bin/qemu-system-x86_64</emulator>-->
|
||||
<emulator>/usr/bin/qemu-kvm</emulator>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='qemu' type='raw' cache='writeback'/>
|
||||
<source file='/var/lib/images/systemvm2/systemvm.img'/>
|
||||
<!-- <target dev='hda' bus='ide'/> -->
|
||||
<target dev='vda' bus='virtio'/>
|
||||
</disk>
|
||||
<interface type='network'>
|
||||
<mac address='52:54:00:65:a8:eb'/>
|
||||
<source network='default'/>
|
||||
<target dev='vnet0'/>
|
||||
<model type='virtio' />
|
||||
</interface>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<graphics type='vnc' port='5900' autoport='yes'/>
|
||||
</devices>
|
||||
</domain>
|
||||
|
||||
Loading…
Reference in New Issue