What does @tjkreidl have to say about bootstrapping an HVM guest using only XAPI on the CLI?
Eric P.
Reno, Nevada
What does @tjkreidl have to say about bootstrapping an HVM guest using only XAPI on the CLI?
Eric P.
Reno, Nevada
@olivierlambert said in Creating a VM using only the XAPI CLI...:
You'll need a better client to do that.
I don't understand. Would you please elaborate?
TIA,
Eric P.
Reno, Nevada
@olivierlambert Is there any way to bootstrap an HVM guest using only XAPI on the CLI?
TIA,
Eric P.
Reno, Nevada
If it's possible to over-subscribe vCPU's: What do vCPU's really represent - A weighted average of CPU cycles that will be allocated to the guest?
e.g., If a host has eight CPU cores with hyperthreading enabled and all four guests are allocated 16 vCPU's: What benefit will the four guests see over what they would experience if they had each been allocated 2 vCPU's?
TIA,
Eric Pretorious
Reno, Nevada
@olivierlambert Thanks. But I'm not looking for the most current method of installing a guest - I'm looking for the simplest method of installing a guest using XAPI on the command-line interface (CLI).
The "Citrix XenServer 7.2 Virtual Machine User's Guide" includes a method to do that using the CLI:
xe vm-install template=<template> new-name-label=<name_for_vm> sr-uuid=<storage_repository_uuid>
xe vif-create vm-uuid=<vm_uuid> network-uuid=<network_uuid> mac=random device=0
xe vm-param-set uuid=<vm_uuid> other-config:install-repository=<network_repository>
xe vm-start uuid=<vm_uuid>
But obviously it's missing something!
Have you got any suggestions about what might be missing from those four simple steps?
TIA,
Eric P.
Reno, Nevada
@olivierlambert I don't understand. Would you please elaborate?
TIA,
Eric P.
Reno, Nevada
FWIW: These are the contents of the remote package repository (nfs://192.168.0.95/srv/pkgs/ISO)
# mount -t nfs 192.168.0.95:/srv/pkgs/ISO /mnt
# ll /mnt
total 110
-rw-rw-r-- 1 root root 14 Sep 9 2019 CentOS_BuildTag
drwxr-xr-x 3 root root 2048 Sep 6 2019 EFI
-rw-rw-r-- 1 root root 227 Aug 30 2017 EULA
-rw-rw-r-- 1 root root 18009 Dec 9 2015 GPL
drwxr-xr-x 3 root root 2048 Sep 9 2019 images
drwxr-xr-x 2 root root 2048 Sep 9 2019 isolinux
drwxr-xr-x 2 root root 2048 Sep 6 2019 LiveOS
drwxrwxr-x 2 root root 73728 Sep 11 2019 Packages
drwxrwxr-x 2 root root 4096 Sep 11 2019 repodata
-rw-rw-r-- 1 root root 1690 Dec 9 2015 RPM-GPG-KEY-CentOS-7
-rw-rw-r-- 1 root root 1690 Dec 9 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r-- 1 root root 2883 Sep 11 2019 TRANS.TBL
HTH,
Eric P.
Reno, Nevada
FWIW: The result seems to be the same whether I use an ISO image on a remote NFS server (nfs://192.168.0.95/srv/images/ISO/CentOS-7.7-x86_64-Minimal.iso) or I use a remote package repository (nfs://192.168.0.95/srv/pkgs/ISO) for installation:
# VM_UUID=$(xe vm-install template=CentOS\ 7 new-name-label=CentOS7-2)
# echo $VM_UUID
c9c66b15-e618-dc12-0f93-8e39af102c8b
# VIF_UUID=$(xe vif-create mac=random device=0 vm-uuid=$VM_UUID network-uuid=$NET_UUID)
# echo $VIF_UUID
de6b51ec-54ed-fa0c-0ba2-7da732e8fa05
# xe vm-param-set uuid=$VM_UUID other-config:install-repository=nfs://192.168.0.95/srv/pkgs/ISO
# xe vm-start uuid=$VM_UUID
# xe console uuid=$VM_UUID
No text console available
# xe vm-param-list uuid=$VM_UUID | grep dom-id
dom-id ( RO): 8
# xenstore-ls /local/domain/8
xenstore-ls: xs_directory (/local/domain/8): No such file or directory
What am I doing wrong?
TIA,
Eric P.
Reno, Nevada
I'm attempting to create a CentOS-7 VM from the CLI using modified instructions from the "Citrix XenServer 7.2 Virtual Machine User's Guide":
# NET_UUID=$(xe network-list bridge=xenbr0 params=uuid | awk '{ print $5 }')
# echo $NET_UUID
47a6223e-74d0-b75d-bec3-0ca6324b498c
# VM_UUID=$(xe vm-install template=CentOS\ 7 new-name-label=CentOS7-1)
# echo $VM_UUID
26859adf-f2f9-77d6-3f3c-719ecd885535
# VIF_UUID=$(xe vif-create mac=random device=0 vm-uuid=$VM_UUID network-uuid=$NET_UUID)
# echo $VIF_UUID
decb158e-2961-7448-8b7c-4c2707298604
# xe vm-param-set uuid=$VM_UUID other-config:install-repository=nfs://192.168.0.95/srv/images/ISO/CentOS-7.7-x86_64-Minimal.iso
# xe vm-start uuid=$VM_UUID
But when I use the console
command in order to complete the installation of the operating system: I get this...
# xe console uuid=$VM_UUID
No text console available
And when I search Xenstore for the VNC-port information I get this:
# xe vm-param-list uuid=$VM_UUID | grep dom-id
dom-id ( RO): -1
What have I done wrong? How can I determine the root cause of the failure?
TIA,
Eric Pretorious
Reno, Nevada
What's the purpose of this other VNC daemon on TCP/9500?
From the Xen Project wiki page on XCP:
The ports used for VNC console are 5901-5999, and the ports used for text console are 9501-9599.
AFAICT: TCP/5900 & TCP/9500 belong to Dom0...
# xenstore-ls /local/domain/0
control = ""
feature-poweroff = "1"
feature-reboot = "1"
feature-suspend = "1"
domid = "0"
name = "Domain-0"
vncterm-pid = "1276"
console = ""
vnc-port = "5900"
tc-port = "9500"
vm = "/vm/7a4488c6-d4ac-4aaf-83f0-fb6d3f557f48"
But I don't know how to connect to DomU #1's console because there is no entry in Xenstore for DomU #1:
# xenstore-ls /local/domain/1
xenstore-ls: xs_directory (/local/domain/1): No such file or directory
Ideas? Suggestions?
Eric P.
Reno, Nevada
FWIW: I did notice that there was more than one TCP port connected to the VNC server:
# netstat -tanp | grep vnc
tcp 0 0 127.0.0.1:5900 0.0.0.0:* LISTEN 1276/vncterm
tcp 0 0 127.0.0.1:9500 0.0.0.0:* LISTEN 1276/vncterm
So I also connected to the TCP/9500 port:
$ ssh -L 9500:localhost:9500 root@192.168.0.92
root@192.168.0.92's password:
Last login: Tue Nov 1 01:14:11 2022
# xe vm-list name-label=CentOS7-1
uuid ( RO) : 2f343ae1-0d57-ef21-6a54-6abe7b7264c6
name-label ( RW): CentOS7-1
power-state ( RO): running
# xe vm-list name-label=CentOS7-1 params=dom-id
dom-id ( RO) : 1
But nothing ever happened! i.e., The VNC client failed to open a window on my local system.
What's the purpose of this other VNC daemon on TCP/9500?
TIA,
Eric P.
Reno, Nevada
@olivierlambert Yes - I authenticated as the root user. But after that there was nothing - Only a terminal session like a standard SSH session!
Ideas? Suggestions?
Eric P.
Reno, Nevada
I think that this wiki page from the Xen Project may provide the answer:
I've already confirmed that the host is listening on TCP/5900:
# netstat -tanp | grep \:59
tcp 0 0 127.0.0.1:5900 0.0.0.0:* LISTEN 1276/vncterm
So I configured the tunnel:
$ ssh -L 5900:localhost:5900 root@192.168.0.92
root@192.168.0.92's password:
Last login: Tue Nov 1 01:10:30 2022
# xe vm-list name-label=CentOS7-1
uuid ( RO) : 2f343ae1-0d57-ef21-6a54-6abe7b7264c6
name-label ( RW): CentOS7-1
power-state ( RO): running
# xe vm-list name-label=CentOS7-1 params=dom-id
dom-id ( RO) : 1
And then I launched the client and connected to localhost:5900:
$ vncviewer
TigerVNC Viewer 64-bit v1.12.0
Built on: 2022-03-25 17:06
Copyright (C) 1999-2021 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Mon Oct 31 18:18:08 2022
DecodeManager: Detected 8 CPU core(s)
DecodeManager: Creating 4 decoder thread(s)
CConn: Connected to host localhost port 5900
CConnection: Server supports RFB protocol version 3.3
CConnection: Using RFB protocol version 3.3
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
A connection is established:
# netstat -tanp | grep \:59
tcp 0 0 127.0.0.1:5900 0.0.0.0:* LISTEN 1276/vncterm
tcp 0 0 127.0.0.1:34046 127.0.0.1:5900 ESTABLISHED 18949/sshd: root@pt
tcp 0 0 127.0.0.1:5900 127.0.0.1:34046 ESTABLISHED 1276/vncterm
But the display seems to be a text console on the host system!
Have I misunderstood some detail?
Eric P.
Reno, Nevada
@olivierlambert Thanks!
Using only the CLI: How can I connect VNC to the guest in order to complete the installation? e.g., xe console-list vm-name-label=<<<your_vm>>>
lists an HTTP URL for connecting to the host...
# xe console-list vm-name-label=CentOS7-1
uuid ( RO) : fd376ea3-a644-2ed3-2d72-8ae7ca7a6b71
vm-uuid ( RO): 2f343ae1-0d57-ef21-6a54-6abe7b7264c6
vm-name-label ( RO): CentOS7-1
protocol ( RO): RFB
location ( RO): https://192.168.0.93/console?uuid=fd376ea3-a644-2ed3-2d72-8ae7ca7a6b71
But it doesn't seem to do anything!
TIA,
Eric P.
Reno, Nevada
@olivierlambert Thanks for asking! My goal is to manually create a single CentOS VM so that I can get a better understanding all of the complicated details that XO hides from XCP-ng/XenServer administrators.
@olivierlambert I'm just wanting to create a CentOS VM using the CLI.
@olivierlambert Is there a command for connecting VNC to the VM's console?
I'm attempting to create a CentOS-7 VM from the CLI using the instructions from the "Citrix XenServer 7.2 Virtual Machine User's Guide":
# xe network-list | grep -B1 eth0
uuid ( RO) : 47a6223e-74d0-b75d-bec3-0ca6324b498c
name-label ( RW): Pool-wide network associated with eth0
# xe pool-param-list uuid=e3cdb4f9-6589-2ac2-f08a-9318a8a48a61 | grep default-SR
default-SR ( RW): 21044441-dfba-9293-408b-41379e194718
# xe vm-install template=Red\ Hat\ Enterprise\ Linux\ 7 new-name-label=CentOS7-1 sr-uuid=21044441-dfba-9293-408b-41379e194718
2f343ae1-0d57-ef21-6a54-6abe7b7264c6
# xe vif-create vm-uuid=2f343ae1-0d57-ef21-6a54-6abe7b7264c6 network-uuid=47a6223e-74d0-b75d-bec3-0ca6324b498c mac=random device=0
f21d558a-c9ba-bb65-d2bc-6c2310d4a0cf
# xe vm-param-set uuid=2f343ae1-0d57-ef21-6a54-6abe7b7264c6 other-config:install-repository=nfs://192.168.0.95/srv/images/ISO/CentOS-7.7-x86_64-Minimal.iso
# xe vm-start uuid=2f343ae1-0d57-ef21-6a54-6abe7b7264c6
But when I start the VM: XAPI complains No text console available
# xe console vm=CentOS7-1
No text console available
# xe vm-list | grep -A1 -B1 CentOS
uuid ( RO) : 2f343ae1-0d57-ef21-6a54-6abe7b7264c6
name-label ( RW): CentOS7-1
power-state ( RO): running
What am I doing wrong?
TIA,
Eric Pretorious
Reno, Nevada
@olivierlambert Refreshing the status log and updating a second time retrieves/installs more updates.
After that: The '+ New' menu button appears in the menu on the left side of the window!
Thank you!
Eric P.
Reno, Nevada