From 69296dce29fc014714e54053b7f383664ad1ccb0 Mon Sep 17 00:00:00 2001 From: Eric Gable Date: Mon, 25 Nov 2013 14:24:14 -0800 Subject: [PATCH 1/5] Remove reference to Shutdown in Role.StateConsumer. Remove code processing GoalState.ExpectedState 'Stopped' and code that sends 'Shutdown' to StateConsumer script. Changed: embedded waagent.conf Agent.Run() --- waagent | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/waagent b/waagent index d936b22..ad464c4 100644 --- a/waagent +++ b/waagent @@ -46,7 +46,7 @@ import xml.dom.minidom GuestAgentName = "WALinuxAgent" GuestAgentLongName = "Windows Azure Linux Agent" -GuestAgentVersion = "WALinuxAgent-1.4.0" +GuestAgentVersion = "WALinuxAgent-1.4.1" ProtocolVersion = "2011-12-31" #WARNING this value is used to confirm the correct fabric protocol. Config = None @@ -1088,7 +1088,6 @@ class GoalState(Util): # There is only one Role for VM images. # # Of primary interest is: -# Machine/ExpectedState -- this is how shutdown is requested # LBProbePorts -- an http server needs to run here # We also note Container/ContainerID and RoleInstance/InstanceId to form the health report. # And of course, Incarnation @@ -1101,7 +1100,7 @@ class GoalState(Util): def reinitialize(self): self.Incarnation = None # integer - self.ExpectedState = None # "Started" or "Stopped" + self.ExpectedState = None # "Started" self.HostingEnvironmentConfigUrl = None self.HostingEnvironmentConfigXml = None self.HostingEnvironmentConfig = None @@ -2082,16 +2081,6 @@ class Agent(Util): Children.append(subprocess.Popen([program, "Ready"])) program = None - if goalState.ExpectedState == "Stopped": - program = Config.get("Role.StateConsumer") - if program != None: - Run(program + " Shutdown") - self.EnvMonitor.ShutdownService() - self.LoadBalancerProbeServer_Shutdown() - command = '/sbin/shutdown -hP now' - Run(command) - return - sleepToReduceAccessDenied = 3 time.sleep(sleepToReduceAccessDenied) if provisionError != None: @@ -2311,9 +2300,7 @@ WaagentConf = """\ # Windows Azure Linux Agent Configuration # -Role.StateConsumer=None # Specified program is invoked with "Ready" or "Shutdown". - # Shutdown will be initiated only after the program returns. Windows Azure will - # power off the VM if shutdown is not completed within ?? minutes. +Role.StateConsumer=None # Specified program is invoked with "Ready". Role.ConfigurationConsumer=None # Specified program is invoked with XML file argument specifying role configuration. Role.TopologyConsumer=None # Specified program is invoked with XML file argument specifying role topology. From 3298e7502df9b5dc195cf5fb25339ebd7fccb3b3 Mon Sep 17 00:00:00 2001 From: Eric Gable Date: Mon, 25 Nov 2013 14:25:15 -0800 Subject: [PATCH 2/5] Remove reference to Shutdown in Role.StateConsumer. --- README | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README b/README index 9fbea8d..6b36b7f 100644 --- a/README +++ b/README @@ -179,11 +179,6 @@ about to be reported to the Fabric. The argument specified to the program will be "Ready". The waagent will not wait for the program to return before continuing. -* When the waagent has received a shutdown request from the Fabric -and is about to shutdown the VM. The argument specified to the program will be -"Shutdown". waagent will wait for the program to return before initiating the -shutdown process. - Role.ConfigurationConsumer: Type: String Default: None From 9d824a30487ee4d8db1e9d05cb819ae08dd284cd Mon Sep 17 00:00:00 2001 From: Eric Gable Date: Mon, 25 Nov 2013 14:25:47 -0800 Subject: [PATCH 3/5] Remove reference to Shutdown in Role.StateConsumer. --- config/waagent.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/waagent.conf b/config/waagent.conf index 86f42fd..414a026 100644 --- a/config/waagent.conf +++ b/config/waagent.conf @@ -2,9 +2,7 @@ # Windows Azure Linux Agent Configuration # -# Specified program is invoked with "Ready" or "Shutdown". -# Shutdown will be initiated only after the program returns. Windows Azure will -# power off the VM if shutdown is not completed within ?? minutes. +# Specified program is invoked with "Ready" Role.StateConsumer=None # Specified program is invoked with XML file argument specifying role From ae82aa91db92f90e0ff7dc60900761d9afa6ed6b Mon Sep 17 00:00:00 2001 From: Stephen Zarkos Date: Tue, 26 Nov 2013 15:03:59 -0800 Subject: [PATCH 4/5] Minor update in Readme --- README | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README b/README index 6b36b7f..17b253a 100644 --- a/README +++ b/README @@ -172,12 +172,10 @@ Configuration File Options: Role.StateConsumer: Type: String Default: None -If a path to an executable program is specified, it is invoked at two events: - -* When the waagent has provisioned the image and the "Ready" state is -about to be reported to the Fabric. The argument specified to the program will -be "Ready". The waagent will not wait for the program to return before -continuing. +If a path to an executable program is specified, it is invoked when waagent has +provisioned the image and the "Ready" state is about to be reported to the +Fabric. The argument specified to the program will be "Ready". The agent will +not wait for the program to return before continuing. Role.ConfigurationConsumer: Type: String Default: None From c1e715a3b16f1153a6faafe538654d3d393e1604 Mon Sep 17 00:00:00 2001 From: Stephen Zarkos Date: Tue, 26 Nov 2013 15:08:03 -0800 Subject: [PATCH 5/5] Update Changelog --- Changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog b/Changelog index 2a1efbe..afc4554 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,9 @@ WALinuxAgent Changelog ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +?? ??? ????, WALinuxAgent 1.4.1 + . Remove reference to VM shutdown on "stopped" state. This behavior was an + artifact from pre-GA IaaS VMs on Windows Azure. + 23 Aug 2013, WALinuxAgent 1.4.0 . Add support for bootstrapping VMM agent for Linux when running in SCVMM 2012R2 environments (see README)