Deploying and managing RHEL systems in hybrid clouds Red Hat Insights 1-latest Deploying and managing your customized RHEL system images in hybrid clouds Red Hat Customer Content Services

Commands:
ipa-hcc register <registration token> Domain information: realm name: <REALM_NAME> domain name: <domain_name> dns domains: <dns_domains>
Proceed with registration? Yes/No (default No): <Yes>
dnf remove ipa-hcc-server
chmod 400 <your-instance-name.pem>
ssh -i "<_your-instance-name.pem_> ec2-user@<_your-instance-IP-address_>"
{ "image_status": { "status": "success", "upload_status": { "options": { "image_name": "composer-api-03f0e19c-0050-4c8a-a69e-88790219b086", "project_id": "red-hat-image-builder" }, "status": "success", "type": "gcp" } } }
gcloud config set project PROJECT_ID
gcloud compute instances create INSTANCE_NAME --image-project PROJECT_ID_FROM_RESPONSE --image IMAGE_NAME --zone GCP_ZONE
gcloud compute instances describe INSTANCE_NAME
gcloud compute ssh --project= PROJECT_ID --zone= ZONE INSTANCE_NAME
{ "image_status": { "status": "success", "upload_status": { "options": { "image_name": "composer-api-03f0e19c-0050-4c8a-a69e-88790219b086", "project_id": "red-hat-image-builder" }, "status": "success", "type": "gcp" } } }
"image_name": "composer-api-03f0e19c-0050-4c8a-a69e-88790219b086", "project_id": "red-hat-image-builder"
gcloud config set project PROJECT_ID
gcloud compute images create MY_IMAGE_NAME --source-image-project red-hat-image-builder --source-image IMAGE_NAME
gcloud compute images list --no-standard-images
instance-id: cloud-vm local-hostname: vmname
#cloud-config users: - name: admin sudo: "ALL=(ALL) NOPASSWD:ALL" ssh_authorized_keys: - ssh-rsa AAA...fhHQ== your.email@example.com
request.json { "image_name": "ova_image_name", "distribution": "rhel-94", "image_requests": [ { "architecture": "x86_64", "image_type": "vsphere-ova", "upload_request": { "type": "vmdk", "options": {} } } ], "customizations": { "users": [ { "name": "user-name", "ssh_key": "ssh-rsa AAAAB...qfGI+vk", "password": "password" } ] } }
curl --silent --request POST --header "Authorization: Bearer USDaccess_token" --header "Content-Type: application/json" --data @request.json https://console.redhat.com/api/image-builder/v1/compose
id: fd4ecf3c-f0ce-43dd-9fcc-6ad11208b939
curl --silent --header "Authorization: Bearer USDaccess_token" "https://console.redhat.com/api/image-builder/v1/composes/USDcompose_id" | image_ID.
id: fd4ecf3c-f0ce-43dd-9fcc-6ad11208b939
{ "image_status": { "status": "success", "upload_status": { "options": { "url": "https://image-builder-service-production.s3.amazonaws.com/composer-api-76...-disk.ova?e42..." }, "status": "success", "type": "aws.s3" } } }
curl --location --output vsphere-ova.vmdk "https://image-builder-service-production.s3.amazonaws.com/composer-api-76...-disk.ova?e42..."
GOVC_URL GOVC_DATACENTER GOVC_FOLDER GOVC_DATASTORE GOVC_RESOURCE_POOL GOVC_NETWORK
export METADATA=USD(gzip -c9 <metadata.yaml | { base64 -w0 2>/dev/null || base64; }) USERDATA=USD(gzip -c9 <userdata.yaml | { base64 -w0 2>/dev/null || base64; })
govc import.vmdk ./composer-api.vmdk foldername
govc vm.create -net.adapter=vmxnet3 -m=4096 -c=2 -g=rhel8_64Guest -firmware=bios -disk=" foldername /composer-api.vmdk" -disk.controller=ide -on=false vmname
govc vm.change -vm vmname -e guestinfo.metadata="USD{METADATA}" -e guestinfo.metadata.encoding="gzip+base64" -e guestinfo.userdata="USD{USERDATA}" -e guestinfo.userdata.encoding="gzip+base64"
govc vm.power -on vmname
HOST=USD(govc vm.ip vmname )
ssh admin@HOST
instance-id: nocloud local-hostname: vmname
#cloud-config user: admin password: password chpasswd: {expire: False} ssh_pwauth: True ssh_authorized_keys: - ssh-rsa AAA...fhHQ== your.email@example.com
genisoimage -output cloud-init.iso -volid cidata -joliet -rock user-data meta-data I: -input-charset not specified, using utf-8 (detected in locale settings) Total translation table size: 0 Total rockridge attributes bytes: 331 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 0 183 extents written (0 MB)
virt-install --memory 4096 --vcpus 4 --name myvm --disk composer-api.qcow2,device=disk,bus=virtio,format=qcow2 --disk cloud-init.iso,device=cdrom --os-variant rhel1-latest --virt-type kvm --graphics none --import
Starting install Connected to domain myvm [ OK ] Started Execute cloud user/final scripts. [ OK ] Reached target Cloud-init target. Red Hat Enterprise Linux 1-latest (Ootpa) Kernel 4.18.0-221.el8.x86_64 on an x86_64
subscription-manager refresh
CLIENT_ID=" YOUR_CLIENT_ID " CLIENT_SECRET=" YOUR_CLIENT_SECRET " ACCESS_TOKEN=USD( curl -d "client_id=USDCLIENT_ID" -d "client_secret=USDCLIENT_SECRET" -d "grant_type=client_credentials" "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token" -d "scope=api.console" | jq -r .access_token )