apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
1.87k stars 1.08k forks source link

Can not new a Baremetal Instance when using cloudstack to manager the Baremetal Server ? #8168

Open xuanyuanaosheng opened 8 months ago

xuanyuanaosheng commented 8 months ago

We want using cloudstack to manager the Baremetal Server to achieve to deploy the OS on physical server.

ISSUE TYPE
COMPONENT NAME
CLOUDSTACK VERSION
CONFIGURATION

image

The Zone name is csbm using Basic (Network type). and the cluster Hypervisor is BareMetal

The config is as below:

image

image

STEPS TO REPRODUCE
  1. Create a basic Zone as above
  2. Add Baremetal Server info:
    ilo:   10.25.30.242
    Ilo Host MAC: f4:02:70:9c:a5:d0
    of CPU cores:  14
    CPU (in MHz): 1000
    Memory (in MB): 515240   (MemTotal:       527606672 kB)
    Host Net MAC: 34:80:0d:43:39:ec
  3. Add second storage using NFS
  4. Add the above Baremetal Server to the cluster
  5. The template is ks=http://10.26.20.11:8080/cloudstack_ks/CentOS-79-x86_64.ks;kernel=10.26.20.11:/var/lib/tftpboot/images/CentOS-7.9-x86_64/vmlinuz;initrd=10.26.20.11:/var/lib/tftpboot/images/CentOS-7.9-x86_64/initrd.img and add it to the zone:
  6. Add BaremetalDhcpProvider and BaremetalPxeProvider:

image

  1. Add compute offering:

image

  1. New a Instance: image

The error on web UI: image

Request failed. (431)
Hypervisor BareMetal does not support rootdisksize override

The cloudstack manager error log is:

2023-11-01 11:52:11,611 WARN  [o.a.c.a.ProjectRoleBasedApiAccessChecker] (qtp1955920234-21:ctx-6316c47a ctx-d191f040) (logid:8b62d839) Project is null, ProjectRoleBasedApiAccessChecker only applies to projects, returning API [deployVirtualMachine] for user [User {"username":"admin","uuid":"5be40e54-0958-11ec-8fc1-005056b6a63a"}.] as allowed.
2023-11-01 11:52:11,613 DEBUG [o.a.c.a.StaticRoleBasedAPIAccessChecker] (qtp1955920234-21:ctx-6316c47a ctx-d191f040) (logid:8b62d839) RoleService is enabled. We will use it instead of StaticRoleBasedAPIAccessChecker.
2023-11-01 11:52:11,614 DEBUG [o.a.c.r.ApiRateLimitServiceImpl] (qtp1955920234-21:ctx-6316c47a ctx-d191f040) (logid:8b62d839) API rate limiting is disabled. We will not use ApiRateLimitService.
2023-11-01 11:52:11,642 DEBUG [c.c.u.AccountManagerImpl] (qtp1955920234-21:ctx-6316c47a ctx-d191f040) (logid:8b62d839) Access granted to Account [{"accountName":"admin","id":2,"uuid":"5be302d9-0958-11ec-8fc1-005056b6a63a"}] to org.apache.cloudstack.quota.vo.ServiceOfferingVO$$EnhancerByCGLIB$$46ce7255@3e0fe605 by AffinityGroupAccessChecker
2023-11-01 11:52:11,643 DEBUG [c.c.u.AccountManagerImpl] (qtp1955920234-21:ctx-6316c47a ctx-d191f040) (logid:8b62d839) Access granted to Account [{"accountName":"admin","id":2,"uuid":"5be302d9-0958-11ec-8fc1-005056b6a63a"}] to null by AffinityGroupAccessChecker
2023-11-01 11:52:11,658 INFO  [c.c.a.ApiServer] (qtp1955920234-21:ctx-6316c47a ctx-d191f040) (logid:8b62d839) Hypervisor BareMetal does not support rootdisksize override
2023-11-01 11:52:11,659 DEBUG [c.c.a.ApiServlet] (qtp1955920234-21:ctx-6316c47a ctx-d191f040) (logid:8b62d839) ===END===  10.64.94.63 -- GET  zoneid=f84ce38e-19a1-406c-b084-77fe9f2e0938&podid=89c04114-3d16-42a0-8b94-545d03d75574&clusterid=a26a640e-8196-436a-93a1-b4a6f8a1700f&hostid=651f88a7-7289-47b5-b546-ef082d3a469e&boottype=BIOS&bootmode=LEGACY&templateid=20886ce1-de64-4bcb-8b18-a46c5c0f1711&startvm=true&serviceofferingid=8625dc84-75b5-423f-b496-22dd266c8f71&affinitygroupids=&keypairs=&name=test001&displayname=test001&command=deployVirtualMachine&response=json

I don't know why the web UI using command=deployVirtualMachine to create a Baremetal Instance. Could you please take a look at this problem? If need other info, please add a comment.

EXPECTED RESULTS

Create a Baremetal Instance successfully

ACTUAL RESULTS

Can not Create a Baremetal Instance


I can not find some useful info on the official doc, I just find the belows:

Reference:
  1. http://events17.linuxfoundation.org/sites/events/files/slides/Baremetal-v4.1a.pdf
  2. https://github.com/apache/cloudstack/issues/5772
  3. https://cwiki.apache.org/confluence/display/CLOUDSTACK/Baremetal+KickStart
  4. https://download.cloudstack.org/centos/7/4.18/cloudstack-baremetal-agent-4.18.0.0-1.el7.x86_64.rpm
  5. https://github.com/apache/cloudstack/issues/8091
  6. https://docs.accelerite.com/app/cloudplatform/pdf/CloudPlatform_powered_by_Apache_CloudStack_Version_4.5.1_Getting_Started_Guide.pdf

@harikrishna-patnala @utchoang @hooklee2000

harikrishna-patnala commented 8 months ago

@xuanyuanaosheng good to see the usage of baremetal in the deployments. Thanks.

The steps that you've followed seems to be correct to me. The error that you are facing seems like a regression

https://github.com/shapeblue/cloudstack-apple/blob/1b35a5aa1c5112ff3de7461939da9700f131348d/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java#L4341

This call should not be here unless there are custom parameters defined to override disk offering.

We can fix it somehow but we need your help to verify the pull request due to lack of infrastructure. is it possible for you @xuanyuanaosheng

Also I'm not sure if full work flow for baremetal is in working condition as I've last tested it many years ago.

xuanyuanaosheng commented 8 months ago

@harikrishna-patnala I'm very happy to proceed with the next test. Please provide the relevant installation package.

xuanyuanaosheng commented 7 months ago

@harikrishna-patnala Any update?

harikrishna-patnala commented 7 months ago

@xuanyuanaosheng I'll need to investigate the issue and prepare a fix. Realistically I cannot promise a PR for this as I cannot reproduce the issue (due to lack of infra) but I'll give it a try

xuanyuanaosheng commented 7 months ago

@harikrishna-patnala Thanks, I will wait for you

Luskan777 commented 2 months ago

HI @xuanyuanaosheng @harikrishna-patnala,

I'm having the same problem here, is there any update?

I would like to help in some way. I can provide access to my infrastructure if necessary