You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pa...@apache.org on 2019/01/09 15:34:40 UTC

[cloudstack] 03/09: PARITAL WORK _ DO NO BUILD FROM THIS

This is an automated email from the ASF dual-hosted git repository.

paul_a pushed a commit to branch remove_dump_snapshot
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 461a3eb87dffaf1beec270934c9ee9feaf5e4532
Author: Paul Angus <pa...@shapeblue.com>
AuthorDate: Sat Dec 22 15:40:41 2018 +0000

    PARITAL WORK _ DO NO BUILD FROM THIS
---
 .../debian/etc/systemd/system/baremetal-vr.service | 12 -------
 systemvm/debian/etc/systemd/system/cloud.service   | 12 -------
 .../debian/opt/cloud/bin/setup/cloud-early-config  | 39 ++++++++++++++++++++++
 systemvm/debian/opt/cloud/bin/setup/common.sh      |  2 +-
 .../debian/opt/cloud/bin/setup/consoleproxy.sh     |  3 +-
 systemvm/debian/opt/cloud/bin/setup/postinit.sh    | 33 ++----------------
 systemvm/debian/opt/cloud/bin/setup/secstorage.sh  |  2 +-
 7 files changed, 44 insertions(+), 59 deletions(-)

diff --git a/systemvm/debian/etc/systemd/system/baremetal-vr.service b/systemvm/debian/etc/systemd/system/baremetal-vr.service
deleted file mode 100644
index f880f0c..0000000
--- a/systemvm/debian/etc/systemd/system/baremetal-vr.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=CloudStack Baremetal VR service
-After=network.target local-fs.target
-
-[Install]
-WantedBy=multi-user.target
-
-[Service]
-Type=simple
-WorkingDirectory=/opt/cloud/bin
-ExecStart=/usr/bin/python /opt/cloud/bin/baremetal-vr.py
-Restart=on-failure
diff --git a/systemvm/debian/etc/systemd/system/cloud.service b/systemvm/debian/etc/systemd/system/cloud.service
deleted file mode 100644
index e3824bf..0000000
--- a/systemvm/debian/etc/systemd/system/cloud.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=CloudStack Agent service
-After=cloud-early-config.service network.target cloud-postinit.service local-fs.target
-
-[Install]
-WantedBy=multi-user.target
-
-[Service]
-Type=simple
-WorkingDirectory=/usr/local/cloud/systemvm
-ExecStart=/usr/local/cloud/systemvm/_run.sh
-Restart=on-failure
diff --git a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
index 976b2ca..f1162b5 100755
--- a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
+++ b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
@@ -205,6 +205,41 @@ patch() {
   return 0
 }
 
