Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citrix App Layering 1911 changed behavior #150

Open
Siebrandf opened this issue Nov 29, 2019 · 8 comments

Comments

@Siebrandf
Copy link

@Siebrandf Siebrandf commented Nov 29, 2019

Describe the bug
Since CAL 1911 the compositing methodology has been changed. it was already for Hyper-V in 1910 but is now as well for vSphere. When a layer is created a VM is created on the Hypervisor which boots into a like preinstallation environment which contacts the ELM. Now the OS and other prerequisite layers are copied over from the ELM whereafter the preparation VM restarts and boots into Windows for install tasks. When 'Shutdown for Finalize' is executed it changes the bootorder when C:\CitrixCE folder is detected. Which restarts the machine and in the PE Environmnet ELM is contacted whereafter layer finalize is automatically intiated.
BIS-F should reuse the detection of the CitrixCSE and provide a restart instead of shutdown, when a shutdown was configured trough ADMX.

To Reproduce
Steps to reproduce the behavior:

  1. Install ELM 1911, end enable 'offload Compositing' in the create connector
  2. Create a new Layer, equal what type
  3. configure BIS-F to Shutdown when complete
  4. Machine is shutdown, no able to finalize

Expected behavior
When ELM 1911 or above, and C:\CitrixCE is found, bootorder needs to be changed according to provided code and system should be restarted instead of shutdown
BIS-F version 7 1912 (Code Name: Bugs Bunny). Layer integrity checks done by BIS-F are just fine. Possible reuse of the Citrix provided functions.

A solution is provided by Citrix using the following, "C:\Program Files\Unidesk\Uniservice\PackagingMachine.ps1"

$CEDir = "$env:SYSTEMDRIVE\CitrixCE"

$shutdownFlag = "/s"
$bootIdPath = "$CEDir\bootid"
if(Test-Path $bootIdPath)
{
    $bootId = Get-Content -Path $bootIdPath
    & bcdedit /bootsequence $bootId
    if (-not $norestart) {
        $shutdownFlag = "/r"
    }
}

& "$env:SYSTEMROOT\System32\Shutdown.exe" $shutdownFlag /t 0 /d p:4:2 /c "Citrix layer finalization"
@EUCweb

This comment has been minimized.

Copy link
Owner

@EUCweb EUCweb commented Nov 29, 2019

@Siebrandf

This comment has been minimized.

Copy link
Author

@Siebrandf Siebrandf commented Nov 29, 2019

Yeah, that's a possibility. But detecting the version might be challenging without the SDK or webrequests. The 'Test-Path $bootIdPath' was already used by Citrix in 1910 as far as I can see. While C:\CitrixCE did not exist in that version, restartflag remains /s. You could implement the mentioned code and reuse the $shutdownflag method instead.

@matthias-schlimm

This comment has been minimized.

Copy link
Collaborator

@matthias-schlimm matthias-schlimm commented Nov 29, 2019

@Siebrandf

This comment has been minimized.

Copy link
Author

@Siebrandf Siebrandf commented Nov 29, 2019

Prep_BIS_CITRXAL1a8000_20191129-112100.txt

In the script I used I set LIC_BISF_CLI_SB=NO just before it triggers BIS-F, in that case I prevent BIS_F to shutdown the machine while we normally want the machine to be shutdown. I now change the bootorder, reset LIC_BISF_CLI_SB=YES, and restart the box.

@EUCweb

This comment has been minimized.

Copy link
Owner

@EUCweb EUCweb commented Nov 29, 2019

@Siebrandf

This comment has been minimized.

Copy link
Author

@Siebrandf Siebrandf commented Nov 29, 2019

Well, I guess not. BIS-F detects the existence of the layering agent in any config hence this should be solved at a more general level imho.

@Siebrandf

This comment has been minimized.

Copy link
Author

@Siebrandf Siebrandf commented Dec 3, 2019

Let me know if I should provide a code proposal

@EUCweb

This comment has been minimized.

Copy link
Owner

@EUCweb EUCweb commented Dec 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.