Access to the content of the problems and configuring scheduled tasks
Hi all!
I am new to the community. IM an apprentice in the last year. I'm working with vmware esx / vsphere since August 2009.
In December 2009 I started to script powershell and powerCLI.
Maybe someone can help me, I searched for a long time, but I do not know how.
I have a small script that takes you through some menus. There you can select the data center, the template and insert the name of the virtual machine. Data warehouses and the host or a cluster will automatically get to deploy. In the end, the script creates an INI file like this:
vmname = test
Location = VENV40
Model = w2k3eesp2x32_template
Cluster_Host = adcv43e.xxx.yyyy .net
DatastoreSystem = esx40_nfs01_SystemDrives1
DatastoreSwap = esx40_nfs02_SwapDrives1
VCenterVENV = xx.yy.xx.yyy
Now to my problem. The second script should be an infinite loop, looking if there are a few new INI files.
Due to our policies, we can only deploy during the night (storage overhead). We have 3 "slots". to 01:00 to 03:00 and 05:00, where we can deploy a virtual machine.
The second script should get the regular deployment of the Vcenter task and check if there is a "slot" to deploy, if not, check the next night and so on.
My problems are:
I can not only the deployment task
The departure time you have a time difference in the vcenter? (eastern daylight time?)
When I got the available task, how to create a new one with the Ini file information?
Someone at - it an idea?
That's what I have so far. It was just to try if I can get the scheduled task
--------------------------------------------------------------------------------------------
Force load (otherwise VMware.Vim items are not known)
http://Reflection.Assembly: LoadWithPartialName ("vmware.vim")
CLS #clearscreen
$svcRef = new-object VMware.Vim.ManagedObjectReference
$svcRef.Type = 'ServiceInstance.
$svcRef.Value = 'ServiceInstance.
$serviceInstance = get-views $svcRef
This returns a MoRef scheduled task manager
$schMgr_ref = $serviceInstance.Content.scheduledTaskManager
This returns the actual scheduled task manager object
$schMgr_obj = get-views $schMgr_ref
The method must be called on the object
The method requires 1 argument.
As the API Ref stipulates that when the parameter is Null, the method will return
all scheduled tasks
$foo = $schMgr_obj. RetrieveEntityScheduledTask ($null)
The method returns an array of task object references
{foreach ($task in $foo)
$infos = (get-view $task) .info
$taskname = $infos. Name
$taskdate =($infos.) Scheduler). RunAt
$task = "$taskname", "$taskdate".
}
#----
Thanking you in anticipation.
I am looking before I heard you and sorry for my bad English
Greetings PowaCLI
There are two problems.
(1) the property $cloneSpec.Location.Pool must a resourcepool pint. In the script below I took the default value (and hidden) resourcepool called Resources.
(2) the $spec. Scheduler property must be one of AfterStartupTaskScheduler, OnceTaskScheduler, RecurrentTaskScheduler.
You will probably need to put the $spec. Scheduler.runAt to the property a value if you want to avoid the task starts immediately.
$taskName = "Create new VM" $taskHours = 1,3,5 $iniPath = "D:\__IPA_PowerCLI_VM\INI\" Connect-VIServer 10.11.4.209 $si = Get-View ServiceInstance $schedMgr = Get-View $si.Content.scheduledTaskManager $scheduled = @() $schedMgr.ScheduledTask | %{Get-View -Id $_} | %{ if($_.Info.Name -like ($taskName + "*")){ $scheduled += $_.Info.NextRunTime.ToLocalTime() } } $now = Get-Date -Minute 0 -Second 0 if($now.Hour -gt $taskHours[-1]){ $now = $now.AddDays(1) } $iniFiles = Get-Item ($iniPath + "*") -Include "*.csv" foreach($iniFile in $iniFiles){ $params = Import-Csv $iniFile # -UseCulture $notScheduled = $true while($notScheduled){ $taskHours | %{ $schedTime = $now.Date.AddHours($_) if(!($scheduled -contains $schedTime)){ $spec = New-Object VMware.Vim.ScheduledTaskSpec $spec.Action = New-Object VMware.Vim.MethodAction $arg1 = New-Object VMware.Vim.MethodActionArgument $arg1.Value = New-Object VMware.Vim.VirtualMachineRelocateSpec $arg1.value = (Get-Folder vm| Get-View).MoRef # (Get-Folder $params.Location| Get-View).MoRef $spec.Action.argument += $arg1 $arg2 = New-Object VMware.Vim.MethodActionArgument $arg2.value = "TESTVM" $spec.Action.argument += $arg2 $cloneSpec = New-Object VMware.Vim.VirtualMachineCloneSpec $cloneSpec.Location = New-Object VMware.Vim.VirtualMachineRelocateSpec $cloneSpec.Location.Datastore = (Get-Datastore qesx00_nfs01_SystemDrives1| Get-View).MoRef $cloneSpec.Location.Pool = (Get-cluster QVENV00_Cluster00 | Get-ResourcePool Resources | Get-View).MoRef $arg3 = New-Object VMware.Vim.MethodActionArgument $arg3.value = $clonespec $spec.Action.argument += $arg3 $spec.Action.Name = "CloneVM_Task" $spec.Description = "Test" $spec.Scheduler = New-Object VMware.Vim.OnceTaskScheduler $spec.Enabled = $true $spec.Name = $taskName + " " + $now $entity = Get-Template IPAtestmaschine_Luca | Get-View $schedMgr.CreateScheduledTask($entity.MoRef,$spec) $notScheduled = $false } } $now = $now.AddDays(1) } }
____________
Blog: LucD notes
Twitter: lucd22
Tags: VMware
Similar Questions
-
Hello
Since a few days I tried to access my files on web creative cloud without success. I ve had this message only:
"Temporarily unavailable page. We will be back soon. »
"We are working quickly to resolve the problem and apologize for the delay."
Check back later or visit our website for updates of status.
In addition, you can get help in forums of the creative cloud.
Thank you for understanding! »(I used Google Translate)
Help someone?
Not sure if you've managed to solve this problem yet or not. I do not no what are the contents of your proxy script, but it's something that you (or your company) you have to solve.
-
When connect my external hard drive and opening not wanting my my files, I get this message "shortened lcwipx.exe you make reference to is not available"and her does not open. He also asked delete me the shortcut. What is the problem and how to solve this?
Hi Pascal,.
I see that you get an error trying to access files on an external drive. I'll help you with this problem.
1. What is the brand and model of the computer?
2. What is the brand and model of the external drive?
3. what security software is installed on the computer?
4. have you made changes on the computer recently?
5A external drive earlier good work?
6. have you updated to Service Pack 2 installed?
Method 1.
Connect a different drive to the computer and check.
Method 2.
Plug this external drive on another computer and check the status.
Method 3.
Start the computer in safe mode and check.
Start your computer in safe mode: http://windows.microsoft.com/en-SG/windows-vista/Start-your-computer-in-safe-mode
Method 4.
Run a full scan of the computer with the Microsoft Safety Scanner to make sure that the computer is virus-free.
Microsoft safety scanner: http://www.microsoft.com/security/scanner/en-us/default.aspx
Warning of Security Scanner: there could be a loss of data while performing an analysis using the Microsoft safety scanner to eliminate viruses as appropriate.
Let us know if you need assistance with any windows problem. We will be happy to help you.
-
I've recently updated several broadcasts in my house from V1 to V2 in the hope of resolving a constant jumping and abandonment problem I always had when playing music with Airplay. I have a unit of airtime plugged directly on my stereo receiver that feeds music throughout my house. My WiFi connection is not the problem and there is nothing to cause interference. Airplay modules are not more than 15 feet distance modem or range Extenders. Someone else has this problem and, hopefully, a solution? I'm tired of doing factory reset all the time. Many thanks for any advice.
I've recently updated several broadcasts in my house from V1 to V2 in the hope of resolving a constant jumping and abandonment problem I always had when playing music with Airplay.
By "Airplays" what are you actually refers to... Base station airPort Express, Apple TV, or something else?
... and "V1 to V2" do you mean you replaced a 1st generation 802.11n AirPort Express with a 2nd generation?
Airplay modules are not more than 15 feet distance modem or range Extenders.
When steaming audio with AirPlay, the flow goes first to the device host to iTunes to the router Wi - Fi, this unit is connected to. From there, he will travel to the AirPlay "speaker". A president could be an AirPort Express, Apple TV or an AirPlay device ready another manufacturer. If you use line extensions, the flow must go through those as well... so there is potential bottlenecks between the host and the speaker. One of these could be the cause of the issue you found.
-
After you install the update, I get this message on a Facebook '502 Bad Gateway application
Nginx' what is the problem and how do I solve the problem?See also:
-
Chromatic wheel keeps going of and activity stops. What is the problem and the solution?
You meet the SBBOD (the spinning beachball of death).
This means your MBP is trying to make his way through some task or tasks that he doesn't have sufficient resources to effectively or if you have a software problem that interferes with the efficient completion of the task (s). Common causes on this discussion:
- "antivirus" software from third-party manufacturers
- different types of cleaners 'misguided' and other dreck (for example, CleanMyMac, MacKeeper)
- trying to run too many processes for the hardware you have.
- Insufficient RAM for the processes that you try to run
- Hard drive that is too full
- CPU or hard drive that is too slow for the software you are trying to run.
- hard drive that is running out.
Download and run Etrecheck http://www.etresoft.com/etrecheck and send the output to an answer here, and we can take a look and see what the problem is.
-
After that I closed the lid on my laptop, when I reopen it, I have to keep moving the lid until I can get a picture. What could be the problem and how to fix?
Hello
Looks like a loose connector or a short circuit in the video cable. Check with a real
store computer (one that works on computers cell phones internal ASUStek) or ASUStek
Support, their documentation and online in their forums.Not a maintainable question by the user.
ASUStek support
http://support.ASUS.com/ASUStek Forums
http://VIP.ASUS.com/forum/default.aspx?SLanguage=en-usASUStek drivers
http://support.ASUS.com/download/download.aspx?SLanguage=en-usI hope this helps.
Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="">-><- mark="" twain="" said="" it="">->
-
I want to be able to allow user group to be able to reset passwords and create accounts in an organizational unit. I delegate control of the organizational unit for the group, but if I connect to the domain controller and try opening users and computers active directory, we wonder an administrator password. I have a mix of two domain controllers Server 2003 and a Server 2008 DC. Is there a way to give a group access to the users and computers active directory without being administrator?
For assistance, please ask for help in the appropriate Microsoft TechNet Windows Server Forum.
Thank you. -
Error message Windows XP Home Edition comes out "generic host process for win 32 services has encountered the problem and needs to close" when you log on windows xp. I found the article exactly to what I have experienced http://support.microsoft.com/kb/821690 but as far as I know, this issue is not caused by an old HP printer. Can you give me the steps to fix this problem other that that link I mentioned. Thank you.
Hello
· You have a HP printer connected to the computer?
If so, try the article you mentioned.
Generic host process error message and a flashlight icon appear
If this is not the case, check to see if this article helps you.
Error messages when you start a Windows XP-based computer and then try to download Windows updates
-
Acer laptop, Vista is, she can connect wirelessly with my friend modem but my house, she can't, I use the service of Comcast, they checked the modem is fine, they think that the problem of configuration! I'm not computer too, thank you!
Ryan (Shih Chi)Hello
How do you try to connect the computer to the House? Wiredor wireless?Try the methods provided and see if it helps to solve the problem.Method 1:
Check out the link and follow the troubleshooting steps in the article.
Windows wireless and wired network connection problems
http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-WindowsMethod 2:
If you try to connect to t Wireless net work then refer to this link and follow the steps.
Connect to a network with Windows Vista wireless
http://TechNet.Microsoft.com/en-us/library/bb878035.aspxMethod 3:
Reset TCP/IP on your computer and check. Check out the link and follow the steps.
How to reset the Protocol Internet (TCP/IP)
http://support.Microsoft.com/kb/299357Method 4:
You can also visit this link and follow the steps.
Windows Vista cannot obtain an IP address from certain routers or some non-Microsoft DHCP servers
http://support.Microsoft.com/kb/928233/en-usImportant This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: 322756 (http://support.microsoft.com/kb/322756/ ) how to back up and restore the registry in Windows -
My function paste decides to stop working randomly. What could be the problem and how could solve this problem?
A repair from the Vista DVD installation. Don't forget to have a backup/restore point just in case.
http://Windows.Microsoft.com/en-us/Windows/help/install-reinstall-uninstall
-
I have a desktop with Windows Vista. Many times, the screen is the gel with an error massage "video Mode not supported". What could be the problem and the solution. ?
Hi Izzy Nagar,
· Exactly when you receive this error message?
· Did you do changes on the computer before the show?
· Do you have any extended monitor connected to the computer in the past or at the present time?
Follow the suggestions below for a possible solution:
Method 1: You can try to reduce the resolution of the screen (lower), then check if the message still appears.
Check also if the refresh rate of the monitor is set correctly and check the manual of the monitor for assistance.
Ways to improve display quality
http://Windows.Microsoft.com/en-us/Windows-Vista/ways-to-improve-display-quality
Flicker of the correct monitor (refresh rate)
http://Windows.Microsoft.com/en-us/Windows-Vista/correct-monitor-flicker-refresh-rate
Method 2: Use the option ' enable video low resolution (640 × 480) "start, then update your video card driver and check if the problem still persists.
a. click the Start button, click the arrow next to Shut Down and then click on restart.
b. do one of the following:
· If your computer has a single operating system installed, press and hold the F8 key as your computer restarts. You need to press F8 before the Windows logo appears. If the Windows logo appears, try again by waiting until the Windows logon prompt appears, and then stop and restart your computer.
· If your computer has more than one operating system, use the arrow keys to select the operating system you want to start in safe mode, and then press F8.
c. on the Advanced Boot Options screen, use the arrow keys to select activate video low resolution (640 × 480) and press ENTER.
d. connect to your computer with an account of a user who has administrator rights.
e. If you can see your desktop, there is a problem with your video card. Try to update your video card driver. For more information, see the article:
Updated a hardware driver that is not working properly
I hope this helps.
-
Cannot clear history of the problem and the Solutions
I have a problem who hung out in my reports on the problems and Solutions that I can't remove. Its been there since I installed Vista on my system and refers to a mistake of installing raid drivers.
I have since installed drivers, but whenever I try to delete the problem, or clear the history of the problem, I gives me an error saying simply "Impossible to delete 1 Item.
Anyone know how I can go about deleting this?
Thank you
JasonTry to use one of the following free products to remove the file/folder. Unlocker to: http://www.softpedia.com/get/System/System-Miscellaneous/Unlocker.shtml or file Assassin http://www.malwarebytes.org/fileassassin.php (with or without forcing the deletion: http://www.mydigitallife.info/2008/12/27/force-delete-cannot-delete-locked-or-in-used-files-or-folders-with-fileassassin/). These programs often work when normal functions remove Vista not work correctly.
If it still does not work, try to start in safe mode (repeatedly press F8 during the boot process until the menu appears) and try to use these products to delete the file in safe mode.
I hope this helps.
Good luck!
Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.
-
I have the same problem as Laweaver.
I have a HP pavillion Model # m9040n running the 32-bit version with service pack 1.
My Vista Ultimate Upgrade drive is 32 bit and also has Service Pack 1 on it.
I ran my system through the Microsoft Update and it is common.
I ran Vista Advisor and he tells me that everything is good to go.
I also ran my system through the center of update of HP and he is current.
I tried the Ultimate Upgrade three times and got the same message twice.
Of course, it waits until it reaches "end of the upgrade" before it fails.
I turned all the extra wide including the firewall when I tried the upgrades
My computer came with the home edition Premium already installed on it and I have the disks of backup for him if I have to do a repair on it.
I have the same question though - how to tell what the cause of the problem and fix?
Thank you
RichHi Eaglesoar1,
This problem occurs because some features of Windows Vista cannot be migrated to the upgraded version of Windows Vista.
To resolve this issue, follow these steps:
1. click on Start, type programs and features in the search box, and then click programs and features in the list programs.
2. under tasks, click on turn Windows features on or OFF.
If you are prompted for an administrator password, type the password. If you are prompted to confirm, click continue.
3. Click to clear the check boxes for the following features:
o Microsoft .NET Framework 3.0\XPS Viewer
O remote differential compression
O DFS replication service window
4 upgrade Windows Vista to a more advanced version and then click to select the check boxes that you clicked to clear in step 3.For more information see the Microsoft kb article below.
Error message when you try to upgrade Windows Vista to a more advanced version of Windows Vista: "Windows cannot configure one or more system components to install Windows, restart the computer, and restart the installation.
http://support.Microsoft.com/kb/946078I hope this helps!
Halima S - Microsoft technical support.
Visit our Microsoft answers feedback Forum and let us know what you think. -
can you please help I am running windows vista Home premium and letters on the keyboard are in french is my question mark key e, what is the problem and how to fix it thanks Dan
Your keyboard is set to french. To resolve this problem, look at the right hand of the bar at the bottom and you will see a keyboard. Click on it and press U.S..
I hope this helps.
Maybe you are looking for
-
How can I prevent popups symbol when I type "ss" or "ll" in a Word?
How can I prevent OS X 10.11.6 popping symbols when I type "ss" or "ll" in a Word? In some contexts, typing the second 's' or 'l' is effectively blocked until I have press a different key.
-
How to import a video of pictures of imovie?
Before I upgraded to OS X El Capitan version 10.11.2, my videos automatically appeared in imovie after a simple command prompt. The only way that I can download now share them to my desktop and then import into imovie. I would not however hate this
-
Last update of Firmware: Droid RAZR MAXX HD
Hey guys,. I was wondering what are the latest updates of firmware for Droid RAZR MAXX HD? My backup phone that was running the software 9.20, grabbed the update at 9:30 beginning of last week, but do not seem to phones of my parents who ran the 9.18
-
Picture of front of Sub VI update
My main screen of the user interface has a picture that put up-to-date control as long as the user interacts with it. For example, when the user clicks on a certain spot on a picture control, the machine that I am control passes to the location that
-
HP2000 -: recovery of personal records
I did a system restore. I saved personal files to a flash drive. After system recovery, I did a restore of file with the flash player. He installed the files and gave me a shortcut on the desktop, but they may not return from whence they came. How re