Closed Karthik-K-N closed 3 months ago
/assign
@Karthik-K-N I already see following command which does create the vm, wondering any specific use case we are trying to solve part of this command?
ibmcloud pi ins create --help
Create a server instance.
Usage:
pi instance create INSTANCE_NAME --image IMAGE --subnets "SUBNET1 [IP1]"[,"SUBNETn [IPn]"]
[--IBMiCSS-license=True|False] [--IBMiPHA-license=True|False] [--IBMiRDS-users NUMBER-USERS] [--deployment-type TYPE]
[--key-name NAME] [--memory MEMORY] [--pin-policy POLICY] [--placement-group GROUP_ID] [--processor-type PROC_TYPE]
[--processors PROCESSORS] [--replicant-affinity-policy AFFINITY_POLICY] [--replicant-scheme SCHEME] [--replicants NUMBER]
[--shared-processor-pool SHARED_PROCESSOR_POOL] [--storage-affinity STORAGE_AFFINITY_POLICY]
[--storage-affinity-instance INSTANCE] [--storage-affinity-volume VOLUME] [--storage-anti-affinity-instances INSTANCE1[,INSTANCEn]]
[--storage-anti-affinity-volumes VOLUME1[,VOLUMEn]] [--storage-pool STORAGE_POOL] [--storage-tier STORAGE_TIER] [--sys-type TYPE]
[--user-data USER_DATA] [--virtual-cores ASSIGNED_CORES] [--volumes VOLUME1[,VOLUMEn]]
INSTANCE_NAME: The name of the instance.
Aliases:
create, cr
Flags:
--IBMiCSS-license IBMi CSS software license associated with the instance.
--IBMiPHA-license IBMi PHA software license associated with the instance.
--IBMiRDS-users int Number of IBMi RDS users software license associated with the instance, default IBMiRDSUsers=0 (no license).
-d, --deployment-type string The custom deployment type ("EPIC" or "VMNoStorage").
-i, --image string Operating system image identifier or name.
-k, --key-name string Name of SSH key.
-m, --memory float Amount of memory (in GB) to allocate to the instance. Default is 2GB.
--pin-policy string Pin policy ("none", "soft", "hard"). Default is "none".
--placement-group string The placement group ID of the group that the server will be added to.
-r, --processor-type string Type of processors: "shared" or "dedicated" or "capped". Default is "dedicated".
-p, --processors float Amount of processors to allocate to the instance. Default is 1 core.
--replicant-affinity-policy string Affinity policy to use when multicreate is used ("affinity", "anti-affinity")
--replicant-scheme string Naming scheme to use for duplicate VMs ("suffix", "prefix").
--replicants int Number of duplicate instances to create in this request.
--shared-processor-pool string The shared processor pool ID of the pool that the server will be in.
--storage-affinity string Affinity policy for storage pool selection. Valid values are "affinity" and "anti-affinity". If --storage-pool is provided, then this it cannot be specified.
--storage-affinity-instance string PVM instance identifier or name to base storage affinity policy against; required if "--storage-affinity affinity" is specified and --storage-affinity-volume is not provided.
--storage-affinity-volume string Volume identifier or name to base storage affinity policy against; required if "--storage-affinity affinity" is specified and --storage-affinity-instance is not provided.
--storage-anti-affinity-instances strings Comma separated list of PVM instance identifiers or names to base storage affinity policy against; required if "--storage-affinity anti-affinity" is specified and --storage-anti-affinity-volumes is not provided.
--storage-anti-affinity-volumes strings Comma separated list of volume identifiers or names to base storage affinity policy against; required if "--storage-affinity anti-affinity" is specified and --storage-anti-affinity-instances is not provided.
--storage-pool string Storage pool for server deployment (use "ibmcloud pi storage-pools" to see available storage pools). Only valid when you deploy one of the IBM supplied stock images. Storage tier and pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage tier and pool the image was created in.
-t, --storage-tier string Storage tier for server deployment when deploying a stock or custom image (use "ibmcloud pi storage-tiers" to see available storage tiers in the targeted region). Default to tier3 if not provided.
-n, --subnets strings Comma separated list of subnet identifiers or names and optional IP address to associate with the instance.
-s, --sys-type string Name of System Type ('s922', 's1022', 'e980', 'e1080'). Default is "s922".
-u, --user-data string The user data passed into the instance. Strings and file names are supported. File names must be prepended with "@".
--virtual-cores int The number of virtual cores assigned.
-v, --volumes strings Comma separated list of volume identifiers or names to associate with the instance.
Global Flags:
-h, --help Display help information for the command.
--json Format output in JSON
I am more specifically looking into attaching the existing DHCP private network to VM while creating it. The newly created vm should have a public network along with that a private DHCP network attached to it.
I am more specifically looking into attaching the existing DHCP private network to VM while creating it. The newly created vm should have a public network along with that a private DHCP network attached to it.
don't we have that option in the above command line? I'm just playing a devil's advocate role here :)
I am more specifically looking into attaching the existing DHCP private network to VM while creating it. The newly created vm should have a public network along with that a private DHCP network attached to it.
don't we have that option in the above command line? I'm just playing a devil's advocate role here :)
I am not completely sure whether we can achieve that using ibmcloud cli need to explore so I mentioned that as an alternative in issue description, If we can do the same we can close this issue. The requirement came during debug of somthing so before i forget it thought of creating this issue.
@KeerthanaAP lets gather the ibmcloud pi
command to do what @Karthik-K-N is mentioning and assess the usability and see if there is scope for making it easier for the users, if yes - then we can implement or else close the issue.
Note: I'm just trying to avoid duplication
In ibmcloud pi instance create
cli we have an option --subnets
to attach any number of existing subnets, using this option we can attach the existing DHCP private network to VM while creating it and if we need a public network along with it we can use the same option subnets
to add the public network as well.
$ibmcloud pi instance create TESTVM2 --image testrhel88 --subnets DHCPSERVERcapi-powervs-keerthana-new_Private,publicnet1
Creating instance TESTVM2 under account PCLOUD Hypershift as user Keerthana.Arumugam1@ibm.com...
Instance TESTVM2 created.
ID 74b33306-d983-455c-9ef7-ca67ffbe471a
Name TESTVM2
CPU Cores 1
Memory 2
Processor Type dedicated
System Type s922
Subnets 4b35724b-7dd2-4c11-847a-e31149cf3855, 1f72c189-8c71-46e6-aa71-ed4c314e23eb
Boot Disk Size 120
Volumes -
Storage Tier tier3
Pin Policy none
Image cb981149-6324-48fa-8ef2-eef989caae81
Created 0001-01-01T00:00:00.000Z
Last Updated 0001-01-01T00:00:00.000Z
Status BUILDING
Progress 0
Storage Pool General-Flash-7
Storage Pool Affinity -
Shared Processor Pool -
Shared Processor Pool ID -
Placement Group -
Deployment Type -
Address Internal Address: , Mac Address:
Internal Address: , Mac Address:
To create a Public network we can use the below command
$ibmcloud pi subnet create publicnet1 --net-type public
Creating subnet publicnet1 under account PCLOUD Hypershift as user Keerthana.Arumugam1@ibm.com...
ID 1f72c189-8c71-46e6-aa71-ed4c314e23eb
Name publicnet1
VLAN 2087
Type pub-vlan
CIDR Block 192.168.198.216/29
DNS 9.9.9.9
IP Range [192.168.198.218-192.168.198.222]
Gateway 192.168.198.217
MTU -
Jumbo false
Public IP Range [169.59.175.218-169.59.175.222]
with the above options we can achieve the mentioned usecase. If we want to make it simple
we can implement create vm with an option --publicnetwork
and check for public subnets in the workspace and attcah it. If no public subnets present in the workspace, create a public subnet and attach it.
@mkumatag @Karthik-K-N could you provide your opinion in this
I think this should be sufficient.
Just another quick question, On a newly created workspace do you see any centos images to create VM. Usually we dont see them under boot images but we get a option to select while creating a VM, So is there any command to list the images as well in workspace or global?
Yes karthik, There is a command to list the images available in the regional image catalog,
$ibmcloud pi image lc
Listing catalog images under account PCLOUD Hypershift as user Keerthana.Arumugam1@ibm.com...
ID Name Address
6d935671-233b-4c54-8f5f-a7dfcce90c8f 7200-05-07 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/6d935671-233b-4c54-8f5f-a7dfcce90c8f
25f2a54a-fd7d-436c-aa61-2ab0b2158a94 7300-02-01 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/25f2a54a-fd7d-436c-aa61-2ab0b2158a94
f2662e73-c868-4108-a024-92b981fd5331 CentOS-Stream-9 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/f2662e73-c868-4108-a024-92b981fd5331
10a0b323-a3dd-4770-a917-dab13361f234 IBMi-72-09-2924-10 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/10a0b323-a3dd-4770-a917-dab13361f234
4252c582-6eab-4cd7-be6c-9af58978095e IBMi-72-09-2984-10 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/4252c582-6eab-4cd7-be6c-9af58978095e
e1ae3f2a-4c4a-4c80-ad7f-6d06ff30db5d IBMi-73-13-2924-3 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/e1ae3f2a-4c4a-4c80-ad7f-6d06ff30db5d
e3a38238-545a-4c7e-97c1-da9f1d51e3ac IBMi-73-13-2984-3 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/e3a38238-545a-4c7e-97c1-da9f1d51e3ac
1a12b3ff-24e2-4314-b95e-319aa74685d1 IBMi-74-09-2924-1 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/1a12b3ff-24e2-4314-b95e-319aa74685d1
8ed29bc9-b735-4418-a4d7-eca5d0fe1abc IBMi-74-09-2984-1 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/8ed29bc9-b735-4418-a4d7-eca5d0fe1abc
763e54cb-85a9-41cb-8991-0d9e9fffed51 IBMi-75-03-2924-2 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/763e54cb-85a9-41cb-8991-0d9e9fffed51
27dad8a5-cd05-46f7-8203-5dc346057922 IBMi-75-03-2984-1 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/27dad8a5-cd05-46f7-8203-5dc346057922
c5e2a6cf-f269-4928-bbd5-69a69c7ae173 IBMi_COR-74-09-1 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/c5e2a6cf-f269-4928-bbd5-69a69c7ae173
9f5eca21-e38b-4d0f-b614-76467b4418bb OCP-DHCP-SERVER /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/9f5eca21-e38b-4d0f-b614-76467b4418bb
658b91f9-a800-48d7-b3ce-2cc5ee302524 RHEL8-SP8 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/658b91f9-a800-48d7-b3ce-2cc5ee302524
2466d0c8-ad0f-47e2-9ad1-a9e9ca89d7e7 RHEL8-SP8-BYOL /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/2466d0c8-ad0f-47e2-9ad1-a9e9ca89d7e7
c81d340e-44fa-42bb-91e3-6a0fc61b8b31 RHEL9-SP2 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/c81d340e-44fa-42bb-91e3-6a0fc61b8b31
318f68ee-3e9f-4cc1-8966-80fa31537f06 RHEL9-SP2-BYOL /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/318f68ee-3e9f-4cc1-8966-80fa31537f06
ac87a69a-0889-42c5-b2f9-94f1c911ec8a SLES15-SP5 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/ac87a69a-0889-42c5-b2f9-94f1c911ec8a
6f245bcf-f5f5-41ff-8bcf-12b960661c8a SLES15-SP5-BYOL /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/6f245bcf-f5f5-41ff-8bcf-12b960661c8a
57f40a73-1b17-43db-95a9-8a58a6ec6cee Tier5k-General-Flash-74 /pcloud/v1/cloud-instances/c26da1db662c4b728e11e26a6d0eb414/stock-images/57f40a73-1b17-43db-95a9-8a58a6ec6cee
Awesome thanks, then this issue can be closed as we have same requirement can be achieved using ibmcloud cli. Thank you for verifying
/close
@Karthik-K-N: Closing this issue.
I would like to have a command to create a vm in user provided workspace with provided network attached to it. like
In capi or IPI we often create a vm with dhcp network, for debugging anything on that vm we are not able to direclty login to that vm as its private DHCP ip, So we often create a VM with public network and attach the private network to it and use it as a jump host to debug.
Alternative: Explore using ibmcloud cli to achieve the same
What happened:
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
pvsadm version
):cat /etc/os-release
):uname -a
):