From c152d1c33f69c45fb727ad8545479547aec9d829 Mon Sep 17 00:00:00 2001 From: anthony Date: Wed, 20 Jul 2011 16:47:27 -0700 Subject: [PATCH] support XenServer 6.0 beta --- .../xen/resource/XenServer60Resource.java | 58 +++++++++++++++++++ .../vm/hypervisor/xenserver/xenserver60/patch | 45 ++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 core/src/com/cloud/hypervisor/xen/resource/XenServer60Resource.java create mode 100644 scripts/vm/hypervisor/xenserver/xenserver60/patch diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer60Resource.java b/core/src/com/cloud/hypervisor/xen/resource/XenServer60Resource.java new file mode 100644 index 00000000000..4850719335f --- /dev/null +++ b/core/src/com/cloud/hypervisor/xen/resource/XenServer60Resource.java @@ -0,0 +1,58 @@ +/** + * + * This software is licensed under the GNU General Public License v3 or later. + * + * It is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +package com.cloud.hypervisor.xen.resource; + + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import javax.ejb.Local; +import org.apache.log4j.Logger; + +import com.cloud.resource.ServerResource; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.script.Script; + + +@Local(value=ServerResource.class) +public class XenServer60Resource extends XenServer56Resource { + private static final Logger s_logger = Logger.getLogger(XenServer60Resource.class); + + public XenServer60Resource() { + super(); + } + + @Override + protected String getGuestOsType(String stdType, boolean bootFromCD) { + return CitrixHelper.getXenServer60GuestOsType(stdType); + } + + @Override + protected List getPatchFiles() { + List files = new ArrayList(); + String patch = "scripts/vm/hypervisor/xenserver/xenserver60/patch"; + String patchfilePath = Script.findScript("" , patch); + if ( patchfilePath == null ) { + throw new CloudRuntimeException("Unable to find patch file " + patch); + } + File file = new File(patchfilePath); + files.add(file); + return files; + } + +} diff --git a/scripts/vm/hypervisor/xenserver/xenserver60/patch b/scripts/vm/hypervisor/xenserver/xenserver60/patch new file mode 100644 index 00000000000..76d28151476 --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xenserver60/patch @@ -0,0 +1,45 @@ +# This file specifies the files that need +# to be transferred over to the XenServer. +# The format of this file is as follows: +# [Name of file]=[source path],[file permission],[destination path] +# [destination path] is required. +# If [file permission] is missing, 755 is assumed. +# If [source path] is missing, it looks in the same +# directory as the patch file. +# If [source path] starts with '/', then it is absolute path. +# If [source path] starts with '~', then it is path relative to management server home directory. +# If [source path] does not start with '/' or '~', then it is relative path to the location of the patch file. +NFSSR.py=/opt/xensource/sm +nfs.py=/opt/xensource/sm +vmops=..,0755,/etc/xapi.d/plugins +ovsgre=..,0755,/etc/xapi.d/plugins +ovstunnel=..,0755,/etc/xapi.d/plugins +vmopsSnapshot=..,0755,/etc/xapi.d/plugins +hostvmstats.py=..,0755,/opt/xensource/sm +systemvm.iso=../../../../../vms,0644,/opt/xensource/packages/iso +id_rsa.cloud=../../../systemvm,0600,/root/.ssh +network_info.sh=..,0755,/opt/xensource/bin +setupxenserver.sh=..,0755,/opt/xensource/bin +make_migratable.sh=..,0755,/opt/xensource/bin +setup_iscsi.sh=..,0755,/opt/xensource/bin +pingtest.sh=../../..,0755,/opt/xensource/bin +dhcp_entry.sh=../../../../network/domr/,0755,/opt/xensource/bin +ipassoc.sh=../../../../network/domr/,0755,/opt/xensource/bin +vm_data.sh=../../../../network/domr/,0755,/opt/xensource/bin +save_password_to_domr.sh=../../../../network/domr/,0755,/opt/xensource/bin +networkUsage.sh=../../../../network/domr/,0755,/opt/xensource/bin +call_firewall.sh=../../../../network/domr/,0755,/opt/xensource/bin +call_loadbalancer.sh=../../../../network/domr/,0755,/opt/xensource/bin +l2tp_vpn.sh=../../../../network/domr/,0755,/opt/xensource/bin +cloud-setup-bonding.sh=..,0755,/opt/xensource/bin +copy_vhd_to_secondarystorage.sh=..,0755,/opt/xensource/bin +copy_vhd_from_secondarystorage.sh=..,0755,/opt/xensource/bin +setup_heartbeat_sr.sh=..,0755,/opt/xensource/bin +setup_heartbeat_file.sh=..,0755,/opt/xensource/bin +check_heartbeat.sh=..,0755,/opt/xensource/bin +xenheartbeat.sh=..,0755,/opt/xensource/bin +launch_hb.sh=..,0755,/opt/xensource/bin +vhd-util=..,0755,/opt/xensource/bin +vmopspremium=..,0755,/etc/xapi.d/plugins +create_privatetemplate_from_snapshot.sh=..,0755,/opt/xensource/bin +upgrade_snapshot.sh=..,0755,/opt/xensource/bin