+
+enable_guest_services() {
+
+HYPERVISOR=$(</etc/cloudstack-agent_detected_hypervisor)
+  case $HYPERVISOR in
+     xen-pv|xen-domU)
+        systemctl stop ntpd
+	systemctl disable ntpd
+        systemctl start xe-daemon
+        ;;
+     xen-hvm)
+        systemctl stop ntpd
+	systemctl disable ntpd
+        systemctl start xe-daemon
+        ;;
+     kvm)
+        systemctl start qemu-guest-agent
+        VPORT=$(find /dev/virtio-ports -type l -name '*.vport' 2>/dev/null|head -1)
+        ;;
+     vmware)
+        # system time sync'd with host via vmware tools
+        systemctl stop ntpd
+	systemctl disable ntpd
+        systemctl start open-vm-tools
+        ;;
+     virtualpc|hyperv)
+        # Hyper-V is recognized as virtualpc hypervisor type. Boot args are passed using KVP Daemon
+        systemctl start hyperv-daemons.hv-fcopy-daemon.service hyperv-daemons.hv-kvp-daemon.service hyperv-daemons.hv-vss-daemon.service
+        ;;
+     virtualbox)
+        # Virtualbox is used to test the virtual router
+        ;;
+   esac
+}
+
 start() {
   log_it "Executing cloud-early-config"
 
@@ -225,6 +260,10 @@ start() {
   patch
   sync
   sysctl -p
+  
+  log_it "Starting Virtual Guest Services for $HYPERVISOR"
+
+  enable_guest_services
 
   log_it "Configuring systemvm type=$TYPE"
 
diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh
index e24642f..110800a 100755
--- a/systemvm/debian/opt/cloud/bin/setup/common.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/common.sh
@@ -584,7 +584,7 @@ setup_ntp() {
 
 routing_svcs() {
    echo "haproxy apache2" > /var/cache/cloud/enabled_svcs
-   echo "cloud nfs-common portmap" > /var/cache/cloud/disabled_svcs
+   echo "nfs-common portmap" > /var/cache/cloud/disabled_svcs
    if [ "$RROUTER" -eq "1" ]
    then
        echo "keepalived conntrackd" >> /var/cache/cloud/enabled_svcs
diff --git a/systemvm/debian/opt/cloud/bin/setup/consoleproxy.sh b/systemvm/debian/opt/cloud/bin/setup/consoleproxy.sh
index 225dc6f..c20fed2 100755
--- a/systemvm/debian/opt/cloud/bin/setup/consoleproxy.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/consoleproxy.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+\#!/bin/bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -19,7 +19,6 @@
 . /opt/cloud/bin/setup/common.sh
 
 consoleproxy_svcs() {
-  echo "cloud" > /var/cache/cloud/enabled_svcs
   echo "haproxy dnsmasq apache2 nfs-common portmap" > /var/cache/cloud/disabled_svcs
   mkdir -p /var/log/cloud
 }
diff --git a/systemvm/debian/opt/cloud/bin/setup/postinit.sh b/systemvm/debian/opt/cloud/bin/setup/postinit.sh
index d067df2..fdb2111 100755
--- a/systemvm/debian/opt/cloud/bin/setup/postinit.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/postinit.sh
@@ -30,37 +30,6 @@ else
 fi
 sysctl -p
 
-# HYPERVISOR exported by cloud-early-config
-HYPERVISOR=$(</etc/cloudstack-agent_detected_hypervisor)
-case $HYPERVISOR in
-   xen-pv|xen-domU)
-      systemctl stop ntpd
-      systemctl start xe-daemon
-      ;;
-   xen-hvm)
-      systemctl stop ntpd
-      systemctl start xe-daemon
-      ;;
-   kvm)
-      systemctl start qemu-guest-agent
-      VPORT=$(find /dev/virtio-ports -type l -name '*.vport' 2>/dev/null|head -1)
-      ;;
-   vmware)
-      # system time sync'd with host via vmware tools
-      systemctl stop ntpd
-      systemctl start open-vm-tools
-      ;;
-   virtualpc|hyperv)
-      # Hyper-V is recognized as virtualpc hypervisor type. Boot args are passed using KVP Daemon
-      systemctl start hyperv-daemons.hv-fcopy-daemon.service hyperv-daemons.hv-kvp-daemon.service hyperv-daemons.hv-vss-daemon.service
-      ;;
-   virtualbox)
-      # Virtualbox is used to test the virtual router
-      ;;
-   esac
-
-
-
 
 # Restart journald for setting changes to apply
 systemctl restart systemd-journald
@@ -103,3 +72,5 @@ fi
 systemctl enable --now --no-block ssh
 
 date > /var/cache/cloud/boot_up_done
+
+systemctl start cloud
diff --git a/systemvm/debian/opt/cloud/bin/setup/secstorage.sh b/systemvm/debian/opt/cloud/bin/setup/secstorage.sh
index 8b6d4ee..8d5440a 100755
--- a/systemvm/debian/opt/cloud/bin/setup/secstorage.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/secstorage.sh
@@ -19,7 +19,7 @@
 . /opt/cloud/bin/setup/common.sh
 
 secstorage_svcs() {
-  echo "apache2 cloud nfs-common portmap" > /var/cache/cloud/enabled_svcs
+  echo "apache2 nfs-common portmap" > /var/cache/cloud/enabled_svcs
   echo "conntrackd keepalived haproxy dnsmasq" > /var/cache/cloud/disabled_svcs
   mkdir -p /var/log/cloud
 }