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

Upload ISO to NFS/SMB SR #4471

Closed
julien-f opened this issue Sep 2, 2019 · 11 comments
Closed

Upload ISO to NFS/SMB SR #4471

julien-f opened this issue Sep 2, 2019 · 11 comments

Comments

@julien-f
Copy link
Member

julien-f commented Sep 2, 2019

Unfortunately there is no way through the XenAPI to upload ISOs to SRs.

As a work-around we could get the info necessary to connect to the NFS/SMB shares that are used for the SRs, and then directly create the ISOs on them.

See also #288.

@nagilum99
Copy link

Alternatively to NFS/SMB: You could SSH XCP-ng to get the required informations.
I understand to try to stay with XAPI as much as possible, but this could at least be a temporary bridge.

If wanted I'll open a separate request, but it might fit to this one:
It's also pretty welcome/needed for local ISO storage. I'd try to go by piping through SSH/SCP here. I use that to copy stuff between servers. It's not super fast, but comfy to use and built in (pretty much like WinSCP).

@olivierlambert
Copy link
Member

No SSH from XO, it's not a good answer to this problem. Having XO accessing the ISO share to upload ISOs is frankly superior.

@nagilum99
Copy link

Currently the only option is SCP. Either you go with WinSCP/pipe it through an SSH session or XOA would do it and add the web-GUI on top. I don't see any other solution. If SSH is a bad answer: What's better in your opinion?

Pros:

  • SSH is active by default
  • Credentials for root-user match with XAPI, so credentials are known already

Cons:

  • Not limited onto XAPI usage
  • ?

@olivierlambert
Copy link
Member

You'll need to add a potential SSH access on your all your dom0 for XO, and that's not good. You can disable root access for SSH if you like (as Citrix recommend), so this doesn't make sense too. Adding this extra condition on an agentless management solution is not acceptable to me, especially for this use case.

Also, more than that: it's not the point. We need to upload ISO to the ISO SR, which is -in most of cases- a network share that's mounted in read only on the dom0 (so accessing the dom0 would be pointless anyway). The acceptable use case is that XO get the SR mount options (via the PBD) and try to mount it inside XO in RW, to be able then to upload ISOs there.

If you use a local SR ISO, it's a non-officially supported use case, so I don't think it's a good idea to send ISO to the dom0 where you can fill the root space (it's not meant to be used like that).

The last alternative is to use XO as the shared SR ISO repository itself. The only issue (and it's not a small one) is to be able to control how much space used to avoid breaking your XO because of no disk space left…

@4censord
Copy link

4censord commented Apr 3, 2022

it is currently possible to create isos on an iso-sr with the following xe commands:

xe vdi-create sr-uuid=$SR_UUID name-label=testdisk2 virtual-size=$ISO_SIZE
xe vdi-import uuid=$VDI_UUID filename=/path/to/ISO

That makes it possible to add isos without sshing to the hosts.

And it proves that it is possible via the xapi.
Trying the same via xo-cli seems currently broken, #6154

Assuming of course the ISO-sr is writable from the xcp-ng hosts.

@olivierlambert
Copy link
Member

I'm very surprised about this. Are you sure you are importing on an ISO SR and not a "normal" SR?

@4censord
Copy link

4censord commented Apr 3, 2022

Yes, i am sure.
My iso sr is a read/writable nfs share.
The resulting vdi is listed in my iso sr, and can be added to vms as a cd.

My iso sr:

[22:41 xcp-ng2 ~]# xe sr-list
uuid ( RO)                : 191389af-9767-e63d-8a1c-0bc7762fd3a8
          name-label ( RW): ISO
    name-description ( RW): NFS ISO storage on truenas
                host ( RO): <shared>
                type ( RO): iso
        content-type ( RO): iso

I have been testing with grml:

wget https://download.grml.org/grml64-full_2021.07.iso
ls -l grml64-full_2021.07.iso
# get the filename and size
xe vdi-create sr-uuid=191389af-9767-e63d-8a1c-0bc7762fd3a8 name-label=grml virtual-size=824442880
xe vdi-import uuid=$VDI_UUID filename=grml64-full_2021.07.iso

It then shows up as a cdrom and can be added to vms.
Attach it to a new vm and boot it to see the grml bootloader.

@olivierlambert
Copy link
Member

Hmm interesting, so we probably have to try on XO side. If it's that simple, then we could obviously provide an upload form for ISO SR :)

@olivierlambert
Copy link
Member

@marcungeschikts can you create a spike card? "Is it possible to upload directly an ISO to an ISO SR?" 👍

@julien-f
Copy link
Member Author

@fbeauchamp Has it been fixed by #6180?

@olivierlambert
Copy link
Member

It is done, indeed (with it seems a small bug that we might discuss)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants