s3 buckets to sync to Appstream directory

0

I have a on-demand AppStream which I would like to sync with a particular bucket in s3. In the AppStream config, it has the session start which kicks off a powershell task to sync the s3 bucket at start which works fine. However, I was trying to run this same powershell task during the session every 5 minutes. Since the on-demand image is sys prepped, I can’t use the scheduled task generated in Image Builder to create the scheduled task.
AWS support says the only recommendation they would provide is to create the scheduled task during the session start with a powershell script which creates the task. So, I have the powershell script to create the task running at startup as system. I think I see the powershell task being created at session start in the AppStream logs (provides task name and state). However, there no trace of the scheduled task can be found. This is where I am stumped.
Not sure that anybody else has had the need for something similar. Any feedback would be great!

질문됨 2년 전460회 조회
2개 답변
0

Are you able to see the task created in the scheduled task? And what is the trigger for this scheduled task, only at startup or at startup and every 5 minutes there after. If you are running this task only at startup, it will not run because the startup phase has already passed but there is an option to add a delay which delays the task execution by specified time after startup I believe.

Also as far as I remember scheduled tasks persist after sysprep but I will need to double check this. I would recommend creating a support case for investigation.

AWS
답변함 2년 전
  • Hi Mayank, thanks for your attention. I am creating the task to run every 2 minutes. But I am open to scrutiny on the script. I did open a case with AWS. They said it falls under the customer responsibility. And I don't think AppStream will allow any different type of sysprep using the Image Builder.

    This is the script I have running in the Appstream config. Again, it doesn't appear to do what I would expect and I don't see it listed in task scheduler or in Get-ScheduledTask once the AppStream image is created.

    $ac = New-ScheduledTaskAction -Execute '"%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe' -Argument ('-File "C:\scripts\syncin1.ps1"') $tr = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 2) $sa = New-ScheduledTaskSettingsSet -Hidden $pr = New-ScheduledTaskPrincipal -UserID 'NT AUTHORITY\SYSTEM' -LogonType ServiceAccount -RunLevel Highest Register-ScheduledTask -TaskName 'SyncinTask' -Trigger $tr -Action $ac -Settings $sa -Principal $pr

0

Thank you for sharing the details. I will find some time to test it. However, syncing every 2 minutes doesn't seem to be a good idea if the files are big. It can take some time to upload/download the file between S3 and the fleet instance. If you don't configure the schedule task correctly, there may be to many tasks running in parallel which may cause performance issues. As for the case that you opened, I was not able to find it. Please ask the engineer owning the case to contact me by sharing this repost article on the case and I will work with him internally to find the solution.

AWS
답변함 2년 전
  • Hi Mayank, I am the engineer on this. My name is Sam and I can be reached as shsamuelhageman@gmail.com. The files were are operating with here are limited to csv files. Each csv file is 1-2 mb.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