auto-shutdown | Turns off your computer after some time , like a sleep | Date Time Utils library
kandi X-RAY | auto-shutdown Summary
kandi X-RAY | auto-shutdown Summary
An application to turn off your computer after a timer.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of auto-shutdown
auto-shutdown Key Features
auto-shutdown Examples and Code Snippets
Community Discussions
Trending Discussions on auto-shutdown
QUESTION
Using VSCode with WSL2. Everything was alright until last week. From today, I observed that it is taking time to start the WSL. The following is the log from VSCode.
...ANSWER
Answered 2021-Feb-22 at 07:07The issue seems to be due to proxy configuration in the VSCode settings. Removing it has resolved the delay.
QUESTION
Background and Goal
I have a Debian/Linux VM
on GCP
which I manually start every morning and after it runs, it shuts down by itself using a Linux command. I want to automate the start of the VM by using the Cloud Scheduler
. The question asked in GCP auto shutdown and startup using Google Cloud Schedulers has several answers and I am interested in pursuing the answer (https://stackoverflow.com/a/65062924/10322004) proposed by @nikelone
because it seems to be simple and also it has been endorsed by @Damien
and @RayFoss
as being easy. I am a neophyte in these matters and I could not comprehend their replies fully. So this post was created to elicit more clear answers for a person like me.
What I have tried
I have gone to https://cloud.google.com/compute/docs/reference/rest/v1/instances/start (call this page A
) and tried the API
and was able to successfully start my already stopped VM
when I clicked on the execute button. I presume that this means that my entries were fine and can be used in conjunction with appropriate software like Cloud Scheduler
to perform the start function on a predefined schedule. But the problem is that I do not know or understand how to proceed from here. I give below my questions.
My Questions
On
page A
, the last three paragraphs are titled Authorization Scopes, IAM permissions, and Examples, and none of them say anything specific about what the user should do. Is it correct to assume that they have nothing to do with theCloud Scheduler
, but related to other methods to achieve the same goal? If this is not correct then my next question is what should I be doing to follow the statements in these three paragraphs?Assuming that the answer to question 1 is "yes", meaning I can now start scheduling with the
Cloud Scheduler
, I next looked at thequickstart
forCloud Scheduler
at https://cloud.google.com/scheduler/docs/quickstart (call this page B
). The list of items to do is quite large including installing Cloud SDK, running a quite a few commands on the console, enabling some features, set up Pub/Sub, create a job, run the job and verify the results in Pub/Sub. This looks like a daunting set of tasks and I could not understand why it is necessary to jump through the hoops to use something that has already been achieved with just a few keystrokes earlier. So are these steps all necessary? Or is there a way to use the Cloud Scheduler directly without going through so many intermediate steps?Now assume that the answer to question 2 is that I have to perform all steps stated on
page B
. If I run into some problem while accomplishing the tasks outlined on page B, myVM
may get messed up irretrievably. Is there a way in which the Cloud Platform or its components can be used to reset myVM
to its current state as of today, which is working fine? I really do not want to end up with something worse than what I have now.
ANSWER
Answered 2021-Mar-24 at 23:06To answer your questions:
Auth Scopes and IAM permissions are required for you to call the Compute Engine API methods such as instance.start & instance.stop. You need to set the right scope and the right IAM permission on your job or else it will fail. They are indeed related to the method that you're interested to call so you must keep them in mind. What you see on the examples are the ways to call the {API} using different programming languages so you don't need to pay attention to them as you will create the job through the Cloud Console. To further address this part, see the full steps I included below.
The answer that you're trying to follow uses HTTP target while the quickstart you've linked uses Pub/Sub and they are different with each other because they have separate use cases. This link shows a proper instruction how to create a scheduler job with an HTTP target. You can create this kind of job straight from the Cloud Console or a one-liner gcloud command. If your config is incorrect, the trigger will not execute the endpoint URL and you will see an error that you must fix.
Addressed on answer #2
Basically, you just need to follow the instructions to the link you've sent. However, I'll post it here as well along with my explanation:
- Go to https://cloud.google.com/scheduler. Click on Go to Console. Click on Create Job. Fill up the required fields (those with red asterisks) when creating a Scheduler Job.
- Select HTTP as target type.
- Enter this as your URL (modify the capitalized words).
QUESTION
I want to get the list of azure servers having auto-shutdown disabled on them, I have the below script but the issue with the script is that it gets the list of RG's under the Subscription GUID but repeats the output after every loop.
...ANSWER
Answered 2020-Oct-27 at 04:30Try something like this to get the auto-shutdown status of all VMs. Instead of trying to get the schedules inside the loop, get all the ones in the subscription and match them based on the VM's full resource Id.
QUESTION
I use Azure- windows VM for running some services, the services are very stable(after testing). The server run one day and after that he has fallen and i get this message. **
Diagnose and solve problems
In Activity log
Resource health
Solved
The problem was in 'Auto-shutdown' it was enabled to 'Scheduled shutdown'. you can find it under - HOME --> VM --> Auto-shutdown(under the title Operations).
...ANSWER
Answered 2020-Mar-17 at 08:20From the Activity Log, we can see the Azure Lab Service initiated the VM deallocation.
When you create a Lab Service in Azure, there is an option for you to automatically shut down virtual machines when users disconnect. It's probably the reason. This could help save costs.
It's the same Lab policy when you create template VMs in the lab Account or change it later.
QUESTION
I have an Azure Windows VM configed with Auto-shutdown for the sake of costing saving. It works fine that every night it shuts down the machine as scheduled. But everyday I needs to go to Azure potal to starts it manually. Is there a way to start the Azure VM automatically on a scheduled time? Thanks.
...ANSWER
Answered 2020-Feb-24 at 04:03One of the possible solutions to this problem is to use Azure Automation
.
Detailed instructions on how to start/stop VM on a pre-defined schedule is described in details here: https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management#scenarios.
QUESTION
I have a vm under azure that runs my software for a client, I want to automatically stop the vm if my software does not run (My software does not run means for me the client does not use the vm and i can stop-it and restart-it the day after)
I know that azure offers the possibility to stop automatically a vm (Auto-shutdown) but I do not want to stop the vm only if my software does not run
to stop my vm, I use this code:
...ANSWER
Answered 2019-Oct-23 at 02:03Issue: I can't find how to execute Get-Process from Azure portal to a specific VM
If you want to run Run PowerShell scripts in your Windows VM, you can use the run command
feature on Azure Portal. For more details, please refer to https://docs.microsoft.com/en-us/azure/virtual-machines/windows/run-command.
QUESTION
I want to create a custom role in Azure to allow "Virtual machine operator" to set Auto-shutdown time.
I tried creating a custom role using JSON but don't know which is the action for "Auto-shutdown"
...ANSWER
Answered 2019-Jul-30 at 08:57If you enable the Auto-shutdown
for the VM, the Azure will create a resource whose resource type is Microsoft.DevTestLab/schedules
in the resource group the VM located. You could check it in the resource group(choose the Show hidden types
option).
So if you want to set the Auto-shutdown
time, you will need the Microsoft.DevTestLab/schedules/*
permission(maybe the Microsoft.DevTestLab/schedules/write
is the minimum permission, I have just test Microsoft.DevTestLab/schedules/*
).
Meanwhile, when we set the Microsoft.DevTestLab/schedules
, we also actually set the VM(the resource is linked to the VM scope), so we also need the Microsoft.Compute/virtualMachines/write
permission, otherwise you will get an error.
In conclusion, the custom role .json
file should be like below.
QUESTION
I am trying to programmatically using C# fetch the details of Auto-shutdown parameters for a selected VM from azure portal. The things i want to achieve are given below:
- First, get the auto shut down status it is enabled or disabled?
- If it is enabled then get auto shutdown time and its time zone related information
- Based on input update the timezone and time or disable the auto shutdown status on need basis
I want this to be done via C# program.
I am not knowing how to achieve it through the googling i have done. Please provide a detailed step by step guide how to achieve it as i am new to coding, C#, and AZURE
Please note that the VM's in our project are not created in any DevTest labs these are created through LCS directly and with DEMO env an option while creation.
Can you please provide details taking the above points into consideration? Or this is not possible as the step is not correct?
Please let me know if any other information is needed from my end to enable you provide me a solution.
I have already looked into below PowerShell script:
How to collect the Azure VM auto-shutdown time using PowerShell?
But this seems to be involving a VM created in DEV TEST lab which in my case will not work as our VM'S are not created in a separate lab has tried to explain above. Hence i think the script does not work
Tried to look into a few REST API but could not find anything there also.
...ANSWER
Answered 2019-Jul-01 at 15:14As you have noticed, accessing this feature in VMs outside of DevTest Labs is not officially supported. There is an available endpoint for reading and updating the schedule. However it is very important to note this is not currently an officially supported endpoint so it may change or stop working at any time.
The endpoint is:
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/shutdown-computevm-{vmName}?api-version=2018-10-15-preview
If I were to call this endpoint using a simple HttpClient in C# it would look something like this once I've obtained an authorization token:
QUESTION
I need to collect the Azure VM auto-shutdown time using PowerShell, but don't know how to get to the necessary resource property so the auto-shutdown time is reflected.
I am getting the following output:
...ANSWER
Answered 2019-May-24 at 18:56You need to add the -Expandproperties
switch to Get-AzureRMResource
to gain access the properties that contain the data you need. This will allow you to access .Properties
, which will return an object with various other properties (.dailyRecurrence
gives the shutdown time). The shutdown time appears to just be a string value of 4 numbers with the first two numbers representing the hour and last two being the minutes. So 6:30:45 AM would be 0630, and 11:45:55 PM would be 2345.
QUESTION
In one of my macros, I have a piece of code (several actually, in different places) which deletes any special signs from a string and then compares the values in the array and looks for duplicates. It looks like this:
...ANSWER
Answered 2017-Apr-12 at 06:45The default text comparison in VBA is in Binary mode. This is typically not what we want, regardless of whether this causes your particular problem.
A better way to compare strings safely, use StrComp(str1, str2, vbTextCompare)
. If this gives 0
, then the two strings are equal.
Some more details here.
Perhaps it is useful to first check if the strings are equal, and if they are not avoid their comparison altogether. Note that although a VBA string can contain about 2 billion Unicode characters, certain other limitations exist that are relevant (for example, a formula cannot exceed 255 characters, see also here).
I keep this answer here for future reference as it could be helpful to someone with a similar problem, although it seems it does not resolve the OP's problem.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install auto-shutdown
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page