Skip to content

Commit

Permalink
Bug-Id: CS-40323 : Baremetal provisioning for windows. squash commit …
Browse files Browse the repository at this point in the history
…with refactoring

Reviewed-By: Vaibhav
  • Loading branch information
ramamurtis authored and HARI KRISHNA committed Jul 27, 2015
1 parent 31b486d commit 207ed4f
Show file tree
Hide file tree
Showing 41 changed files with 2,539 additions and 198 deletions.
3 changes: 2 additions & 1 deletion api/src/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ public class ApiConstants {
public static final String AUTOSCALE_USER_ID = "autoscaleuserid";
public static final String BAREMETAL_DISCOVER_NAME = "baremetaldiscovername";
public static final String BAREMETAL_RCT_URL = "baremetalrcturl";
public static final String BAREMETAL_PROVIDER = "baremetalprovider";
public static final String UCS_DN = "ucsdn";
public static final String GSLB_PROVIDER = "gslbprovider";
public static final String EXCLUSIVE_GSLB_PROVIDER = "isexclusivegslbprovider";
Expand Down Expand Up @@ -634,4 +635,4 @@ public enum HostDetails {
public enum VMDetails {
all, group, nics, stats, secgrp, tmpl, servoff, diskoff, iso, volume, min, affgrp;
}
}
}
20 changes: 20 additions & 0 deletions core/src/com/cloud/agent/api/routing/VmDataCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
public class VmDataCommand extends NetworkElementCommand {

String vmIpAddress;
String vmMacAddress;
String vmName;
private boolean isWindows = false;
@LogLevel(Log4jLevel.Trace)
List<String[]> vmData;
boolean executeInSequence = false;
Expand Down Expand Up @@ -73,4 +75,22 @@ public void addVmData(String folder, String file, String contents) {
vmData.add(new String[] {folder, file, contents});
}

public boolean isWindows() {
return isWindows;
}

public void setWindows(boolean isWindows) {
this.isWindows = isWindows;
}

public String getVmMacAddress() {
return vmMacAddress;
}

public void setVmMacAddress(String vmMacAddress) {
this.vmMacAddress = vmMacAddress;
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import com.cloud.dc.HostPodVO;
import com.cloud.dc.PodCluster;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.DiscoveryException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.gpu.HostGpuGroupsVO;
import com.cloud.host.Host;
import com.cloud.host.Host.Type;
Expand Down Expand Up @@ -191,4 +193,11 @@ public interface ResourceManager extends ResourceService {
* @return Details of groupNames and enabled VGPU type with remaining capacity.
*/
HashMap<String, HashMap<String, VgpuTypesInfo>> getGPUStatistics(HostVO host);

List<HostVO> discoverHostsFull(Long dcId, Long podId, Long clusterId,
String clusterName, String url, String username, String password,
String hypervisorType, List<String> hostTags,
Map<String, String> params, boolean deferAgentCreation)
throws IllegalArgumentException, DiscoveryException,
InvalidParameterValueException;
}
5 changes: 5 additions & 0 deletions plugins/hypervisors/baremetal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>citrix</groupId>
<artifactId>moonshot-rest-interface</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@
<bean id="baremetalDhcpDaoImpl" class="com.cloud.baremetal.database.BaremetalDhcpDaoImpl" />
<bean id="baremetalPxeDaoImpl" class="com.cloud.baremetal.database.BaremetalPxeDaoImpl" />
<bean id="BaremetalRctDaoImpl" class="com.cloud.baremetal.database.BaremetalRctDaoImpl" />

<bean id="MoonshotNodeDaoImpl" class="com.cloud.baremetal.database.moonshot.MoonshotNodeDaoImpl" />
<bean id="MoonshotChassisDaoImpl" class="com.cloud.baremetal.database.moonshot.MoonshotChassisDaoImpl" />

</beans>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.baremetal.database.moonshot;

import com.cloud.utils.db.GenericDao;

public interface MoonshotChassisDao extends GenericDao<MoonshotChassisVO, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.baremetal.database.moonshot;

import javax.ejb.Local;

import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;

@Local(value = {MoonshotChassisDao.class})
@DB()
public class MoonshotChassisDaoImpl extends GenericDaoBase<MoonshotChassisVO, Long> implements MoonshotChassisDao {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.baremetal.database.moonshot;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;

@Entity
@Table(name = "moonshot_chassis")
public class MoonshotChassisVO implements InternalIdentity, Identity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;

@Column(name = "uuid")
private String uuid = UUID.randomUUID().toString();

@Column(name = "name")
private String name;

@Column(name = "url")
private String url;

@Column(name = "username")
private String username;

@Override
public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

@Override
public String getUuid() {
return uuid;
}

public void setUuid(String uuid) {
this.uuid = uuid;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.baremetal.database.moonshot;

import com.cloud.utils.db.GenericDao;

public interface MoonshotNodeDao extends GenericDao<MoonshotNodeVO, Long> {

public MoonshotNodeVO findByMacAddress(String macAddress);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.baremetal.database.moonshot;

import javax.annotation.PostConstruct;
import javax.ejb.Local;

import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.SearchCriteria.Op;

@Local(value = {MoonshotNodeDao.class})
@DB()
public class MoonshotNodeDaoImpl extends GenericDaoBase<MoonshotNodeVO, Long> implements MoonshotNodeDao {

protected SearchBuilder<MoonshotNodeVO> MacAddressSearch;

public MoonshotNodeDaoImpl() {

}

@PostConstruct
protected void init() {
MacAddressSearch = createSearchBuilder();
MacAddressSearch.and("macAddress", MacAddressSearch.entity().getMacAddress(), Op.EQ);
MacAddressSearch.done();
}

@Override
public MoonshotNodeVO findByMacAddress(String macAddress) {
SearchCriteria<MoonshotNodeVO> sc = MacAddressSearch.create();
sc.setParameters("mac_address", macAddress);
return findOneBy(sc);
}


}
Loading

0 comments on commit 207ed4f

Please sign in to comment.